JSPM

  • Created
  • Published
  • Downloads 217
  • Score
    100M100P100Q76526F
  • License MIT

A powerful command-line AI coding assistant with Google Gemini 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 powered by Google Gemini

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)
  • 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

  • Conversation history across devices
  • Settings synchronization
  • Seamless authentication with Google
  • Secure backend-managed AI access

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. Prerequisites

Before using Centaurus CLI, ensure the backend service is running and accessible. The backend handles all AI model interactions.

Backend Setup:

  • The backend must be deployed and configured with Google API keys
  • Set the backend URL in your .env file (see Configuration section)
  • Default: http://localhost:3000/api

2. First Launch

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

centaurus

You'll be prompted to sign in with Google. Authentication is required to use AI features.

3. Start Chatting

Once authenticated, 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 directory:

# Backend API URL (required for all AI features)
BACKEND_API_URL=http://localhost:3000/api

Important: The backend URL is required for the CLI to function. All AI model calls are proxied through the backend service.

User Configuration

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

  • Preferred model
  • Theme settings
  • Auto-accept preferences
  • Plan mode settings

Note: API keys are no longer stored in the CLI. They are managed centrally by the backend service.

Commands

Slash Commands

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

Examples

# Change model
/model gemini-2.5-flash

# Enable plan mode for complex tasks
/plan

# Clear conversation history
/clear

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.

Authentication

Sign In (Required)

Authentication with Google is required to use Centaurus CLI:

  1. Start Centaurus
  2. Select "Sign in with Google"
  3. Complete authentication in browser
  4. Start using AI features!

Features

  • Conversation History: Access your chats from any device
  • Settings Sync: Your preferences follow you everywhere
  • Secure AI Access: Backend-managed API keys for security
  • Web Search: Powered by backend API

Backend Connectivity

Centaurus CLI requires a connection to the backend service:

  • All AI model calls are proxied through the backend
  • Authentication tokens are validated by the backend
  • Ensures secure and centralized API key management
  • No local API key storage required

Advanced Usage

Custom Backend

Set up your own backend instance:

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

Backend Requirements:

  • Must be configured with Google API keys
  • Must support the /api/ai/chat endpoint
  • Must handle authentication and session management

Keyboard Shortcuts

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

Troubleshooting

"Authentication required"

Sign in with Google:

  1. Restart the CLI
  2. Choose "Yes" when prompted to sign in
  3. Complete the authentication flow in your browser

"Backend API is not reachable"

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

BACKEND_API_URL=http://localhost:3000/api

Verify backend is running:

cd backend
npm start

Common Issues:

  • Backend service is not running
  • Incorrect backend URL in .env
  • Network connectivity issues
  • Firewall blocking the connection

"Rate limit exceeded"

The backend has exhausted its API quota. This is managed by the backend administrator. Wait a few moments and try again.

Reset Configuration

Delete the config file to start fresh:

Windows:

del %USERPROFILE%\.centaurus\config.json

macOS/Linux:

rm ~/.centaurus/config.json

Note: This will clear your model preferences and settings, but you'll need to re-authenticate.

Requirements

  • Node.js >= 18.0.0
  • npm or yarn
  • Terminal with color support
  • Backend service running and accessible
  • Google account for authentication

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

  • Built with Ink - React for CLIs
  • Powered by Google Gemini
  • Inspired by modern AI coding assistants

Made with ❤️ by developers, for developers