JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q78155F
  • License MIT

Natural language to shell command assistant for the command line — powered by Gemini, GPT, and Claude.

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 (cmdauto) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    CMDauto

    CMDauto is a TypeScript CLI that turns natural-language requests into shell commands using your choice of large language model (Google Gemini, OpenAI GPT, or Anthropic Claude).

    Requirements

    • Node.js 18 or newer
    • An API key for one of the supported LLM providers (unless you rely on the bundled Gemini key)

    Installation

    npm install -g cmdauto

    After installation the CLI exposes two entry points:

    • cmdauto – initializes or updates credentials
    • ca – asks for command suggestions

    Quickstart

    1. Initialize credentials

    cmdauto

    Choose one of the credential strategies when prompted:

    1. Use the bundled Google Gemini key (reads DEFAULT_GEMINI_API_KEY and DEFAULT_GEMINI_MODEL from .env).
    2. Supply your own key for OpenAI, Google Gemini, or Anthropic Claude. Keys are stored locally at ~/.cmdauto/config.json.
    3. Reuse the previously saved configuration.

    2. Request a command suggestion

    ca "deploy the docker compose project"

    CMDauto will query the configured LLM, show a dropdown of suggested shell commands, and execute the selection in your current working directory. The executed command and a snippet of its output are logged to history.

    Command reference

    • cmdauto – interactive credential setup flow
    • cmdauto --remove – delete saved credentials and history
    • ca "<task>" – generate suggestions for a natural-language task
    • ca --history – display the stored history entries
    • ca --remove – delete saved credentials and history
    • ca --exit – clear credentials/history and exit
    • ca --help – show CLI usage information
    • ca --version – print the package version

    Note: ca requires a successful cmdauto run first. If credentials are missing, it instructs you to initialize them before proceeding.

    Environment variables

    For production use, we strongly recommend supplying your own provider keys via cmdauto so usage stays under your account. If you need a quick start with the bundled Gemini credential, copy .env.example to .env and populate:

    DEFAULT_GEMINI_API_KEY=your-key-here
    DEFAULT_GEMINI_MODEL=gemini-2.5-flash-lite

    The DEFAULT_GEMINI_MODEL variable is optional; it falls back to the project default when omitted.

    History and configuration storage

    • Configuration: ~/.cmdauto/config.json
    • Command history: ~/.cmdauto/history.json (keeps the 30 most recent entries)

    Each history entry stores the original input, the executed command (if any), exit code, and a trimmed output snippet. This context is also sent to the LLM (last five entries) when generating new suggestions.

    Development workflow

    npm install
    npm run build
    npm run dev
    • npm run build compiles TypeScript to dist/.
    • npm run dev starts the CLI in watch mode using tsx.
    • npm pack --dry-run shows the files that would ship to npm.

    Before submitting code changes, please review the contribution guidelines in CONTRIBUTING.md.

    License

    MIT