Skip to content

Latest commit

 

History

History
145 lines (110 loc) · 3.25 KB

File metadata and controls

145 lines (110 loc) · 3.25 KB

🚀 Quick Start Guide

Get up and running with Codestral CLI in under 5 minutes.

📦 Installation

Option 1: Automatic Installation (Recommended)

git clone https://github.com/momominds/codestral-cli.git
cd codestral-cli
./install.sh

Option 2: Manual Installation

git clone https://github.com/momominds/codestral-cli.git
cd codestral-cli
pip3 install -r requirements.txt
chmod +x main.py

🔑 API Key Setup

Get your API key from Mistral Console:

export MISTRAL_API_KEY="your-api-key-here"

Or create a config file:

mkdir -p ~/.codestral
echo '{"api_key": "your-api-key"}' > ~/.codestral/config.json

🎯 Basic Usage

Single Prompt Mode

# Direct command
codestral-cli "Write a Python function to sort a list"

# Or with the full path
./main.py "Explain how async/await works in JavaScript"

Interactive Mode

# Start interactive session
codestral-cli

# Interactive session example:
👤 You: How do I handle errors in Python?
🤖 Codestral: [streaming response about try/except blocks...]

👤 You: /review myfile.py
🤖 Codestral: [reviews your code file...]

👤 You: exit
👋 Goodbye!

🛠️ Developer Commands

Use /command for built-in developer tools:

/explain ls -la          # Explain shell commands
/review myfile.py        # Code review and feedback  
/commit                  # Generate git commit messages
/debug "ImportError"     # Help debug errors
/suggest "deploy app"    # Suggest commands for tasks

⚙️ Configuration

Environment Variables

export MISTRAL_API_KEY="your-key"           # Required
export MISTRAL_MODEL="codestral-latest"     # Optional, default model
export MISTRAL_BASE_URL="https://..."       # Optional, custom endpoint  

Config File (~/.codestral/config.json)

{
  "api_key": "your-key-here",
  "model": "codestral-latest", 
  "max_tokens": 2000,
  "temperature": 0.1
}

🔧 Common Commands

# Show help
codestral-cli --help

# Show version
codestral-cli --version

# Set token limit
codestral-cli "Long prompt here" --max-tokens 1000

# Interactive mode
codestral-cli

🆘 Getting Help

In Interactive Mode

help          # Show available commands
/help         # Same as above
config        # Show current configuration
clear         # Clear conversation history

Troubleshooting

# Fix SSL certificate issues
python3 fix_ssl.py

# Bypass SSL (temporary)
PYTHONHTTPSVERIFY=0 codestral-cli "test prompt"

# Update certificates
pip3 install --upgrade certifi

🎉 Next Steps

💡 Tips

  1. Use descriptive prompts - The AI works better with clear, specific requests
  2. Try the developer tools - /explain, /review, /debug are very helpful
  3. Check the config - Type config to see your current settings
  4. Clear conversations - Use clear to start fresh conversations
  5. Exit gracefully - Use exit, quit, or Ctrl+C to quit properly