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

  1. First-Time Setup
  2. Re-initialize with a Different Preset
  3. Non-Interactive Setup for CI
  4. Generate Agent Configs
  5. Watch for Changes and Auto-Regenerate
  6. Add a Rule
  7. Add a Skill
  8. Add an Agent
  9. Add an MCP Server
  10. Add a Brand
  11. Check Drift Status
  12. Update Artifacts to Latest Templates
  13. Reset Flags to a Preset
  14. Pull Centralized Artifacts from a GitHub Repo
  15. Upgrade the Codi CLI and Refresh Everything
  16. Create a Custom Preset
  17. Install a Preset from GitHub or ZIP
  18. Search the Preset Registry
  19. Update Installed Presets
  20. Export a Preset as ZIP
  21. Remove a Preset
  22. Validate a Preset
  23. Check Project Health
  24. Validate Configuration
  25. Full Compliance Check
  26. Verify Agent Loaded the Config
  27. Export a Skill for Distribution
  28. Review Skill Feedback
  29. View Skill Performance Stats
  30. Evolve a Skill from Feedback
  31. Manage Skill Versions
  32. Contribute Artifacts via PR or ZIP
  33. Clean Generated Files
  34. Revert to a Previous Backup
  35. Adopt Codi in an Existing Project (Migration)
  36. Debug Configuration Issues
  37. Run Codi in a CI Pipeline
  38. Launch the Interactive Command Center
  39. 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:

  1. Detects your tech stack (TypeScript, Python, Go, etc.)
  2. Detects which AI agents are installed on your machine (Claude Code, Cursor, etc.)
  3. Asks you to choose a preset or build a custom selection of rules, skills, agents, and MCP servers
  4. Creates .codi/ with all selected artifacts
  5. Writes flags.yaml, state.json, and .artifact-manifest.yaml
  6. Generates CLAUDE.md, .cursorrules, AGENTS.md, .windsurfrules, .clinerules, .github/copilot-instructions.md
  7. 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 $EDITOR or 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 init first if the project is not yet a repo.
  • Use codi init --force to 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.yaml to the codi-strict preset 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 --force to 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 --force does not affect them.
  • Flags already marked locked: true cannot be overridden.
  • Use --on-conflict keep-incoming instead of --force when 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 the codi-balanced preset
  • Generates configs for Claude Code and Cursor only
  • Exits with code 0 on success, non-zero on error

Options:

FlagPurpose
--preset <name>Required — which preset to use
--agents <agents...>Required — which agents to generate for
--jsonMachine-readable output
--quietSuppress progress and info log messages
--forceReinitialize even if .codi/ exists

Gotchas:

  • Both --preset and --agents are 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:

  1. Reads .codi/ as the single source of truth (flags, rules, skills, agents, MCP servers)
  2. Passes the result through adapters for each detected agent
  3. Backs up existing generated files to .codi/backups/{timestamp}/
  4. Writes new CLAUDE.md, .cursorrules, AGENTS.md, etc.
  5. Updates state.json with new hashes
  6. Re-installs pre-commit hooks

Options:

FlagPurpose
--agent <agents...>Generate for specific agents only
--dry-runPreview changes without writing
--forceRegenerate 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 generate on each change
  • Continues until you press Ctrl+C

Options:

FlagPurpose
--onceRun 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.json and operations.json are 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:

  1. Loads the selected template (or creates a blank frontmatter file)
  2. Injects the rule name into the template
  3. Writes .codi/rules/<name>.md
  4. Runs codi generate automatically

Gotchas:

  • The rule file name must match the name field 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: codi in 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:

  1. Creates .codi/skills/<name>/ directory
  2. Copies SKILL.md and any bundled resource files into it
  3. Injects the skill name into SKILL.md frontmatter
  4. Runs codi generate automatically

Gotchas:

  • Skills are directories, not single files. The SKILL.md file 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:

  1. Loads the selected template or creates a blank definition
  2. Writes .codi/agents/<name>.md
  3. Runs codi generate automatically

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:

  1. Loads the MCP server template (YAML structure with name, command, args, env, URL, headers)
  2. Writes .codi/mcp-servers/<name>.yaml with managed_by: codi
  3. Runs codi generate to 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: codi field is how codi update --mcp-servers knows 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 the brand-creator skill template
  • Injects the brand name into SKILL.md frontmatter 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_detection flag).
  • --diff only 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:

  1. 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)
  2. Writes accepted changes
  3. Runs codi generate automatically
  4. Updates artifact-manifest.json and preset-lock.json
  5. 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 --all shorthand yet. You must pass all four flags manually.
  • --force accepts 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.yaml entirely with the preset’s flag values
  • For user-installed (non-builtin) presets: also re-applies that preset’s artifacts with conflict resolution
  • Runs codi generate automatically

Gotchas:

  • This overwrites your current flag customizations.
  • Flags already marked locked: true in 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:

  1. Clones the GitHub repo (shallow, depth 1) to a temp directory
  2. Reads .codi/rules/, .codi/skills/, .codi/agents/ from the cloned repo
  3. For each file with managed_by: codi: compares to your local version, runs conflict resolution
  4. Writes accepted changes
  5. Runs codi generate
  6. Removes the temp clone

Gotchas:

  • Requires git installed and network access.
  • Only files with managed_by: codi in 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 --force rather than just codi 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:

  1. Scans .codi/rules/, .codi/skills/, .codi/agents/
  2. Copies all artifacts to .codi/presets/my-team-preset/
  3. Copies flags.yaml into the preset directory
  4. Generates preset.yaml manifest

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:

  1. Downloads or extracts the preset to a temp directory
  2. Validates preset.yaml structure
  3. Runs a security scan — warns about suspicious patterns
  4. Copies to .codi/presets/<name>/
  5. Updates preset-lock.json with source and version
  6. 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 update can 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:

  1. Reads preset-lock.json for all installed presets and their sources
  2. Queries the registry for the latest version of each
  3. 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.zip containing the full preset directory — importable with codi 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.yaml exists and parses
  • Required field name is present (version and artifacts are optional)
  • All .md files 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:

CheckWhat it looks for
Version matchCLI version vs. project pin in manifest
Generated filesExist, are readable, match source hashes
Drift statusAny generated file changed outside of Codi
File sizeWarn if any artifact exceeds 6,000 chars or total exceeds 12,000 chars
Documentation syncDoc stamp up to date (if docs enabled)
Pre-commit hooksHooks 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:

  • --ci flag 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.
  • --hooks is 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.yaml parses and all flag keys match the known schema
  • Every rule .md has valid frontmatter (name, description, managed_by fields)
  • Every skill SKILL.md has valid frontmatter
  • Every agent .md has valid frontmatter
  • Rule, skill, and agent content does not contain unresolved git merge-conflict markers (<<<<<<<, =======, >>>>>>>, ||||||| for diff3) — emits E_CONFLICT_MARKERS with 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:

  1. Reads feedback entries for the skill
  2. Analyzes failure patterns
  3. Generates an improvement prompt you can paste into Claude
  4. If not --dry-run: saves the current SKILL.md as a versioned backup in versions/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 generate automatically. 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:

  1. Lists all artifacts in .codi/ and asks which to include
  2. Validates selected artifacts against the schema
  3. 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 gh CLI 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 run codi generate again at any time.
  • codi clean --all is 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 generate after 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-qualitycodi-code-style) during codi update
  • Preserves any artifact with managed_by: <anything other than codi> — those are yours

Gotchas:

  • Codi will overwrite CLAUDE.md during codi generate. Put your custom rules in .codi/rules/ before the first generate, or use the conflict resolver during codi 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:

SymptomFirst check
Agent not picking up rulescodi status — check for drift
Hooks not runningcodi doctor — checks hook installation
Config looks wrongcodi validate — schema errors in flags.yaml
Unknown flag in flags.yamlcodi update — adds missing flags from new releases
Generated file is too largecodi 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 generate and 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 timecodi init
Regenerate agent configscodi generate
Add a rule / skill / agent / MCP servercodi add <type> <name>
See if anything has driftedcodi status
Update artifacts to latest templatescodi update --rules --skills --agents --mcp-servers
Switch presetcodi update --preset <name>
Install a preset from GitHubcodi preset install <url>
Share my config as a presetcodi preset create <name> then codi preset export <name>
Check project healthcodi doctor
Full compliance gate (for CI)codi compliance --ci
Verify agent loaded my configcodi verify
Remove Codi entirelycodi clean --all
Undo last generatecodi revert --last
Watch for changes and auto-regeneratecodi watch
Get help from an AI agentcodi onboard