Skip to main content

Agentic CLI - Autonomous coding assistant with multi-provider AI support

Project description

Commandor - Agentic CLI

Commandor

Commandor is an Agentic CLI (similar to OpenCode or Codex CLI) that uses AI to autonomously accomplish coding tasks. It can read, write, edit files, run commands, and complete multi-step tasks.

GitHub stars License Python


Key Features

Agent Modes

  • /agent - Autonomous mode: Agent executes tasks without asking for confirmation
  • /assist - Assist mode: Agent asks for confirmation before each action
  • /plan - Plan mode: Generate plan first, then execute (review before run)
  • /chat - Chat mode: Ask questions without executing actions

Multi-Provider Support

  • Google Gemini - gemini-2.5-flash, gemini-1.5-pro
  • Anthropic Claude - claude-3.5-sonnet, claude-3-opus
  • OpenAI GPT - gpt-4o, gpt-4-turbo, gpt-3.5-turbo
  • OpenRouter - Access to 100+ models

Tools

  • File Operations: Read, Write, Edit files
  • Search: Glob, Grep for finding files and content
  • Shell: Run commands, list directories
  • Project: Git info, project files, environment info
  • Session Management: Save, resume, and manage sessions
  • API Management: Configure providers and models
  • Rich Markdown Rendering: AI responses with enhanced formatting

Installation

From PyPI (Recommended)

pip install commandor-ai

From Source

git clone https://github.com/ravin-d-27/Commandor.git
cd Commandor
pip install -e .

Set Up API Keys

Run the interactive setup:

commandor --setup

Or set environment variables:

# Google Gemini
export GEMINI_API_KEY=your_key

# Anthropic Claude  
export ANTHROPIC_API_KEY=your_key

# OpenAI
export OPENAI_API_KEY=your_key

# OpenRouter
export OPENROUTER_API_KEY=your_key

Usage

Interactive Mode

commandor

Command Line Mode

Autonomous Agent

commandor -a "fix the bug in main.py"
commandor --agent "add tests for auth module"

Assist Mode (with confirmations)

commandor --assist "create a new feature"

Chat Mode (Q&A only)

commandor --chat "what is async/await in Python?"

Available Commands

In Interactive Terminal

Command Description
/agent <task> Run autonomous agent
/assist <task> Run with confirmations
/plan <task> Plan then execute (review before run)
/chat <question> Ask AI questions
/ai <instruction> Convert natural language to shell command
/ask <question> Ask AI any question directly
/provider <name> Switch AI provider
/providers List available providers
/modes Show agent modes
/setup Run interactive setup
/test-providers Test all configured providers
/help Show help
/info Show system information
/history Show recent command history
/ask-history Show your question history
/ask-search <term> Search your question history
/clear Clear the screen
/config Show configuration info
/reset-api Reset and reconfigure API key
/test-api Test current API key
/api Show API key status table
/api set <provider> <key> Set API key for a provider
/api model <provider> <model> Set default model for a provider
/api test [provider] Test one or all providers
/api remove <provider> Remove a provider's API key
/api default <provider> Set default provider
/sessions List saved sessions
/sessions save <name> Name the current session
/sessions new <name> Start a fresh named session
/sessions resume <name> Switch to a saved session
/sessions rename <old> <new> Rename a session
/sessions delete <name> Delete a session
/exit Exit

Configuration

Config file: ~/.commandor/config

default_provider: openrouter

providers:
  gemini:
    enabled: true
    default_model: gemini-2.5-flash
  
  anthropic:
    enabled: true  
    default_model: claude-3.5-sonnet-20241022
  
  openai:
    enabled: true
    default_model: gpt-4o
  
  openrouter:
    enabled: true
    default_model: anthropic/claude-3.5-sonnet

agent:
  max_iterations: 50
  confirm_destructive: true

Examples

Agent Mode Examples

commandor > /agent fix all TypeScript errors in src/
commandor > /agent add error handling to auth.py
commandor > /agent create a README.md for this project

Assist Mode Examples

commandor > /assist create a new React component
commandor > /assist refactor this function

Shell Commands

commandor > /ai list all python files recursively
commandor > /ai find files larger than 100MB
commandor > /ai show disk usage

Docker Usage

# Pull the image
docker pull ravind2704/commandor

# Run
docker run -it ravind2704/commandor

# With API keys
docker run -it -e OPENAI_API_KEY=your_key ravind2704/commandor

Project Structure

commandor/
├── commandor/
│   ├── __init__.py
│   ├── __main__.py       # CLI entry point
│   ├── main.py           # Legacy entry
│   ├── terminal.py       # Interactive terminal
│   ├── config.py         # Configuration management
│   ├── providers/        # AI providers
│   │   ├── base.py
│   │   ├── factory.py
│   │   ├── gemini.py
│   │   ├── anthropic.py
│   │   ├── openai.py
│   │   └── openrouter.py
│   ├── agent/            # Agent system
│   │   ├── agent.py
│   │   ├── tools.py
│   │   ├── modes.py
│   │   ├── executor.py
│   │   └── prompts.py
│   └── utils/           # Utilities
│       ├── file_ops.py
│       └── shell.py
├── pyproject.toml
├── setup.py
└── README.md

Requirements

  • Python 3.9+
  • API key for at least one AI provider

Troubleshooting

Command not found

  • Confirm installation: pip show commandor-ai
  • Check PATH or activate virtual environment

API Key errors

  • Run commandor --setup to configure
  • Or set environment variables
  • Test with /test-providers in interactive mode

Need help?


Contributing

  1. Star the repository
  2. Report bugs and request features via GitHub Issues
  3. Submit pull requests with improvements
  4. Follow code conventions and include tests

License

MIT License - see LICENSE


Author

Created by Ravin D


Version: 0.2.0 Status: Actively maintained

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

commandor_ai-0.2.0.tar.gz (47.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

commandor_ai-0.2.0-py3-none-any.whl (50.1 kB view details)

Uploaded Python 3

File details

Details for the file commandor_ai-0.2.0.tar.gz.

File metadata

  • Download URL: commandor_ai-0.2.0.tar.gz
  • Upload date:
  • Size: 47.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for commandor_ai-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c354f1332a52fae0b3690e88aae7f31e588a2dab7b5e2cb1d36bfff9a8368a60
MD5 a05724fd9aeb10bff71afb9715060567
BLAKE2b-256 490c0a6e2f677701e0d73073bd66ee5fe9e62368bfcf3e6623e511cbaafc8ce2

See more details on using hashes here.

File details

Details for the file commandor_ai-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: commandor_ai-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 50.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for commandor_ai-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 df9a6ba8f3edfdf425bc42a7906e84f62d023dd3e0a655f7769fc38a14e69ac4
MD5 ae11502ce296bd1cd297fee4327f20fa
BLAKE2b-256 6718d15228283bbd86aca005f7230eee7aa02e6e3019616ed5537c0706ec73c3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page