CommandAI

CommandAI

Jason Jacobs (open source, MIT license) · Writing · Coding

CommandAI is an open-source AI command line tool that turns plain English into shell scripts, chat replies, and database queries. It runs on ChatGPT, OpenAI-compatible servers, or local Ollama models.

Interface preview of CommandAI

About CommandAI

What Is CommandAI

CommandAI is a small set of terminal utilities shipped as the command-ai package on npm. You type a request in normal words, and the tool asks an AI model to draft the script, explain what it plans to do, and run it once you say yes.

The package holds three programs. ai handles system tasks, aic opens a chat, and aiq answers questions about a database. Each one has an exclamation-mark variant that skips the approval step, which is handy when another script is driving the tool.

It's honest about being early. The README calls the project alpha and warns that prompts get tuned per model, so a request that works cleanly on GPT models may need rewording on a local Ollama model. There's no sandbox and no undo, so the review step in front of every command is the real safety net.

Getting Started

  1. Install Node.js 18 or newer, then run npm install -g command-ai.
  2. Run ai config and pick a service: Ollama, ChatGPT, or an OpenAI-compatible endpoint. Settings land in ~/.commandai/config.json.
  3. Ask for a job in quotes, for example ai "create a cron job that checks my IP and pings a URL when it changes".
  4. Read the plan and description, then confirm before anything executes.
  5. For data work, run aiq config to register a Postgres, MySQL, SQLite, or MSSQL connection.

Product Information

A quick look at CommandAI's pricing, supported platforms, and performance.

Free PlanYes
Paid PlansFree software, no tiers; model usage billed by your provider
PlatformWindows, macOS, Linux (Node.js 18+)
DeveloperJason Jacobs (open source, MIT license)
CategoryWriting · Coding
Release DateMay 2024
Latest UpdatedOct 2024
Website VisitsN/A
Website Global RankN/A
API AvailabilityNo

Best for

The users, tasks, and scenarios where this tool fits best.

Users

  • Developers who live in a shell and want a terminal AI assistant for chores like cron entries, project scaffolding, and file cleanup, provided they read the plan before approving.
  • Data analysts who know the question but not the SQL, and want an AI database query against a Postgres or MySQL connection they already have.
  • Privacy-minded teams running Ollama on their own hardware, since no request has to leave the local network.

Tasks

  • One-off automation
  • Natural language commands for tools you touch twice a year, where the flags never stick in memory.
  • Exploratory AI database query work, such as listing rows over a threshold or grouping signups by week.
  • Spinning up a starter project with a config file, a server, and a first route in one pass.

Scenarios

  • On-call triage at an odd hour, when you need a quick script to check a port or rotate a log.
  • Joining an unfamiliar codebase and asking the CLI to explain or organize what's on disk.
  • An air-gapped or regulated machine, where a hosted chat tool is off the table but Node.js is available.

Key features

Plain-English Task Execution

The core loop takes a sentence and returns a runnable script plus a description of what it does. That description is often the useful part, because it names the files, services, and side effects involved before you commit.

Three Utilities in One Package

ai, aic, and aiq cover system tasks, conversation, and data questions. Installing one npm package gives you all three, so there's no separate setup for the chat or database side.

Model Choice: ChatGPT, OpenAI-Compatible, or Ollama

A single config entry picks the backend. You can point it at OpenAI, at a self-hosted server that speaks the same API, or at Ollama with a model name of your choice. Switching takes one edit and no reinstall.

Execution Plans Before Anything Runs

Every command shows the plan first, and the default is to wait for your confirmation. You can turn the plan display off if the extra read gets in the way, and the ! variants exist for scripted runs that can't answer a prompt.

AI Database Query Across Four Engines

aiq handles MySQL, Postgres, SQLite, and MSSQL. Connections live in ~/.commandai/db.json, and a SQLite file can be passed as the first argument without any config at all.

Config Files You Can Read and Edit

Settings are plain JSON in ~/.commandai. Nothing is hidden in a binary store, so you can diff the file, copy it to another machine, or keep it in a dotfiles repo.

Pros and cons

Pros

  • MIT licensed and free to install, with no seat count and no subscription.
  • The plan review step makes generated commands easier to trust than blind autocomplete.
  • Works with a local Ollama model, which keeps prompts and file paths on your own hardware.
  • Config stays in readable JSON, so a team can standardize one file across machines.
  • Database support covers four engines, including MSSQL, which many small CLI helpers skip.

Cons

  • The project is alpha, and the last npm release landed in October 2024, so it trails newer terminal agents on model support.
  • Generated scripts run with your user permissions and there's no sandbox, which means a bad plan can delete real files if you approve it.
  • Prompt quality swings between models, so local models need more rewording than hosted ones.
  • No API, no team dashboard, and no web version, so anything beyond the CLI depends on the README.

Frequently asked questions

It converts a request written in normal language into a shell script, shows the plan, and runs it after you confirm. The same package also provides a chat mode and a database question mode.