Package Exports
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 () 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
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
- Enhanced Agentic Loop - Autonomous multi-turn task completion
🔧 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
🤖 Autonomous Operation
- Continuous multi-turn execution until task completion
- Automatic detection of incomplete work
- Smart continuation without manual prompting
- Handles complex multi-file projects seamlessly
Installation
Global Installation (Recommended)
npm install -g centaurus-cliAfter installation, you can run Centaurus from any directory:
centaurusLocal Installation
npm install centaurus-cli
npx centaurusQuick 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
.envfile (see Configuration section) - Default:
http://localhost:3000/api
2. First Launch
When you first run Centaurus, you'll see a beautiful welcome screen:
centaurusYou'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 listThe 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/apiImportant: 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 and system prompts are managed centrally by the backend service. This ensures:
- Consistent AI behavior across all Centaurus clients (CLI, Desktop, Web)
- Easy updates to AI instructions without client changes
- Secure credential management
- Environment-aware responses (OS, shell, working directory)
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 applicationExamples
# Change model
/model gemini-2.5-flash
# Enable plan mode for complex tasks
/plan
# Clear conversation history
/clearFeatures in Detail
Enhanced Agentic Loop
Centaurus CLI features a robust autonomous operation system that works continuously until your task is complete:
How It Works:
- The AI executes multiple turns automatically without manual prompting
- Detects when work is incomplete and continues autonomously
- Handles complex multi-file projects in a single session
- Supports up to 100 turns for complex tasks
- Automatically stops when the task is complete
Example - Multi-File Project:
> Create a landing page with HTML, CSS, and JavaScriptThe AI will:
- Create
index.htmlwith structure - Create
styles.csswith styling - Create
script.jswith interactivity - Complete the task automatically without additional prompts
Smart Continuation:
- Detects incomplete responses (e.g., "I created the HTML file...")
- Automatically prompts the AI to continue with remaining steps
- Prevents premature stopping on complex tasks
Safety Features:
- 500ms delay between turns to prevent rate limiting
- Maximum 100 turns to prevent infinite loops
- Long-running command protection (blocks
npm run dev, etc.) - 30-second timeout for command executions
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 instructionsCode 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 recordsWeb Search
Search the web for documentation and solutions (requires authentication):
> Search for the latest React hooks best practices
> Find documentation for the Axios libraryCommand Execution
Execute shell commands safely:
> Run npm install
> List all files in the current directory
> Check the git statusNote: Long-running commands (like npm run dev, yarn start, or development servers) are automatically blocked. Run these manually in a separate terminal.
Plan Mode
For complex tasks, enable plan mode to see the implementation plan before execution:
/plan
> Build a REST API with Express and TypeScriptThe 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:
- Start Centaurus
- Select "Sign in with Google"
- Complete authentication in browser
- 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
System Prompt Management
System prompts (the foundational AI instructions) are managed entirely by the backend:
Benefits:
- Consistency: All Centaurus clients use the same AI behavior
- Easy Updates: Prompt improvements are deployed instantly without client updates
- Environment Awareness: Backend injects your OS, shell, and working directory context
- Mode Support: Different prompts for default, plan, and command modes
How It Works:
- CLI sends your message and environment context to the backend
- Backend injects the appropriate system prompt with your environment details
- AI receives complete context and responds appropriately
- No prompt management needed on your end!
Environment Context Sent:
- Operating system (Windows, macOS, Linux)
- Shell type (cmd, PowerShell, bash, zsh)
- Current working directory
- Home directory path
- Current mode (default, plan, command)
Advanced Usage
Custom Backend
Set up your own backend instance:
BACKEND_API_URL=https://your-backend.com/apiBackend Requirements:
- Must be configured with Google API keys
- Must support the
/api/ai/chatendpoint - Must handle authentication and session management
Keyboard Shortcuts
Ctrl+C- Cancel current operationCtrl+D- Exit (when input is empty)Arrow Keys- Navigate pickersEnter- Confirm selection
Troubleshooting
"Authentication required"
Sign in with Google:
- Restart the CLI
- Choose "Yes" when prompted to sign in
- 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/apiVerify backend is running:
cd backend
npm startCommon 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.
AI Stops Before Task is Complete
If the AI stops working before finishing your task:
Possible Causes:
- Network interruption - Check your internet connection
- Backend timeout - The backend may have timed out; try again
- Turn limit reached - Very complex tasks may hit the 100-turn safety limit
Solutions:
- For simple continuation: Send a follow-up message like "Continue with the remaining steps"
- For complex tasks: Break the task into smaller, more specific requests
- Check backend logs for errors if the issue persists
AI Keeps Working After Task is Done
The enhanced agentic loop should automatically detect completion. If it continues unnecessarily:
What to Do:
- Press
Ctrl+Cto stop the current operation - The AI should detect completion within 2-3 turns after finishing
- If this happens frequently, report it as a bug with your task description
Long-Running Commands Blocked
Commands like npm run dev, yarn start, or python -m http.server are automatically blocked:
Why:
- These commands don't terminate and would hang the CLI
- They're meant to run in separate terminal sessions
Solution:
- Run development servers manually in a separate terminal
- The AI will inform you when you need to run these commands yourself
Slow Response or Timeouts
If responses are slow or timing out:
Troubleshooting Steps:
- Check your internet connection speed
- Verify backend is responsive:
curl http://localhost:3000/api/health - Check backend logs for rate limiting or API errors
- Try a simpler query to test connectivity
- Restart the CLI and try again
Commands Timing Out
Individual commands have a 30-second timeout:
If a command times out:
- The command may be too slow or hanging
- Check if the command works when run manually
- Consider breaking complex commands into smaller steps
- Some operations (large file processing) may need to be done outside the CLI
Environment Context Issues
If the AI doesn't seem aware of your OS or environment:
Check:
- Backend is receiving environment context (check backend logs)
- Your shell environment variables are set correctly
- Backend system prompt service is functioning
Verify:
# Check environment variables
echo $SHELL # macOS/Linux
echo %ComSpec% # WindowsReset Configuration
Delete the config file to start fresh:
Windows:
del %USERPROFILE%\.centaurus\config.jsonmacOS/Linux:
rm ~/.centaurus/config.jsonNote: This will clear your model preferences and settings, but you'll need to re-authenticate.
Getting Help
If you're still experiencing issues:
- Check Backend Logs: Most issues originate from backend connectivity or configuration
- Enable Debug Logging: Set
DEBUG=centaurus:*environment variable - Report Issues: Include your OS, Node version, and error messages
- Community Support: Check discussions for similar issues and solutions
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 startProject 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.jsonContributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - 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