Sweet! CLI Commands Reference
Complete list of all commands, options, and usage examples for Sweet! CLI. Master your AI coding assistant workflow.
Basic Command Structure
Sweet! CLI follows a simple command structure:
sweet [options] [command] [arguments]
Most commonly, you'll use the autonomous mode:
sweet "your goal or task description"
For example:
sweet "Fix the failing test in test_api.py"
sweet "Add user authentication with JWT tokens"
sweet "Review main.py and suggest improvements"
Available Commands
| Command | Description | Usage |
|---|---|---|
sweet <goal> |
Autonomous mode: Sweet! CLI works independently to achieve the goal | sweet "debug login issue" |
sweet (no arguments) |
Interactive mode: Start an interactive session for extended, multi-step work | sweet |
sweet login |
Login to billing service (required for using Sweet! CLI) | sweet login |
sweet resume |
Resume the most recent session | sweet resume |
sweet --list-sessions |
List all saved sessions | sweet --list-sessions |
sweet --session <id> |
Resume a specific session by ID | sweet --session 20250101-120000 |
sweet --work-for <duration> |
Enable autopilot mode for specified duration | sweet --work-for 45m |
sweet --help |
Show help information | sweet --help |
Interactive Session Commands
During an interactive session (sweet), you can use the following slash commands:
| Command | Description | Usage |
|---|---|---|
/workfor <duration> |
Enable autopilot mode for a specified duration | /workfor 45m, /workfor 2h, /workfor forever |
/workoff |
Disable autopilot mode | /workoff |
/workstatus |
Check autopilot status and remaining time | /workstatus |
/todos |
Display current todo list | /todos |
/jobs |
List background jobs | /jobs |
/kill <job_id> |
Stop a background job | /kill job_123 |
/clear |
Clear conversation history | /clear |
Global Options
These options can be used with any command:
--help, -h
Display help information for a command.
sweet --help
sweet --help
--model <name>
Override the model name for this run (passed to the selected provider/relay).
sweet --model deepseek-chat "your task"
--no-billing
Use direct provider access instead of the billing relay.
--provider <deepseek|nebius>
Select provider (default: deepseek).
--api-key
DeepSeek API key for --no-billing (or use DEEPSEEK_API_KEY).
--api-base
Billing API base URL override (used by login).
--log / --log-file
Enable JSONL logging (and optionally choose the file path).
--snapshot-compactions
Save pre-compaction windows to training_snapshots/.
--resume-last / --session <id|path> / --list-sessions
Resume or list saved sessions.
--work-for <duration|forever>
Enable autopilot for a duration (or forever).
Usage Examples
Example 1: Debug and Fix a Failing Test
sweet "Fix the failing test in tests/test_api.py line 45"
Sweet! CLI will:
- Read the failing test file
- Run the test to see the error
- Analyze the code and error message
- Fix the issue and verify the test passes
- Commit the changes with a descriptive message
Example 2: Implement a New Feature
sweet "Add user profile endpoint with GET /api/users/:id"
Sweet! CLI will:
- Analyze existing API structure
- Create or update route handler
- Add validation and error handling
- Update documentation
- Write tests for the new endpoint
Example 3: Interactive Session for Complex Work
sweet
This starts an interactive session where you can:
- Give multiple related tasks in sequence
- Review changes before proceeding
- Adjust direction based on intermediate results
- Work on larger projects over extended time
Configuration
Sweet! CLI can be configured in several ways:
Command-line Flags
--api-key <key>: DeepSeek API key (or set DEEPSEEK_API_KEY env var)--provider <deepseek|nebius>: Model provider (default: deepseek)--model <name>: Model name override--prompt <text>: Single prompt to execute (non-interactive mode)--log: Log conversations to JSONL for fine-tuning--no-billing: Use direct DeepSeek API instead of billing relay--api-base <url>: Billing API base URL (for login)--list-sessions: List saved sessions and exit--resume-last: Resume the most recent session--session <id>: Resume a specific session by ID--work-for <duration>: Enable autopilot mode for specified duration--help: Show help information
Environment Variables
DEEPSEEK_API_KEY: API key for direct usage with--no-billingSWEET_BILLING_API: Billing API base URL overrideSWEET_BILLING_TOKEN: Billing auth token override
Configuration File
Sweet! CLI can also read YAML/JSON config files (see Configuration). Example .sweet/config.yaml:
max_context_tokens: 90000
compaction_mode: "resume_prompt"
compaction_target_tokens: 12000
default_timebox_seconds: 3600
Tips for Effective Commands
- Be specific: Instead of "fix bug", describe what's broken: "Fix 500 error when user logs in with expired token"
- Include context: Mention file names, line numbers, or error messages when relevant
- Start small: For complex tasks, break them down: first "analyze the problem", then "implement solution"
- Use interactive mode: For multi‑step work,
sweetallows back‑and‑forth discussion - Review changes: Always review the changes Sweet! CLI makes before deploying to production
Troubleshooting Commands
If you encounter issues, try these diagnostic commands:
# Check system status
sweet
# Run diagnostics
sweet --help
# View logs
sweet --list-sessions
# Re-authenticate
sweet login
For more troubleshooting help, see the troubleshooting guide.