All documented user journeys in the Codi framework. Each journey describes a concrete scenario: who the user is, what they want, the exact commands to run, and what to expect.
Table of Contents
- First-Time Setup
- Re-initialize with a Different Preset
- Non-Interactive Setup for CI
- Generate Agent Configs
- Watch for Changes and Auto-Regenerate
- Add a Rule
- Add a Skill
- Add an Agent
- Add an MCP Server
- Add a Brand
- Check Drift Status
- Update Artifacts to Latest Templates
- Reset Flags to a Preset
- Pull Centralized Artifacts from a GitHub Repo
- Upgrade the Codi CLI and Refresh Everything
- Create a Custom Preset
- Install a Preset from GitHub or ZIP
- Search the Preset Registry
- Update Installed Presets
- Export a Preset as ZIP
- Remove a Preset
- Validate a Preset
- Check Project Health
- Validate Configuration
- Full Compliance Check
- Verify Agent Loaded the Config
- Export a Skill for Distribution
- Review Skill Feedback
- View Skill Performance Stats
- Evolve a Skill from Feedback
- Manage Skill Versions
- Contribute Artifacts via PR or ZIP
- Clean Generated Files
- Revert to a Previous Backup
- Adopt Codi in an Existing Project (Migration)
- Debug Configuration Issues
- Run Codi in a CI Pipeline
- Launch the Interactive Command Center
- Set Up an AI Agent to Initialize Codi
1. First-Time Setup
Situation: You have a new project and no .codi/ directory. You want to set up Codi and get AI agent config files generated.
npm install -g codi-cli@latest
codi init
codi generate
What the wizard does:
- Detects your tech stack (TypeScript, Python, Go, etc.)
- Detects which AI agents are installed on your machine (Claude Code, Cursor, etc.)
- Asks you to choose a preset or build a custom selection of rules, skills, agents, and MCP servers
- Creates
.codi/with all selected artifacts - Writes
flags.yaml,state.json, and.artifact-manifest.yaml - Generates
CLAUDE.md,.cursorrules,AGENTS.md,.windsurfrules,.clinerules,.github/copilot-instructions.md - Installs pre-commit hooks into
.git/hooks/(or Husky, if present)
What you commit:
Both the .codi/ source directory and the generated agent config files. Agents read the generated files from the repository.
Conflict resolution (interactive terminal):
If generated files (CLAUDE.md, .cursorrules, etc.) have local changes, Codi shows a per-file diff and prompts:
- Accept incoming (overwrite local)
- Keep current (skip this file)
- Merge (interactive hunk-by-hunk in terminal)
- Merge in editor (opens
$EDITORor VS Code) - Accept ALL / Keep ALL (bulk options)
Non-interactive / CI conflict strategy:
Use --on-conflict to skip the prompt:
codi init --preset codi-balanced --agents claude-code --on-conflict keep-current # keep your files (default)
codi init --preset codi-balanced --agents claude-code --on-conflict keep-incoming # overwrite with new versions
--force is an alias for --on-conflict keep-incoming.
Gotchas:
- Hooks require a git repository. Run
git initfirst if the project is not yet a repo. - Use
codi init --forceto reinitialize an existing.codi/directory (overwrites everything).
2. Re-initialize with a Different Preset
Situation: You set up Codi with codi-minimal but now want stricter rules. You want to switch presets.
codi init --force --preset codi-strict
What happens:
- Loads the existing
.codi/directory (does not delete it) - Resets
flags.yamlto thecodi-strictpreset values - Overwrites existing preset artifacts with the new preset versions (no prompting with
--force) - Regenerates all agent config files
Gotchas:
- Without
--force, the command runs but skips existing.codi/artifacts (shows warnings). Use--forceto overwrite them. - Custom artifacts you added (not from a preset template) are always preserved — they are not part of any preset’s artifact list, so
--forcedoes not affect them. - Flags already marked
locked: truecannot be overridden. - Use
--on-conflict keep-incominginstead of--forcewhen you want to overwrite only the generated agent files but not the.codi/artifacts.
3. Non-Interactive Setup for CI
Situation: You want to automate Codi setup in a CI pipeline or a bootstrap script with no user input.
codi init --preset codi-balanced --agents claude-code cursor
What happens:
- Skips the wizard entirely
- Creates
.codi/with thecodi-balancedpreset - Generates configs for Claude Code and Cursor only
- Exits with code
0on success, non-zero on error
Options:
| Flag | Purpose |
|---|---|
--preset <name> | Required — which preset to use |
--agents <agents...> | Required — which agents to generate for |
--json | Machine-readable output |
--quiet | Suppress progress and info log messages |
--force | Reinitialize even if .codi/ exists |
Gotchas:
- Both
--presetand--agentsare required to bypass the wizard fully. - Pre-commit hooks still install if the preset enables them.
4. Generate Agent Configs
Situation: You changed something in .codi/ and want to regenerate your agent config files.
codi generate
What happens:
- Reads
.codi/as the single source of truth (flags, rules, skills, agents, MCP servers) - Passes the result through adapters for each detected agent
- Backs up existing generated files to
.codi/backups/{timestamp}/ - Writes new
CLAUDE.md,.cursorrules,AGENTS.md, etc. - Updates
state.jsonwith new hashes - Re-installs pre-commit hooks
Options:
| Flag | Purpose |
|---|---|
--agent <agents...> | Generate for specific agents only |
--dry-run | Preview changes without writing |
--force | Regenerate even if files are unchanged |
Gotchas:
- Generated files are owned by Codi. Manual edits show as “drifted” on
codi status. - Each agent only gets the artifact types it supports. Skills, for example, do not generate into Cursor’s config.
5. Watch for Changes and Auto-Regenerate
Situation: You are actively editing .codi/ rules or skills and want agent configs to update automatically.
codi watch
What happens:
- Watches the
.codi/directory for file changes - Debounces 500ms and runs
codi generateon each change - Continues until you press
Ctrl+C
Options:
| Flag | Purpose |
|---|---|
--once | Run one generation pass and exit (useful in scripts) |
Requirement:
The auto_generate_on_change flag must be enabled in flags.yaml. If it is not, the command warns and exits.
Gotchas:
- Does not watch generated files — only
.codi/— to prevent infinite loops. - Changes to
state.jsonandoperations.jsonare ignored.
6. Add a Rule
Situation: You want to enforce a new coding standard, security policy, or workflow guideline across all AI agents.
# From a built-in template:
codi add rule my-api-security --template codi-security
# Blank rule:
codi add rule my-custom-rule
# Add all available rule templates at once:
codi add rule --all
What happens:
- Loads the selected template (or creates a blank frontmatter file)
- Injects the rule name into the template
- Writes
.codi/rules/<name>.md - Runs
codi generateautomatically
Gotchas:
- The rule file name must match the
namefield in the frontmatter. - If a rule with that name already exists, the command exits with an error. Delete the file first or use a different name.
- Rules managed by Codi have
managed_by: codiin frontmatter. Do not remove this field — it controls update behavior.
7. Add a Skill
Situation: You want to add a reusable capability (a workflow guide, a process document, or an API integration pattern) that AI agents can invoke by name.
# From a template:
codi add skill my-deploy-guide --template codi-content-factory
# Blank skill:
codi add skill my-skill
# Add all skill templates:
codi add skill --all
What happens:
- Creates
.codi/skills/<name>/directory - Copies
SKILL.mdand any bundled resource files into it - Injects the skill name into
SKILL.mdfrontmatter - Runs
codi generateautomatically
Gotchas:
- Skills are directories, not single files. The
SKILL.mdfile must exist at the root of the directory. - Resource files (JSON, YAML, markdown references) are copied as-is.
- Skills only generate into agents that support them (currently: Claude Code, Cursor, Codex, Windsurf, Cline, GitHub Copilot).
8. Add an Agent
Situation: You want to add a custom AI sub-agent definition that your main agent can invoke for specialized tasks.
# From a template:
codi add agent my-reviewer --template codi-code-reviewer
# Blank:
codi add agent my-agent
# Add all agent templates:
codi add agent --all
What happens:
- Loads the selected template or creates a blank definition
- Writes
.codi/agents/<name>.md - Runs
codi generateautomatically
Gotchas:
- Not all AI platforms support sub-agent delegation. Custom agents generate primarily for Claude Code and Codex.
9. Add an MCP Server
Situation: You want to connect an external tool (GitHub, Neon DB, Stripe, etc.) to your AI agent via the Model Context Protocol.
# From a template:
codi add mcp-server github --template github
# Blank:
codi add mcp-server my-internal-api
# Add all MCP templates:
codi add mcp-server --all
What happens:
- Loads the MCP server template (YAML structure with name, command, args, env, URL, headers)
- Writes
.codi/mcp-servers/<name>.yamlwithmanaged_by: codi - Runs
codi generateto wire the MCP server into.mcp.json,.cursor/mcp.json, etc.
Gotchas:
- MCP servers are YAML files, not Markdown.
- Only Claude Code, Cursor, Codex, and GitHub Copilot fully support MCP.
- The
managed_by: codifield is howcodi update --mcp-serversknows which servers to refresh. Do not remove it.
10. Add a Brand
Situation: You want to define a brand identity (colors, fonts, logo, voice) that content-generation skills can reference.
codi add brand my-company
What happens:
- Creates
.codi/skills/<name>/using thebrand-creatorskill template - Injects the brand name into
SKILL.mdfrontmatter and description - Brand tokens (colors, fonts, voice guidelines) are defined inside the skill directory
Gotchas:
- Brand output depends on the skill that reads the brand tokens.
- Brands are skills, not YAML config files. They do not generate into agent config files directly.
11. Check Drift Status
Situation: You want to know if any generated agent config files have been edited manually or are out of sync with .codi/.
codi status
# Show content diffs for drifted files:
codi status --diff
What you see:
- A table: agent | file | status (synced / drifted / missing)
- With
--diff: the actual content difference between what is on disk and what Codi would generate
Gotchas:
- Drift detection can be configured in
flags.yaml(drift_detectionflag). --diffonly shows diffs for preset-sourced artifacts. Custom rules may not have a reference source.
12. Update Artifacts to Latest Templates
Situation: A new version of Codi ships with improved rule, skill, or agent templates. You want to pull those improvements into your project.
# Update everything:
codi update --rules --skills --agents --mcp-servers
# Preview first:
codi update --rules --skills --agents --mcp-servers --dry-run
# Accept all changes without prompting:
codi update --rules --skills --agents --mcp-servers --force
What happens:
- For each artifact in
.codi/rules/,.codi/skills/,.codi/agents/,.codi/mcp-servers/:- Checks if it is
managed_by: codi - Compares current content to the latest template
- If different: shows a conflict resolution prompt (keep / accept / merge)
- Checks if it is
- Writes accepted changes
- Runs
codi generateautomatically - Updates
artifact-manifest.jsonandpreset-lock.json - Writes an audit log entry
What is skipped:
- Artifacts with
managed_by: <anything else>— those are yours; Codi does not touch them. - Artifacts that are already identical to the latest template.
Gotchas:
- There is no
--allshorthand yet. You must pass all four flags manually. --forceaccepts all incoming changes without prompting. Use it carefully if you have customized any managed artifacts.
13. Reset Flags to a Preset
Situation: A new Codi release updated the recommended flag defaults for a preset, or you want to switch strictness level.
codi update --preset codi-strict
What happens:
- Rewrites
flags.yamlentirely with the preset’s flag values - For user-installed (non-builtin) presets: also re-applies that preset’s artifacts with conflict resolution
- Runs
codi generateautomatically
Gotchas:
- This overwrites your current flag customizations.
- Flags already marked
locked: truein the preset cannot be overridden by later operations.
14. Pull Centralized Artifacts from a GitHub Repo
Situation: Your team maintains a shared GitHub repo with centralized rules and skills. You want to pull the latest versions into your project.
codi update --from owner/shared-codi-config
What happens:
- Clones the GitHub repo (shallow, depth 1) to a temp directory
- Reads
.codi/rules/,.codi/skills/,.codi/agents/from the cloned repo - For each file with
managed_by: codi: compares to your local version, runs conflict resolution - Writes accepted changes
- Runs
codi generate - Removes the temp clone
Gotchas:
- Requires
gitinstalled and network access. - Only files with
managed_by: codiin their frontmatter are pulled. - Your custom artifacts are never touched.
15. Upgrade the Codi CLI and Refresh Everything
Situation: A new version of codi-cli was published. You want to update both the tool and all your managed artifacts.
# Step 1: update the CLI
npm install -g codi-cli@latest
# Step 2: update all managed artifacts to new templates
codi update --rules --skills --agents --mcp-servers
# Step 3: verify everything is healthy
codi doctor
Why two steps:
Installing the new CLI does not automatically update the artifacts in your project’s .codi/ directory. codi update reads the new template versions that shipped with the CLI and syncs your local copies.
Gotchas:
- No “new version available” banner appears when running Codi commands. Check npm manually or use Dependabot / Renovate.
- Major version releases may introduce breaking changes that require
codi init --forcerather than justcodi update.
16. Create a Custom Preset
Situation: You have refined your project’s .codi/ config and want to snapshot it as a reusable preset you can apply to other projects.
codi preset create my-team-preset
What happens:
- Scans
.codi/rules/,.codi/skills/,.codi/agents/ - Copies all artifacts to
.codi/presets/my-team-preset/ - Copies
flags.yamlinto the preset directory - Generates
preset.yamlmanifest
What you get:
.codi/presets/my-team-preset/— a self-contained directory you can export or share
Next step:
Export the preset as a ZIP to share: codi preset export my-team-preset
17. Install a Preset from GitHub or ZIP
Situation: A colleague shared a preset ZIP, or you found a preset on GitHub. You want to install it in your project.
# From a GitHub repo:
codi preset install https://github.com/owner/presets
# From a ZIP file:
codi preset install /path/to/my-team-preset.zip
# From a registry name:
codi preset install awesome-preset
What happens:
- Downloads or extracts the preset to a temp directory
- Validates
preset.yamlstructure - Runs a security scan — warns about suspicious patterns
- Copies to
.codi/presets/<name>/ - Updates
preset-lock.jsonwith source and version - Logs the operation
Gotchas:
- Security scan warnings require your confirmation before installation proceeds.
- Installing a preset does not apply it. To apply the artifacts and flags, run:
codi update --preset <name> - Source is recorded in the lock file so
codi preset updatecan check for new versions.
18. Search the Preset Registry
Situation: You want to discover community presets by keyword.
codi preset search "nextjs typescript"
What you see:
- Matched preset names, versions, descriptions, and tags from the registry
19. Update Installed Presets
Situation: The presets you installed from the registry have new versions. You want to pull the updates.
codi preset update
# Preview without applying:
codi preset update --dry-run
What happens:
- Reads
preset-lock.jsonfor all installed presets and their sources - Queries the registry for the latest version of each
- For presets with new versions: runs a security scan, applies artifact changes with conflict resolution, updates the lock file
20. Export a Preset as ZIP
Situation: You want to share a preset with someone who does not use the registry.
codi preset export my-team-preset
# Save to a specific directory:
codi preset export my-team-preset --output /path/to/share/
What you get:
my-team-preset.zipcontaining the full preset directory — importable withcodi preset install
21. Remove a Preset
Situation: You no longer use a preset and want to remove it from the project.
codi preset remove my-old-preset
What happens:
- Deletes
.codi/presets/my-old-preset/ - Removes the entry from
preset-lock.json - Logs the operation
Note: Removing a preset does not remove the artifacts that were applied from it. Those live in .codi/rules/, .codi/skills/, etc.
22. Validate a Preset
Situation: You built a preset and want to check it is valid before sharing.
codi preset validate my-team-preset
What is checked:
preset.yamlexists and parses- Required field
nameis present (versionandartifactsare optional) - All
.mdfiles found in artifact directories (rules/,skills/,agents/,brands/) have valid frontmatter
23. Check Project Health
Situation: Something seems wrong — configs look off, hooks are not running, or you want a general health check before a release.
codi doctor
# For CI: fail the pipeline on any issue
codi doctor --ci
What is checked:
| Check | What it looks for |
|---|---|
| Version match | CLI version vs. project pin in manifest |
| Generated files | Exist, are readable, match source hashes |
| Drift status | Any generated file changed outside of Codi |
| File size | Warn if any artifact exceeds 6,000 chars or total exceeds 12,000 chars |
| Documentation sync | Doc stamp up to date (if docs enabled) |
| Pre-commit hooks | Hooks installed and executable |
Per-hook tool availability (--hooks mode):
codi doctor --hooks
Switches the command into a focused diagnostic that lists every configured pre-commit hook with its current tool status: ok, warning, or error. Required tools that are missing produce an error row and a non-zero exit code. Missing optional tools produce a warning and exit 0. Each row includes the install-hint command (e.g., brew install gitleaks) so users can copy-paste the fix.
Gotchas:
--ciflag causes a non-zero exit on drift or version failures, which fails the pipeline.- Content size and hook warnings are informational in both modes; they never cause a non-zero exit.
--hooksis its own diagnostic — it does NOT run the standard checks above. Use it specifically when triaging hook tool availability.
24. Validate Configuration
Situation: You edited flags.yaml or a rule file and want to check for schema errors before regenerating.
codi validate
What is checked:
flags.yamlparses and all flag keys match the known schema- Every rule
.mdhas valid frontmatter (name, description, managed_by fields) - Every skill
SKILL.mdhas valid frontmatter - Every agent
.mdhas valid frontmatter - Rule, skill, and agent content does not contain unresolved git merge-conflict markers (
<<<<<<<,=======,>>>>>>>,|||||||for diff3) — emitsE_CONFLICT_MARKERSwith file and line if found
Content size warnings (artifact > 6,000 chars or total > 12,000 chars) are reported but do not affect the exit code.
Exit code: 0 if valid, 1 if any error found.
25. Full Compliance Check
Situation: You want a single command that covers validation, health, drift, and artifact counts before a release.
codi compliance
# For CI:
codi compliance --ci
What you see:
- Config valid: yes/no
- Version match: current vs. expected
- Drift status: whether any generated file has drifted (boolean)
- Artifact counts: rules / skills / agents / flags enabled
- Verification token: a hash of the current config state
26. Verify Agent Loaded the Config
Situation: You want to confirm that your AI agent has actually loaded and is using the config you generated.
# Step 1: get your verification token
codi verify
# Step 2: ask the agent in the chat:
# "Run codi verify and paste the output here"
# Step 3: check the agent's response
codi verify --check "<agent response text>"
What the token is:
A deterministic hash of your active rules, skills, and enabled flags. If the agent reports the same token, its config matches yours exactly.
Gotchas:
- The token changes any time you add, remove, or edit an artifact or flag.
- The agent must report the token, rule names, and active flags for the check to pass. Skills and agents are not checked.
27. Export a Skill for Distribution
Situation: You built a skill that others on your team or community would find useful.
codi skill export my-deploy-guide
# Choose format and output path:
codi skill export my-deploy-guide --format standard --output ./exports/
# Interactive wizard:
codi skill export --interactive
What you get:
- A copy of the skill directory (
--format standard) or a zip archive (--format zip) - Place the exported directory in another project’s
.codi/skills/to use it there
28. Review Skill Feedback
Situation: Claude Code’s skill-observer hook has been collecting observations from your sessions. You want to review them.
codi skill feedback
# Filter by skill:
codi skill feedback --skill codi-commit
# Limit entries shown:
codi skill feedback --limit 10
What you see:
- Feedback entries: timestamp | skill name | category | observation text
- Observations come from
[CODI-OBSERVATION: ...]markers emitted by the agent during sessions
29. View Skill Performance Stats
Situation: You want a summary of which skills are used most and which have the most correction feedback.
# Summary for all skills:
codi skill stats
# Detail for one skill:
codi skill stats codi-debugging
What you see:
- Usage count, feedback count, error rate, and a quality signal per skill
30. Evolve a Skill from Feedback
Situation: A skill has accumulated feedback and you want to generate an LLM prompt to improve it.
# Generate an improvement prompt:
codi skill evolve codi-debugging
# Preview without saving a new version:
codi skill evolve codi-debugging --dry-run
What happens:
- Reads feedback entries for the skill
- Analyzes failure patterns
- Generates an improvement prompt you can paste into Claude
- If not
--dry-run: saves the currentSKILL.mdas a versioned backup inversions/v<N>.SKILL.md
31. Manage Skill Versions
Situation: You updated a skill and want to compare it to an old version, or roll back.
# List all saved versions:
codi skill versions codi-debugging
# Show diff between version 1 and version 2:
codi skill versions codi-debugging --diff "1,2"
# Restore version 1:
codi skill versions codi-debugging --restore 1
What happens on restore:
- Copies the selected version back to
SKILL.md - Does NOT run
codi generateautomatically. Run it manually after verifying the restored content.
32. Contribute Artifacts via PR or ZIP
Situation: You built rules, skills, or a preset that you want to share back to the official Codi repository or a team repository.
# Interactive (prompts for what to contribute and where):
codi contribute
# Target a specific repo:
codi contribute --repo owner/repo --branch develop
What happens:
- Lists all artifacts in
.codi/and asks which to include - Validates selected artifacts against the schema
- Asks: PR or ZIP?
If PR:
- Checks GitHub CLI (
gh) authentication - Clones target repo and creates a branch
- Packages artifacts into a preset structure
- Creates a PR from your fork to the target repo
If ZIP:
- Bundles selected artifacts into a portable ZIP
- Saves to your project root
Gotchas:
- PR workflow requires
ghCLI installed and authenticated (gh auth login). - The ZIP format is a valid preset — it can be installed with
codi preset install.
33. Clean Generated Files
Situation: You want to remove all generated agent config files, or fully uninstall Codi from a project.
# Remove generated files only (.codi/ stays):
codi clean
# Full uninstall (.codi/ removed):
codi clean --all
# Preview what would be deleted:
codi clean --dry-run
What is removed by codi clean:
CLAUDE.md,.cursorrules,AGENTS.md,.windsurfrules,.clinerules,.github/copilot-instructions.md- Agent subdirectories:
.claude/,.cursor/,.codex/,.windsurf/,.cline/,.github/prompts/,.github/skills/,.github/agents/,.github/instructions/ - Per-adapter hook/settings files (
.claude/settings.json,.cursor/hooks.json,.codex/hooks.json,.github/hooks/codi-hooks.json) - Empty parent directories
What is additionally removed by codi clean --all:
.codi/directory (source config, artifacts, backups, audit logs)- Pre-commit hook files
Gotchas:
codi clean(without--all) keeps.codi/, so you can runcodi generateagain at any time.codi clean --allis a full uninstall and cannot be undone without a backup.
34. Revert to a Previous Backup
Situation: You ran codi generate and the output is wrong. You want to restore the previous state.
# List available backups:
codi revert --list
# Restore the most recent backup:
codi revert --last
# Restore a specific backup (use timestamp from --list output):
codi revert --backup 2026-04-12T18-30-00-000Z
What happens:
- Copies agent config files from
.codi/backups/{timestamp}/back to the project root - Runs
codi generateafter restore to ensure consistency
Note: Codi creates a backup before every codi generate run. Backups are timestamped ISO strings.
35. Adopt Codi in an Existing Project (Migration)
Situation: You have a project with an existing CLAUDE.md or .cursorrules. You want to bring it under Codi management without losing your current config.
Recommended steps:
# 1. Back up existing configs
cp CLAUDE.md CLAUDE.md.backup
# 2. Initialize Codi
codi init
# 3. Review conflicts — keep your existing content where it matters
# (the conflict resolver prompts file by file)
# 4. Move any custom rules you had in CLAUDE.md into .codi/rules/
codi add rule my-existing-rule
# 5. Paste or retype the content into .codi/rules/my-existing-rule.md
# 6. Regenerate
codi generate
# 7. Check the result
codi status
What Codi handles automatically:
- Detects old template name mappings (e.g.,
code-quality→codi-code-style) duringcodi update - Preserves any artifact with
managed_by: <anything other than codi>— those are yours
Gotchas:
- Codi will overwrite
CLAUDE.mdduringcodi generate. Put your custom rules in.codi/rules/before the first generate, or use the conflict resolver duringcodi init.
36. Debug Configuration Issues
Situation: Something is not working right — rules are not being applied, hooks are failing, or configs look unexpected.
Start here:
# 1. Check schema errors
codi validate
# 2. Check file health and drift
codi doctor
# 3. See what changed
codi status --diff
# 4. Full audit
codi compliance
Add verbose output to any command:
codi generate --verbose
codi init -v
Verbose mode prints detailed error traces, config resolution steps, and adapter decisions.
Common issues:
| Symptom | First check |
|---|---|
| Agent not picking up rules | codi status — check for drift |
| Hooks not running | codi doctor — checks hook installation |
| Config looks wrong | codi validate — schema errors in flags.yaml |
| Unknown flag in flags.yaml | codi update — adds missing flags from new releases |
| Generated file is too large | codi validate — warns on artifacts > 6,000 chars or total > 12,000 chars |
37. Run Codi in a CI Pipeline
Situation: You want CI to fail if generated configs drift from .codi/ source, or if configuration is invalid.
# In your CI YAML (GitHub Actions example):
- name: Install Codi
run: npm install -g codi-cli@latest
- name: Check drift and health
run: codi doctor --ci
# Or for a full compliance gate:
- name: Compliance check
run: codi compliance --ci
Both --ci flags:
- Exit with non-zero if any check fails or any drift is detected
- Print machine-parseable output compatible with CI log formatters
As a dev dependency (no global install):
npm install -D codi-cli
npx codi doctor --ci
38. Launch the Interactive Command Center
Situation: You want a menu-driven interface to all Codi commands without remembering subcommand names.
codi
What opens:
A TUI with two levels. The normal menu shows the most common actions: Initialize project, Generate configs, Export & share, Clean generated files. Select “Advanced options…” to reveal: Add artifact, Manage presets, Update templates, Health check, Project status, Validate config, Verify agent awareness, Compliance report, Revert to backup. Select any option and it runs with interactive prompts.
39. Set Up an AI Agent to Initialize Codi
Situation: You are using Claude Code or another AI coding agent and want it to handle the Codi setup for you.
In the chat:
Run codi onboard in the terminal and follow the instructions.
What codi onboard outputs:
A structured plain-text guide (formatted for AI consumption) that tells the agent:
- How to run
codi init - How to pick a preset based on the project’s tech stack
- How to add specific artifact types
- How to run
codi generateand commit the result
The agent reads the guide and runs the setup steps on your behalf.
Quick Reference
| I want to… | Command |
|---|---|
| Set up Codi for the first time | codi init |
| Regenerate agent configs | codi generate |
| Add a rule / skill / agent / MCP server | codi add <type> <name> |
| See if anything has drifted | codi status |
| Update artifacts to latest templates | codi update --rules --skills --agents --mcp-servers |
| Switch preset | codi update --preset <name> |
| Install a preset from GitHub | codi preset install <url> |
| Share my config as a preset | codi preset create <name> then codi preset export <name> |
| Check project health | codi doctor |
| Full compliance gate (for CI) | codi compliance --ci |
| Verify agent loaded my config | codi verify |
| Remove Codi entirely | codi clean --all |
| Undo last generate | codi revert --last |
| Watch for changes and auto-regenerate | codi watch |
| Get help from an AI agent | codi onboard |