CLI reference
The Midcore CLI runs the Outcome Compiler, agent modes, and gates from the terminal. This page summarizes the main commands, common flags, exit codes, and examples.
Main commands
| Command | Description |
|---|---|
| midcore init | Initialize .maestro/ and optional intent in the current directory |
| midcore agent "<task>" | Run the agent with a one-off task (multi-file edits, impact analysis) |
| midcore plan "<goal>" | Open plan mode for design, migration, or architecture (no edits) |
| midcore debug "<description>" | Run debug mode: multi-hypothesis tracing and targeted fixes |
| midcore ask "<question>" | Ask mode: exploration and answers only, no code changes |
| midcore gates run | Run all gates defined in .maestro/gates.yaml |
| midcore gates run --gate <id> | Run a single gate by ID |
| midcore --version | Print CLI version |
| midcore --help | Print global help |
Flags and options
| Flag / option | Description |
|---|---|
| --help | Print help for the command (global or per-command). |
| --version | Print CLI version and exit. |
| (env overrides) | Many options can be overridden via environment variables; see Environment variables. |
Use midcore --help and midcore <command> --help for the full list. Environment variables are in Environment variables.
Exit codes
0 — Success. Non-zero — Failure (e.g. gate failure, error). For install or runtime issues, see Troubleshooting.
Examples
bash
midcore init
midcore agent "add rate limiting to /api/users"
midcore plan "migrate auth to OIDC"
midcore gates runPipeline
bash
midcore agent "refactor login module" | tee log.txtCI one-liner
bash
midcore gates runIn CI, run gates after your build; exit code non-zero if any gate fails.
Tip
Use
midcore --help and midcore <command> --help for flags and options. Environment variables are documented in the Environment variables reference.