CLI Commands
Flux-CLI uses the Click framework for its command-line interface.
Entry Point
The main entry point is main.py:
python main.py [OPTIONS] [PROMPT]Or via the installed package:
flux [OPTIONS] [PROMPT]Arguments
PROMPT (optional)
A single prompt to execute. If provided, Flux-CLI runs in single-command mode and exits after completion.
python main.py "List all Python files in the project"Options
--cwd, -c
Set the current working directory for the agent session.
python main.py --cwd /path/to/projectThis must be an existing directory. If not specified, the current working directory is used.
Special Commands
flux config
Run the configuration wizard:
python main.py configThis launches an interactive setup wizard that guides you through:
- Entering your API key
- Setting the base URL
- Choosing a default model
Interactive Mode
When no prompt argument is provided, Flux-CLI launches in interactive mode:
python main.pyIn interactive mode, you type prompts at the ❯ prompt. The agent processes your request and responds with streamed text and tool calls.
Slash Commands in Interactive Mode
Flux-CLI supports slash commands for managing your session:
| Command | Description |
|---|---|
/help | Show the interactive help dashboard |
/exit or /quit | Exit the CLI session |
/clear | Clear conversation history |
/config | Show current active configuration |
/model <name> | Switch LLM model at runtime |
/approval <mode> | Change safety approval policy |
/stats | View session token usage & turn metrics |
/tools | List all available tools |
/mcp | View MCP server connection status |
/save | Save current session state |
/sessions | List all saved sessions |
/resume <id> | Resume a previously saved session |
/checkpoint | Create a named checkpoint |
/restore <id> | Restore session from a checkpoint |
Exit Codes
| Code | Meaning |
|---|---|
0 | Success (or single prompt completed) |
1 | Error (configuration error, missing API key, etc.) |
Error Handling
When an error occurs:
- The error message is displayed in the terminal
- The
on_errorhook is triggered (if configured) - The CLI exits with code 1
Common Use Cases
python main.py— Start interactive sessionpython main.py "refactor this file"— Run a single promptpython main.py config— Run configuration wizardpython main.py -c /path/to/proj "analyze this codebase"— Run in a specific directory