Docs

contextai generate

Generate all enabled output files from your config.

bash
contextai generate

Options

  • --dry-run — print output to stdout without writing files
  • --format json — output JSON IR to stdout instead of writing files (structure: { version, generatedAt, config, outputs }). Useful for CI, piping, and debugging

Dry run

bash
contextai generate --dry-run

Dry run is useful in CI to verify what would be generated without touching the filesystem.

Custom generators

You can add custom output targets in your config:

typescript
outputs: {
  'CLAUDE.md': true,
  custom: [
    {
      path: 'docs/ai-context.md',
      generator: (config) =>
        `# ${config.project.name}\n${config.project.architecture}`,
    },
  ],
},