Complete reference for all Codestral CLI commands and tools.
These work when you're in interactive mode (codestral-cli with no arguments):
| Command | Description | Example |
|---|---|---|
help |
Show help information | help |
clear |
Clear conversation history | clear |
config |
Show current configuration | config |
exit |
Exit the application | exit |
quit |
Exit the application | quit |
bye |
Exit the application | bye |
These work when starting the CLI:
| Argument | Description | Example |
|---|---|---|
prompt |
Send a single prompt | codestral-cli "Write Python code" |
--max-tokens INT |
Limit response length | codestral-cli "Long prompt" --max-tokens 500 |
--version |
Show version information | codestral-cli --version |
--help |
Show help message | codestral-cli --help |
All tool commands start with / and can be used in interactive mode:
Explains shell commands, code snippets, or technical concepts.
/explain ls -la
/explain "grep -r pattern ."
/explain "docker run -it ubuntu"Performs code review on the specified file.
/review app.py
/review src/main.js
/review ../config.yamlAnalyzes code structure and provides insights.
/analyze myproject.py
/analyze package.jsonGenerates git commit messages based on current changes.
/commit
# Analyzes git diff and suggests commit messagesGeneral git help and command suggestions.
/git "merge conflicts"
/git "rebase vs merge"Helps debug errors and provides solutions.
/debug "ModuleNotFoundError: No module named 'requests'"
/debug "TypeError: unsupported operand type(s)"
/debug "CORS error in browser"Generates documentation for code snippets.
/docs "def calculate_average(numbers): return sum(numbers) / len(numbers)"Generates unit tests for code files.
/test utils.py
/test components/Button.jsSuggests commands or approaches for development tasks.
/suggest "deploy Flask app to production"
/suggest "optimize database queries"
/suggest "set up CI/CD pipeline"👤 You: How do I create a REST API in Python?
🤖 Codestral: Here's how you can create a REST API in Python using Flask:
```python
from flask import Flask, jsonify, request
app = Flask(__name__)
@app.route('/api/data', methods=['GET'])
def get_data():
return jsonify({'message': 'Hello, World!'})
if __name__ == '__main__':
app.run(debug=True)👤 You: /review api.py
🤖 Codestral: [Reviews your API file and provides feedback...]
### Developer Workflow
```bash
👤 You: /explain "docker-compose up -d"
🤖 Codestral: This command starts Docker containers defined in docker-compose.yml:
- `docker-compose`: Docker Compose command-line tool
- `up`: Start services
- `-d`: Detached mode (run in background)
👤 You: /debug "Port 5000 is already in use"
🤖 Codestral: This error occurs when another process is using port 5000. Solutions:
1. Stop the process: `lsof -ti:5000 | xargs kill`
2. Use a different port in your app
3. Find what's using the port: `lsof -i :5000`
👤 You: /commit
🤖 Codestral: [Analyzes git changes and suggests commit message...]
| Shortcut | Action |
|---|---|
Ctrl+C |
Exit gracefully |
Ctrl+D |
Exit (EOF) |
↑/↓ |
Command history (in terminal) |
Tab |
Auto-completion (in terminal) |
# ✅ Good - Specific and clear
"Write a Python function that validates email addresses using regex"
# ❌ Less effective - Too vague
"help with email"
# ✅ Good - Context provided
"How do I fix this React error: 'Cannot read property of undefined'"
# ❌ Less effective - No context
"React error"# ✅ Review before committing
/review changed_files.py
/commit
# ✅ Debug with full error message
/debug "ValueError: invalid literal for int() with base 10: 'abc'"
# ✅ Explain unfamiliar commands
/explain "awk '{print $2}' file.txt | sort | uniq -c"# Start fresh for different topics
clear
# Check current settings
config
# Get help when needed
help
/help"Create a Python class for a simple cache with TTL (time-to-live) functionality"
"Write a bash script that backs up a directory to S3 with error handling"
"Generate a React component with TypeScript for a searchable dropdown"/analyze main.py # Get overview
/review main.py # Detailed review
/test main.py # Generate tests
/docs main.py # Create documentation/debug "specific error message"
/explain "complex command or concept"
/suggest "alternative approach"Responses appear token-by-token in real-time:
👤 You: Explain async programming
🤖 Codestral: Async programming allows...
[continues streaming live]Responses include:
- Syntax highlighting for code blocks
- Markdown formatting for headers, lists, links
- Progress indicators showing tokens and timing
- Error messages with helpful suggestions
Developer tools provide structured output:
/explain ls -la
📋 Command Breakdown:
• ls: List directory contents
• -l: Long format (permissions, size, date)
• -a: Include hidden files (starting with .)
🔍 Example Output:
drwxr-xr-x 5 user staff 160 Oct 13 10:30 .
-rw-r--r-- 1 user staff 1024 Oct 13 09:15 file.txt