CLI Reference

All CLI flags and options.

Usage

aspectcode [options]

Run in your project root. By default, analyzes the current directory and generates AGENTS.md.

Flags

FlagDescription
--onceRun once and exit (no watch mode)
--kbAlso generate the Knowledge Base (.aspect/ directory)
--dry-runPreview without writing files (use with --once)
--provider LLM provider for optimizer (openai or anthropic)
--model Model override
--max-iterations Optimizer iterations (default: 3)
--verboseDebug output
--root Explicit workspace root
--no-colorPlain text output
--helpShow help
--versionShow version

Environment variables

VariableDescription
OPENAI_API_KEYEnables LLM optimization via OpenAI
ANTHROPIC_API_KEYEnables LLM optimization via Anthropic

When an API key is set, the evaluator and optimizer run automatically after static analysis. Without a key, AGENTS.md is generated through static analysis alone.