Run

Command reference

The whole surface area — commands, flags, config keys and limitations — on one page.

Synopsis

smartly <sentence...>

smartly init bash|zsh
smartly config init|show|path

Flags

FlagTypeEffect
--providerstringOverride the configured provider: anthropic, openai, claude-cli, codex-cli.
--modelstringOverride the configured model for the active provider.
--contextstringOverride the configured context level: none, light, full.
--confirmboolForce a confirmation prompt for this call.
-y, --yesboolForce auto-run for this call.
--dry-runboolShow the generated command without asking or running it.
--print-onlyboolInternal. Used by the shell wrapper, not meant for manual use.
--record-exitintInternal. Used by the shell wrapper, not meant for manual use.

--confirm and -y/--yes are mutually exclusive.

Subcommands

smartly init bash|zsh

Prints the shell function to stdout. Source it with eval "$(smartly init zsh)" so a generated cd or export affects your interactive shell. See Shell integration.

smartly config init

Writes a default config.yaml to the resolved config path.

smartly config show

Prints the resolved configuration. API key values are redacted.

smartly config path

Prints the resolved config file path — $XDG_CONFIG_HOME/smartly/config.yaml, or ~/.config/smartly/config.yaml if XDG_CONFIG_HOME is unset.

Configuration keys

KeyValuesDefault
provideranthropic, openai, claude-cli, codex-clianthropic
execution.modeauto, confirmauto
contextnone, light, fulllight
log.pathpath~/.config/smartly/history.log
providers.anthropic.modelstringclaude-opus-5
providers.anthropic.api_key_envstringANTHROPIC_API_KEY
providers.anthropic.api_keystring"" (fallback only)
providers.anthropic.base_urlstring""
providers.openai.modelstring"" — required
providers.openai.api_key_envstringOPENAI_API_KEY
providers.openai.api_keystring"" (fallback only)
providers.openai.base_urlstring""
providers.claude-cli.modelstringhaiku — required
providers.claude-cli.binarystringclaude
providers.claude-cli.max_budget_usdnumber0.50
providers.codex-cli.modelstring"" — optional
providers.codex-cli.binarystringcodex

Full annotated schema: Configuration.

Environment variables

VariableUsed for
ANTHROPIC_API_KEYDefault key source for provider: anthropic.
OPENAI_API_KEYDefault key source for provider: openai.
XDG_CONFIG_HOMEConfig directory root. Falls back to ~/.config.
HISTFILEShell history file read at context: full.

A variable named by api_key_env takes precedence over the provider default. See how keys are resolved.

Limitations

  • Generates a single shell command line per invocation. Pipes, && and redirects within that line are fine; multi-step scripts are not.
  • Targets bash and zsh on Linux and macOS. Windows and PowerShell are not supported yet.
  • The OpenAI provider ships with no default model — you must set providers.openai.model yourself.
  • claude-cli and codex-cli require the respective CLI installed and separately logged in (claude login / codex login) — smartly does not manage that login state — and their error classification is best-effort. See Providers.