Documentation menu

Flag reference

Every flag locac accepts, grouped by what it configures. Flags are parsed globally, and a flag a command does not read is simply ignored, so the heading each one sits under is what tells you where it actually has an effect.

Model selection

Defaults come from ~/.locac/config.json; these flags override it. See Configuration for how the layers resolve.

FlagValueMeaning
--provider <name>stringA built-in provider: anthropic, openai, groq, ollama, …
--custom-provider <name>stringA provider saved in the config's providers[] array
--api <api>anthropic-messages | openai-completions | openai-responses | ollama-chatThe wire protocol, for a generic endpoint
--base-url <url>stringEndpoint base URL
--model <id>stringModel id. Required; otherwise auto-picked from the nearest configured project
--api-key <key>stringAPI key. Otherwise read from the provider's environment variable
--auth-scheme <scheme>x-api-key | bearerAuth header style. anthropic-messages only
--effort <level>low | medium | highReasoning budget, for openai-completions and openai-responses
--config <path>pathConfig file to read. Default ~/.locac/config.json, or under $LOCAC_HOME

--provider and --custom-provider are mutually exclusive in effect: naming one clears the other, and the API key is re-picked for whichever source ends up in force.

An --effort level a model cannot carry is not silently dropped. locac prints why:

locac: reasoning effort "high" ignored — <reason>.

Run

FlagValueMeaning
--cwd <dir>pathTarget repository root. Default: the current directory
--shell-path <path>pathA bash-compatible shell for execute and the sandbox. Also $LOCAC_SHELL
--db <path>pathSession database. Default: per-project, under ~/.locac/projects
--system <text>stringReplace the system prompt
--style <name>directProse style for the model's own text. Off by default
--tools <list>comma-separatedAllow-list of tool names
--exclude-tools <list>comma-separatedDeny-list, applied after --tools
--goal <objective>stringAutopilot: keep working toward this objective
--planbooleanPlan phase: explore read-only, then present_plan
--context-window <n>integer > 0Override the model's context window, for custom endpoints

--tools and --exclude-tools apply to subagents as well as the main loop, and submit_report is never removable. The Tool reference lists every valid name.

Renderers

FlagMeaning
--tuiInteractive terminal UI. The default on a real terminal
--fullscreenAlt-screen renderer: pinned header and input, windowed transcript. The default
--inlineInline <Static> scrollback renderer. Survives exit, native mouse scroll
--print, -pPlain streaming output, no TUI. The default when piped or non-TTY

Approval and sandbox

FlagMeaning
--yes, -yAuto-approve dangerous tools (bash, execute). On skills add/update, accepts the text about to enter the system prompt
--allow-allAn alias of --yes
--allOn skills add, every skill in the repo; on skills update, every skill with a recorded source
--autoGuardian: auto-approve read-only shell commands, fail-closed on the rest
--require-sandboxRefuse to start unless the OS sandbox is available

With none of these, dangerous tools raise an interactive prompt in the TUI on a real terminal, and are blocked everywhere else.

Caps

FlagValueDefault
--max-iterations <n>integer > 0Unset, meaning unlimited
--max-tool-calls <n>integer > 0Unset
--max-tokens <n>integer > 0Unset on the CLI; the scaffolded config sets 500000
--max-wall-clock-ms <n>integer > 0Unset

Hitting a cap ends the run with exit code 2.

Compaction

FlagValueDefault
--reserve-tokens <n>integer > 020% of the context window
--keep-recent <n>integer > 08
--evidence-budget-tokens <n>integer > 0Half the reserve
--compaction-mode <mode>elide | summarizeelide (LLM-free); summarize is reserved
--no-compactionbooleanOff. Compaction is enabled by default

Sessions

FlagMeaning
--continue, -cContinue the most recently used session

-c is a boolean flag, so locac -c "<prompt>" puts the prompt where a subcommand would normally be. locac reroutes that to run when the first positional is not a known command, which is why both locac -c "…" and locac run -c "…" work.

Dashboard

Read by locac web.

FlagValueDefault
--port <n>integer 1–655354173, or web.port from the config
--host <ip>string127.0.0.1, or web.host from the config
--enable-runsbooleanOff. The run-launch routes are opt-in
--db <path>pathThe per-project session database
--cwd <dir>pathWhich project's database to open

Evaluation

Read by locac eval.

FlagValueDefault
--baseline <file>pathRequired for eval ab
--candidate <file>pathRequired for eval ab
--fixtures <dir>path<cwd>/eval/fixtures/mixed
--trials <n>integer8
--seed <n>integer12345

Help

FlagMeaning
--help, -hPrint usage and exit
--version, -vPrint locac <version> on one line and exit 0

--version is answered before every other check except --help, so it still prints when the rest of the command line is wrong (locac run --version --max-tokens nope) and never starts a run. --help wins if both are given.

locac with no arguments prints usage and exits 1 when there is no terminal to open a TUI on; on a real terminal it starts an interactive run instead.

Argument validation

locac refuses to start on a malformed argument rather than running with a silently wrong value. Every one of these prints error: … followed by the usage text and exits 1:

InputResult
An unknown or malformed flagerror: <parser message>
A numeric flag that is not a positive integererror: invalid --keep-recent "abc" (want a positive integer)
--effort outside low/medium/higherror: invalid --effort "turbo" (want low | medium | high)
--style naming an unknown styleerror: unknown --style "terse" (want: direct)
A tool name that does not existerror: unknown tool "raed" in --tools (known: …)
--port outside 1–65535error: invalid --port "http" (want an integer 1–65535)

Numeric flags are parsed with Number, not parseInt, so 8k and 80.5 are errors rather than silent truncations to 8 and 80. Values are reported one message per bad flag, in a fixed order, so a run with several typos always prints the same set.

Exit codes

CodeStop reasonMeaning
0doneThe run finished on its own terms
1errorA failure, or a usage/validation error before the run started
2budgetA cap stopped the run. Raise it and resume
130abortedInterrupted with Ctrl+C (or Esc in the TUI)

The distinction between 0 and 2 is the one that matters in CI: a run capped part-way through stops on whatever it had reached, which would otherwise be indistinguishable from a clean pass that found nothing. 130 follows the shell's own SIGINT convention.

locac run "" -p --max-tokens 2000000
case $? in
  0) echo "clean" ;;
  2) echo "hit a cap, resume with a bigger budget" ;;
  *) echo "failed" ;;
esac