History navigation
- Ctrl+U / Ctrl+D
- Scroll history up / down half a page.
- PageUp / PageDown
- Scroll history a full page.
- ↑ / ↓
- Single-line scroll when not editing the prompt.
The lash binary is shipped by the lash-cli crate. It runs an interactive terminal UI by default, an autonomous single-shot mode under --print, and a handful of administrative flows like --export and --reset. This page enumerates the user-visible surface: flags, slash commands, key bindings, the setup wizard, the config file, and the environment variables it reads.
If ~/.lash/config.json does not exist, lash launches the setup wizard. The wizard provisions an active provider, collects credentials, and writes the config file before dropping you into the TUI.
$ lash
# Setup wizard:
# 1. Choose a provider (Anthropic, OpenAI, OpenAI-compatible, Codex, Google OAuth)
# 2. Paste API key (or run OAuth / device-code flow)
# 3. Optionally paste a Tavily API key for the built-in web-search tool
# 4. Drop into the interactive TUI
Re-run the wizard at any time with lash --provider. Use /provider from inside a session to switch providers without restarting.
Type a / at the start of the prompt to invoke a command. Tab-completion is available. Skill names registered in ~/.lash/skills/ or .agents/lash/skills/ appear as additional /<skill> commands.
| Command | Aliases | Usage | Description |
|---|---|---|---|
/clear | /new | /clear | Reset conversation |
/compact | — | /compact [focus instructions] | Summarize older messages to free up context |
/controls | — | /controls | Show keyboard shortcuts |
/fork | — | /fork | Open a forked session in a new terminal |
/tree | — | /tree | Browse and switch branches in the current session |
/version | — | /version | Show lash-cli and lash-sansio versions |
/info | — | /info | Show current session/runtime info |
/model | — | /model [name] | Show or switch the LLM model |
/variant | — | /variant [name] | Show or switch the model variant (e.g. high, max) |
/mode | — | /mode [name] | Show or switch execution mode (standard / rlm) |
/provider | /login | /provider | Switch, add, or re-authenticate providers |
/logout | — | /logout | Remove stored credentials for active provider |
/retry | — | /retry | Replay the previous turn payload |
/resume | /continue | /resume [name] | Browse or load a previous session (interactive picker if no arg) |
/skills | — | /skills | Browse loaded skills |
/tools | — | /tools ... | Inspect or edit the tool registry |
/reconfigure | — | /reconfigure ... | Apply or inspect pending runtime reconfigure |
/help | /? | /help | Show commands and shortcuts |
/exit | /quit | /exit | Quit |
The TUI uses a small, consistent set of shortcuts. The full list is also available in-session via /controls.
LASH_COPY_BINDING if the default conflicts with your terminal.lash when no selection is active.Run lash --help for the full list. The most common flags, grouped by purpose:
--provider--model <name>--variant <name>high, max, xhigh).--api-key <key>--base-url <url>--tavily-api-key <key> (env TAVILY_API_KEY)-em, --execution-mode <mode>standard (default) or rlm.-c, --context-approach <approach>rolling_history or observational_memory.--rlm-var name=<json>--rlm-vars-file <path>--resume <id_or_name>.db filename.--resume-prompt <prompt>-p, --print <prompt>--await-background-work--turn-usage-json <path>--debug--trace-level <standard|extended>standard.--debug-ui-trace trace.json--reset~/.lash/ and ~/.cache/lash/ and exit.--info--check-update / --update--export <db>--export-format html|json, --export-trace <jsonl>, and --export-out <path>.lash --print "<prompt>" runs Lash autonomously: it boots, executes the prompt, prints the assistant's prose to stdout, and exits. There is no TUI; status and tool output go to stderr. An autonomous system prompt is injected so the assistant completes the task without asking for input.
$ lash --print "Summarise this branch's changes in two bullets."
# Assistant prose to stdout, tool/lifecycle logs to stderr.
$ lash --print "Investigate the latest test failure." \
--await-background-work \
--turn-usage-json out/usage.json
Configuration lives at ~/.lash/config.json (overridable via the LASH_HOME environment variable). The schema is owned by LashConfig in lash-cli/src/config.rs and uses serde(deny_unknown_fields) — unknown top-level fields are rejected to catch typos.
{
"active_provider": "openai",
"providers": {
"openai": { "kind": "openai", "api_key": "sk-..." },
"anthropic": {
"kind": "anthropic",
"api_key": "sk-ant-...",
"options": {
"cache_retention": "long",
"max_output_tokens": 16384
}
}
},
"auxiliary_secrets": {
"tavily_api_key": "tvly-..."
},
"mcp_servers": {
"docs": {
"transport": "stdio",
"command": "uvx",
"args": ["mcp-server-docs"]
}
},
"agent_models": {},
"model_defaults": {
"openai": { "model": "openai/gpt-5.5", "variant": "medium" }
}
}
| Field | Type | Purpose |
|---|---|---|
active_provider | string | Key of the currently active provider; must exist in providers. |
providers | map | Per-provider credentials and metadata, keyed by provider kind. Shared provider tuning lives under options, including cache_retention (none | short | long) and max_output_tokens. |
auxiliary_secrets | object | Secrets for non-LLM services. Currently tavily_api_key. |
mcp_servers | map | MCP server configs by name. Discriminated by transport: stdio, streamable_http, or sse. |
agent_models | map | User-overridable model names per subagent capability. |
model_defaults | map | Fresh-session model + variant default per provider kind. Session resumes ignore this and use the persisted head. |
The CLI reads a small set of environment variables — most are overrides for paths or behavior the config file doesn't cover.
| Variable | Purpose |
|---|---|
LASH_HOME | Override the root data directory (defaults to ~/.lash/). |
TAVILY_API_KEY | Tavily API key for the bundled web search tool. Alternative to --tavily-api-key and the config file. |
LASH_COPY_BINDING | Override the copy keystroke (ctrl-c, ctrl-shift-c, or ctrl-y). |
LASH_LOG | tracing-subscriber log filter (e.g. debug, warn, lash=trace). |
LASH_NO_OSC52 | Disable OSC 52 clipboard escape sequences. |
LASH_INSTALL_DIR | Override the install dir used by --update. |
LASH_REPO | Override the GitHub repo used by --check-update / --update. |
GOOGLE_CLOUD_PROJECT[_ID] | Google Cloud project ID for the Gemini / Code Assist provider. |
Every session has a UUID and a generated human-readable name. --resume <id_or_name> accepts either, plus the legacy .db filename for old sessions. Without an argument, /resume opens an interactive picker showing the 50 most recent sessions sorted by recency.
/fork branches the current session at the current message and opens the fork in a new terminal window. Lash resolves the launcher using the running binary's $PATH entry and falls back to the executable directory if needed. The launched fork runs lash --resume <new-session-id> in the new terminal.