Skip to content

Repository layout

A Cicord repository is plain YAML plus, optionally, the TypeScript sources of your own plugins.

  • cicord.yaml the Project: engine, source, registries, write-back, portal
  • cicord.lock generated: pinned registry plugins (commit + content hash)
  • Directoryservers/
    • ma-commu.yaml one Server per file, named after its key
    • Directoryassets/
      • Directoryma-commu/ icons, banners, emojis, stickers, sounds (written by cicord import)
        • …
  • Directorybots/
    • Directorymoderator/
      • bot.yaml one Bot per directory: token reference, servers, plugin instances
  • Directoryplugins/
    • Directorywelcome/ a local plugin: plugin.yaml, config.schema.json, src/
      • …
    • Directoryonboarding/
      • …
  • Directoryportal/ optional: a custom community portal (cicord portal init)
    • …
  • Directory.github/
    • Directoryworkflows/
      • cicord.yml CI: validate, plan on pull requests, wait for the sync
  • .gitignore
  • README.md

cicord init writes cicord.yaml, one server, one bot, the CI workflow, a README.md and a .gitignore. The complete example repository examples/basic adds two plugins, and examples/showcase runs seven more.

Every file holds one resource, Kubernetes style:

apiVersion: cicord.dev/v1alpha1 # the format version
kind: Server # Project, Server, Bot or Plugin
metadata:
name: ma-commu # the key
spec:
# …
File Kind Reference
cicord.yaml Project Project
servers/<key>.yaml Server Server
bots/<key>/bot.yaml Bot Bot
plugins/<name>/plugin.yaml Plugin Writing a plugin
cicord.lock (generated) Plugins overview

metadata.name is the resource key. It must match the file name (servers/<key>.yaml) or the directory name (bots/<key>/). metadata can also carry labels and annotations (string maps).

Keys match ^[a-z][a-z0-9-]{0,62}$ and never change. They are separate from the display names shown in Discord:

channels:
general: # ← key: stable, used for references and state
name: général # ← display name: change it freely (a rename, not a recreate)
category: community # ← a reference, by key
  • References between resources always use keys: a channel’s category, the role hierarchy, access roles, permission overwrite targets, a bot’s servers, and plugin config fields marked x-cicord-ref.
  • The runtime maps each key to a Discord ID in its database (the resource map), so a new display name is an update in Discord.
  • Changing a key keeps the Discord resource as long as the display name and the kind stay the same: the old key is removed, the new one adopts the resource. cicord mv renames a key and every reference to it in one step. Changing the key and the display name in the same commit is a deletion plus a creation.

cicord validate checks every reference; a key that does not resolve fails validation.

Configuration in git, data in the database

Section titled “Configuration in git, data in the database”

Only configuration goes to git. Everything that is data lives in the runtime’s state database (SQLite in the data directory):

In git In the database
Roles, channels, permissions, server settings The resource map (key → Discord ID, owner)
Bots, plugin instances, plugin settings Plugin storage (XP, warnings, tickets, member preferences)
Registries, write-back policies, portal options Audit log, sessions, sync history

This is why the runtime’s data directory must be backed up, and why the repository never sees commit loops from state changes.