Sweet! CLI

Getting Started with Sweet! CLI: Your AI Coding Assistant in the Terminal

Sweet! CLI transforms your terminal into an intelligent coding companion. Unlike traditional AI assistants that operate through chat interfaces, Sweet! CLI works directly in your development environment, executing commands, writing code, and debugging autonomously.

In this comprehensive guide, you'll learn how to install Sweet! CLI, configure it for your workflow, and start using its powerful features to accelerate your development process.

What is Sweet! CLI?

Sweet! CLI is an autonomous engineering assistant that operates at the command line. It understands your development context, makes technical decisions, and executes commands to achieve your goals. Think of it as a senior engineer working alongside you in the terminal.

Why choose Sweet! CLI?
  • Direct execution: No more copy-pasting code between AI chat and your editor
  • Context-aware: Understands your entire project structure and current state
  • Autonomous operation: Makes technical decisions and implements solutions independently
  • Terminal-native: Works entirely within your existing workflow

Installation

Sweet! CLI is available through multiple package managers. Choose the method that fits your environment:

Option 1: Install via npm (Recommended)

npm install -g @sweet-cli/sweet

Option 2: Install via pip (Python 3.8+)

pip install git+https://github.com/sweet-cli/sweet-cli.git

Or clone the repository and install dependencies:

git clone https://github.com/sweet-cli/sweet-cli.git
cd sweet-cli
pip install -r requirements.txt
python -m sweet.main

Option 3: Direct download

Download the latest binary from our GitHub releases:

curl -L https://github.com/sweet-cli/sweet-cli/releases/latest/download/sweet-cli-linux-amd64 -o /usr/local/bin/sweet
chmod +x /usr/local/bin/sweet
System Requirements:
  • Python 3.8+ (for pip installation) OR Node.js 16+ (for npm installation)
  • Git installed and configured
  • Terminal with ANSI color support
  • DeepSeek API key or Sweet billing account

Configuration

After installation, you need to configure Sweet! CLI with your API keys and preferences.

Using Sweet Billing (Recommended)

Sweet! CLI includes a billing relay that handles API costs and provides usage-based billing. Authenticate with:

sweet login

This will open a browser window where you can sign up or log in. After authentication, Sweet! CLI will automatically use the billing relay for all requests.

Using Direct API Access

If you prefer to use your own API key, set the DEEPSEEK_API_KEY environment variable:

export DEEPSEEK_API_KEY=your_api_key_here

Then run Sweet! CLI with the --no-billing flag:

sweet --no-billing "Your prompt"

Advanced Configuration

Sweet! CLI supports several command-line flags for configuration:

  • --provider <deepseek|nebius|fireworks> – Choose model provider (default: deepseek)
  • --model <model_name> – Override the default model
  • --api-key <key> – Provide API key directly (instead of environment variable)
  • --no-billing – Use direct API instead of billing relay
  • --log – Enable conversation logging for fine-tuning
  • --work-for <duration> – Set autopilot duration (e.g., 45m, 2h)

All configuration is passed via command-line flags; there is no configuration file.

Your First Command

Let's verify installation by asking Sweet! CLI a simple question:

sweet "What is 2 + 2?"
Terminal
$ sweet "What is 2 + 2?" 🤖 Sweet! CLI v1.0.0 🔧 Using DeepSeek model via Sweet billing relay 🧠 Thinking... 📝 The result is 4. 💡 Sweet! CLI can also solve complex programming tasks. Try asking it to fix a bug or implement a feature!

Basic Usage Examples

1. Autonomous Bug Fix

Sweet! CLI can debug and fix issues in your code:

sweet "Fix the failing test in tests/test_api.py"

2. Feature Implementation

Implement a new feature from a description:

sweet "Add user authentication with JWT tokens"

3. Code Review and Refactoring

Analyze and improve existing code:

sweet "Review main.py and suggest improvements"

4. Documentation Generation

Generate documentation for your project:

sweet "Create API documentation for the user module"

Advanced Workflows

Interactive Mode

Start an interactive session for extended work by running Sweet! CLI without any arguments:

sweet
Interactive Session
$ sweet 🤖 Sweet! CLI Interactive Mode 💡 Enter your goals, and I'll work autonomously 📁 Current directory: /projects/my-app > I need to add a new endpoint for user profile updates ✅ Reading project structure... ✅ Analyzing existing API patterns... ✅ Implementing user profile endpoint...

Interactive Slash Commands

While in interactive mode, you can use slash commands for advanced control:

  • /workfor 45m – Enable autopilot for 45 minutes (starts after your next prompt)
  • /stats – Show usage statistics and heatmap
  • /jobs – List and manage background jobs
  • /help – Show all available slash commands

These commands help you manage long-running tasks and monitor progress.

Git Integration

Sweet! CLI integrates with Git for version control:

sweet "Commit the recent changes with a descriptive message"
sweet "Create a new feature branch for the authentication system"

Tips for Success

  1. Start with clear goals

    Be specific about what you want to accomplish. Instead of "fix bugs," try "debug why the login API returns 500 errors."

  2. Use the autonomous mode for complex tasks

    For multi-step problems, let Sweet! CLI work independently by not interrupting with step-by-step instructions.

  3. Review changes before committing

    While auto-commit is convenient, review the changes to ensure they align with your intentions.

  4. Configure for your workflow

    Adjust settings like auto-commit, test-first, and verbosity to match how you work best.

Troubleshooting

Common Issues and Solutions

Issue: "API key not found" error
Solution: If using direct API access, set the DEEPSEEK_API_KEY environment variable:
export DEEPSEEK_API_KEY=your_key_here
Or use the billing relay by running sweet login.

Issue: Sweet! CLI is making incorrect changes
Solution: Be more specific in your prompts, break tasks into smaller steps, and review changes before committing. Use sweet --log to save conversation logs for analysis.

Issue: Timeouts on large tasks
Solution: Break large tasks into smaller prompts and monitor progress:
sweet "your task"

Next Steps

Now that you have Sweet! CLI installed and configured, try these projects:

Pro Tip: Sweet! CLI gets better with context. The more you use it on a project, the better it understands your patterns, preferences, and codebase. Stick with it for a week and you'll see significant productivity gains.
← Previous: AI Coding Assistants Comparison Next: AI Pair Programming Best Practices →