Skip to content
Powered by BridgeApp

CLI reference

The Magic Coder CLI is the coder binary. It’s flag-driven; environment variables are not used for argument values.

coder [OPTIONS]
FlagDefaultMeaning
--cwd <PATH>the current shell directory (.)Primary working directory. Resolves to the nearest Git/worktree root automatically.
-w, --workdir <PATH>noneAdditional directory allowed for file operations. Can be repeated, or comma-delimited.
Terminal window
# Open the TUI in the current repo
coder
# Add another root
coder --cwd ~/code/service -w ~/code/protos
# Multiple extra roots
coder --cwd ~/code/service \
-w ~/code/protos \
-w ~/code/shared
# Comma-delimited
coder --cwd ~/code/service -w ~/code/protos,~/code/shared
FlagDefaultMeaning
--server-url <HOST_OR_URL>bridgeapp.dev (until the prod default flips)BridgeApp deployment base host or https:// URL. WS, OIDC, and API URLs are derived from it. Bare hosts and https:// URLs both work; ws:///wss:// URLs are rejected.
--oidc-client-id <ID>built-in defaultOIDC client ID. Override only if BridgeApp’s admin team told you to.
--no-open-browseroffPrint the OIDC login URL instead of opening a browser.

The default deployment host may not match your environment. Pass --server-url once if your team uses a non-default deployment.

Terminal window
coder --server-url bridgeapp.dev
coder --no-open-browser # for SSH / headless boxes
FlagDefaultMeaning
--trustoffTrust the current workspace. Persists in ~/.magic/known.toml. Required for --automagic if not already trusted.
Terminal window
coder --trust

You can launch with a startup target to skip the empty-input state. At least one of these (--continue and/or --query) is required to use --automagic. They can also be combined: --continue <uuid> --query "..." resumes a thread and immediately sends a follow-up.

FlagMeaning
-c, --continue <UUID>Resume an existing thread.
-q, --query <TEXT>Send a user message immediately after startup.
Terminal window
# Send a startup prompt
coder --query "fix the failing migration"
# Resume a thread
coder --continue 8a3f2b1e-4d6c-4e9f-9b2a-c12345678abc
# Resume and immediately ask a follow-up
coder --continue 8a3f2b1e-... --query "now also update the docs"
FlagDefaultMeaning
-p, --planoffStart the session in plan mode.
-a, --automagicoffAuto-approve everything; exit when the agent finishes. Requires a startup target and a trusted workspace.
--allow-long-contextoffAllow long-context mode in the current session.
Terminal window
coder --plan
coder --plan --automagic --trust --query "migrate the importer"
coder --allow-long-context
FlagDefaultMeaning
--model <MODEL>from user config or BridgeApp defaultPick a model for this session.
--reasoning-effort <EFFORT>from user config or provider defaultOne of none, minimal, low, medium, high, xhigh. (max is also accepted.)
Terminal window
coder --model gpt-5.5
coder --reasoning-effort high
coder --model claude-opus-4.7 --reasoning-effort xhigh
  • 0 — Magic Coder exited cleanly. For automagic runs, the agent finished its task.
  • non-zero — a fatal error occurred, the run was interrupted, or input arguments were invalid.
Terminal window
# Daily driver
coder
# Send a prompt and watch
coder --query "..."
# Plan first, you stay in the loop
coder --plan --query "..."
# Hands-off run
coder --trust --automagic --query "..."
# Resume on a different machine
coder --continue <uuid>
# Push a follow-up to a known thread, hands-off
coder --continue <uuid> --trust --automagic --query "..."

These exist but are not for everyday use:

FlagWhat it’s for
--oauth-credentials-file <PATH>Load a JSON-serialized OAuth credential file from disk instead of using the saved credential store. Useful for CI and other headless setups.

These are not configurable through CLI arguments — change them via slash commands or ~/.magic/config.toml:

  • Theme (/theme or [ui] theme in config.toml)
  • Sleep mode ([generation] sleep_mode in config.toml)
  • Long-context as a default ([generation] allow_long_context in config.toml)
  • Command permissions — managed through the approval prompt (see Command permissions)

Magic Coder also does not read CODER_* environment variables for argument values. The flag interface is the only argument interface.