Command AI is an open-source CLI companion that brings AI power to your command line interface. It simplifies complex tasks by allowing you to use natural language commands.
You can interact with your CLI, automate repetitive tasks, set up projects, manage databases, and even start AI conversations directly from your terminal.
AI Services Supported:
- Ollama: Connect to your self-hosted Ollama instance.
- ChatGPT: Use the official ChatGPT through the OpenAI API.
- OpenAI API: Leverage any compatible OpenAI server for customized AI interactions.
How to use it:
1. Make sure you have node.js and NPM installed on your system.
2. Install Command AI globally with NPM:
$ npm install -g command-ai
3. The first time you run Command AI via $ ai, you’ll be prompted to configure your preferred AI service and other settings. This information is saved in the ~/.commandai/config.json file.
// config.json
{
"aiService": "",// "Ollama", "ChatGPT", or "OpenAI"
"ollamaUrl": "", // Ollama server URL
"ollamaModel": "", // Ollama Model
"openAIApiKey": "", // OpenAI API key
"openAIModel": "", // OpenAI Model
"openAIUrl": "", // URL of OpenAI API
"showExecutionDescription": true, // Show descriptions
"showExecutionPlan": true, // Show plans
"enableLogging": false // Enable logging
}
4. You can now interact with Command AI by typing ai followed by your request.
# Run ai and enter your requests when prompted
$ ai
# Create a new project
$ ai create an JavaScript project in ~/script-by-ai
# query databases in natural language
$ aiq my_database "list all AI tools where rating is greater than 4"
# Chat with AI
$ aic "what is AI?"
# Upgrade Command AI
$ ai upgrade
# Config Command AI
ai config
aiq config
aic config










