DevTools AI

CLI Reference

Every tool on this site is also a terminal command, backed by the exact same prompts, Zod validation, and OpenRouter streaming as the web app — see Architecture for how the two share one service layer.

Install

Three ways to run it, from quickest to most permanent:

# 1. From a clone, no install — good for trying it out
git clone https://github.com/HIMURAw/DevTools-AI.git
cd DevTools-AI && pnpm install
pnpm cli explain --file src/index.ts

# 2. Global command, straight from GitHub — no clone needed
npm install -g github:HIMURAw/DevTools-AI
devtools-ai list

# 3. Global command, from a local clone
git clone https://github.com/HIMURAw/DevTools-AI.git
cd DevTools-AI && npm install -g .

Methods 2 and 3 install a real devtools-ai command onto your PATH — the published package is a single bundled file (see Architecture), so there’s no separate build step to run yourself.

Configuration

The CLI reads OPENROUTER_API_KEY like any other terminal tool: from your shell environment, or from a .env / .env.localfile in whatever directory you run it from. There’s no separate CLI-only config file.

# Windows (PowerShell), current session only
$env:OPENROUTER_API_KEY = "sk-or-v1-..."

# Windows (PowerShell), persisted for future sessions
[Environment]::SetEnvironmentVariable("OPENROUTER_API_KEY", "sk-or-v1-...", "User")

# macOS/Linux
export OPENROUTER_API_KEY="sk-or-v1-..."

See Configuration for what else is configurable.

Commands

devtools-ai list                 # every available tool
devtools-ai models                # every allowed OpenRouter model
devtools-ai <tool> [text] [options]

Input

Every tool command takes its main input one of three ways — the first one provided wins:

MethodExample
Inline textdevtools-ai commit "fixed the retry loop"
--file <path>devtools-ai review --file src/app.ts
Piped stdingit diff | devtools-ai commit

Pass --exampleinstead to run a tool against its built-in sample input — the same one the “Example” button loads on the web app.

Global flags

FlagDefaultDescription
-f, --file <path>Read the primary input from a file
--exampleUse the tool’s built-in example input
-m, --model <id>qwen/qwen3-coder:freeMust be one of the models from devtools-ai models
-t, --temperature <number>0.40 (deterministic) to 1.5 (creative)
--max-tokens <number>2048256–8192
-h, --helpShow a command’s flags, e.g. devtools-ai review --help

Output and exit codes

The result streams to stdoutas it’s generated — nothing else. The “Tool · Model” status line and any errors go to stderr, so redirecting stdout captures exactly the clean result:

devtools-ai readme "..." > README.md
devtools-ai commit "..." | git commit -F -

Exit code is 0 on success and 1 on any failure — missing input, a rejected model, a validation error, or an OpenRouter/network error.

Every tool

Each command also accepts its own extra flags, shown below. Run devtools-ai <tool> --help to see them from the terminal.

AI Code Explainer devtools-ai explain (code-explainer)

Paste any snippet and get a clear, plain-English breakdown of what it does.

FlagDescription
--language <value>Language
devtools-ai explain --file src/utils/debounce.ts

Bug Finder devtools-ai bugs (bug-finder)

Scan code for logic errors, edge cases, and potential runtime bugs.

FlagDescription
--language <value>Language
devtools-ai bugs --file src/api/handler.js

Commit Message Generator devtools-ai commit (commit-message-generator)

Turn a diff or description into a clean Conventional Commit message.

git diff --staged | devtools-ai commit
devtools-ai commit "added rate limiting to the login endpoint"

README Generator devtools-ai readme (readme-generator)

Generate a professional, structured README from your project details.

devtools-ai readme "TaskFlow: a minimal CLI todo app written in Go. Features: add/remove/list tasks, due dates, tags."

Regex Generator devtools-ai regex (regex-generator)

Describe a pattern in plain language and get a working regular expression.

FlagDescription
--flavor <value>Regex flavor (JavaScript, Python, PCRE, POSIX)
devtools-ai regex "match a valid email address" --flavor Python

SQL Generator devtools-ai sql (sql-generator)

Describe the data you need and get a ready-to-run SQL query.

FlagDescription
--schema-info <value>Table schema (optional)
--dialect <value>Dialect (PostgreSQL, MySQL, SQLite, SQL Server)
devtools-ai sql "top 10 customers by revenue" --schema-info "orders(id, customer_id, amount)" --dialect MySQL

JSON → TypeScript devtools-ai json2ts (json-to-typescript)

Convert raw JSON into precise, well-named TypeScript interfaces.

FlagDescription
--root-name <value>Root interface name
devtools-ai json2ts --file data.json --root-name User

Email Generator devtools-ai email (email-generator)

Draft professional emails for any developer or workplace scenario.

FlagDescription
--tone <value>Tone (Professional, Friendly, Formal, Concise, Apologetic)
devtools-ai email "ask a teammate for a PR review before EOD" --tone Friendly

Code Optimizer devtools-ai optimize (code-optimizer)

Get concrete suggestions to improve performance and readability.

FlagDescription
--language <value>Language
devtools-ai optimize --file src/utils/search.js

Code Reviewer devtools-ai review (code-reviewer)

Receive a structured code review covering quality, style, and risk.

FlagDescription
--language <value>Language
devtools-ai review --file src/api/users.ts