JSPM

  • Created
  • Published
  • Downloads 222
  • Score
    100M100P100Q77544F
  • License MIT

A powerful command-line AI coding assistant with Google Gemini and OpenRouter support

Package Exports

  • centaurus-cli
  • centaurus-cli/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (centaurus-cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Centaurus CLI

A powerful command-line AI coding assistant with Google Gemini and OpenRouter support

npm version License: MIT Node.js Version

Features

AI-Powered Coding Assistant

  • Support for Google Gemini (2.5 Flash, 2.5 Pro, 2.0 Flash, and more)
  • OpenRouter integration for access to multiple AI models
  • Intelligent code generation and editing
  • Context-aware file operations

🔧 Developer Tools

  • Read, write, and edit files with AI assistance
  • Execute shell commands safely
  • Search codebases with grep
  • Web search capabilities (requires authentication)
  • Diff viewer for code changes

🎨 Beautiful Terminal UI

  • Built with Ink (React for CLIs)
  • Syntax highlighting for code blocks
  • Interactive pickers and prompts
  • Real-time streaming responses
  • Markdown rendering

☁️ Cloud Sync (Optional)

  • Conversation history across devices
  • Settings synchronization
  • Encrypted API key storage
  • Seamless authentication with Google

Installation

npm install -g centaurus-cli

After installation, you can run Centaurus from any directory:

centaurus

Local Installation

npm install centaurus-cli
npx centaurus

Quick Start

1. First Launch

When you first run Centaurus, you'll see a beautiful welcome screen:

centaurus

You'll be prompted to sign in with Google for cloud sync features, or you can exit and configure manually.

2. Configure API Keys

Set up your AI provider API keys using slash commands:

# For Google Gemini
/config set googleApiKey YOUR_GOOGLE_API_KEY

# For OpenRouter
/config set openrouterApiKey YOUR_OPENROUTER_API_KEY

Get API Keys:

3. Start Chatting

Just type your message and press Enter:

> Create a React component for a todo list

The AI will help you with code generation, file operations, and more!

Configuration

Environment Setup

Create a .env file in your project or use the global config:

# Backend API URL (for cloud sync and web search)
BACKEND_API_URL=http://localhost:3000/api

User Configuration

Your settings are stored in ~/.centaurus/config.json:

  • API keys (encrypted)
  • Preferred model and provider
  • Theme settings
  • Auto-accept preferences

Commands

Slash Commands

/help                              # Show all commands
/config                            # View current configuration
/config set <key> <value>          # Set configuration value
/model                             # Select AI model
/provider                          # Select AI provider
/plan                              # Toggle plan mode
/clear                             # Clear conversation history
/logout                            # Sign out and exit
/exit                              # Exit the application

Examples

# Set API key
/config set googleApiKey AIzaSy...

# Change model
/model gemini-2.5-flash

# Switch provider
/provider openrouter

# Enable plan mode for complex tasks
/plan

Features in Detail

File Operations

Centaurus can read, write, and edit files in your project:

> Read the package.json file
> Create a new file called utils.ts with helper functions
> Edit the README.md to add installation instructions

Code Generation

Generate code in any language:

> Create a Python script to parse CSV files
> Write a TypeScript interface for a user object
> Generate a SQL query to find duplicate records

Search the web for documentation and solutions (requires authentication):

> Search for the latest React hooks best practices
> Find documentation for the Axios library

Command Execution

Execute shell commands safely:

> Run npm install
> List all files in the current directory
> Check the git status

Plan Mode

For complex tasks, enable plan mode to see the implementation plan before execution:

/plan
> Build a REST API with Express and TypeScript

The AI will create a detailed plan and ask for approval before implementing.

Cloud Sync

Sign In

Sign in with Google to enable cloud features:

  1. Start Centaurus
  2. Select "Sign in with Google"
  3. Complete authentication in browser
  4. Enjoy cloud sync!

Features

  • Conversation History: Access your chats from any device
  • Settings Sync: Your preferences follow you everywhere
  • API Key Storage: Encrypted storage in the cloud
  • Web Search: Powered by backend API

Offline Mode

You can use Centaurus without signing in:

  • All AI features work offline
  • Local conversation history
  • No web search (requires backend)

Advanced Usage

Multiple API Keys

Configure multiple API keys for automatic rotation:

/config set googleApiKey key1,key2,key3

Custom Backend

Set up your own backend for cloud sync:

BACKEND_API_URL=https://your-backend.com/api

Keyboard Shortcuts

  • Ctrl+C - Cancel current operation
  • Ctrl+D - Exit (when input is empty)
  • Arrow Keys - Navigate pickers
  • Enter - Confirm selection

Troubleshooting

"API key not set"

Configure your API key:

/config set googleApiKey YOUR_KEY

Sign in with Google or restart the CLI and choose "Sign in".

"Backend API is not reachable"

Check your .env file and ensure the backend is running:

cd backend
npm start

Reset Configuration

Delete the config file to start fresh:

Windows:

del %USERPROFILE%\.centaurus\config.json

macOS/Linux:

rm ~/.centaurus/config.json

Requirements

  • Node.js >= 18.0.0
  • npm or yarn
  • Terminal with color support

Development

Clone and Build

git clone https://github.com/yourusername/centaurus-cli.git
cd centaurus-cli
npm install
npm run build
npm start

Project Structure

centaurus-cli/
├── src/
│   ├── ai/              # AI provider implementations
│   ├── commands/        # Command parser
│   ├── config/          # Configuration management
│   ├── services/        # API client and services
│   ├── tools/           # Tool implementations
│   ├── ui/              # Ink UI components
│   └── index.ts         # Entry point
├── dist/                # Compiled JavaScript
└── package.json

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT © [Your Name]

Support

Acknowledgments


Made with ❤️ by developers, for developers