AI-powered code intelligence CLI for code security, analysis, and review
npm install whisper-ai~/.whisper/
sh
npm install -g whisper-cli-ai
`
$3
`sh
git clone https://github.com/Alinxus/whisper-cli.git
cd whisper
npm install
npm run build
npm link # (optional, to use as a global CLI)
`
---
π Setup: Provide Your AI API Keys
1. Copy the example environment file:
`sh
cp .env.example .env
`
2. Open .env and add your API keys for any of the following:
- GEMINI_API_KEY (Google Gemini)
- OPENAI_API_KEY (OpenAI)
- ANTHROPIC_API_KEY (Anthropic Claude)
You only need to provide the keys for the AI providers you want to use.
---
π Using .whisperignore
You can create a .whisperignore file in your project root to exclude files and folders from being scanned by Whisper CLI. This works just like a .gitignore file.
- Why? To speed up scans and avoid analyzing files you don't care about (e.g., node_modules, build output, logs, etc).
- How? Add one pattern per line. Example:
`
node_modules/
dist/
build/
*.log
.env
.git/
coverage/
`
- Default ignores: Whisper CLI already ignores common folders like node_modules, .git, dist, etc. Your .whisperignore will be merged with these defaults.
---
π οΈ Usage
$3
`sh
whisper scan [path] [options]
`
- Example:
`sh
whisper scan . --ai --model gpt-4o
`
$3
`sh
whisper explain [options]
`
- Example:
`sh
whisper explain src/index.js --model gemini-1.5-pro
`
$3
`sh
whisper fix [path] [options]
`
$3
`sh
whisper chat [options]
`
$3
`sh
whisper guard --install
`
---
π Available Commands
- scan β Scan code for vulnerabilities and improvements
- explain β Explain code with AI
- fix β Suggest and auto-fix issues
- chat β Interactive AI chat mode
- guard β Git pre-commit security guard
- config β Manage CLI configuration
- plugin β Manage CLI plugins
- history β View local chat and scan history
- update β Update the CLI
- doctor β Diagnose and fix common issues
> Note: There are no auth, analytics, or backend commands. Everything runs locally and securely.
---
π§βπ» Open Source & Contributing
We welcome contributions! To get started:
1. Fork this repo and clone it locally.
2. Install dependencies: npm install
3. Make your changes and add tests if needed.
4. Open a pull request with a clear description.
$3
- The CLI entry point is in bin/whisper.js.
- Main logic is in lib/.
- Backend code (in backend/) is provided as a template and is not required for CLI use.
---
π FAQ
Q: Do I need to sign up or log in?
> No. Just provide your own AI API keys in .env`.