@kittiphop_sompuech/opsi-cli
v1.0.8
Published
AI-powered CLI tool for developers
Readme
opsi
AI-powered CLI toolkit for developers — commit messages, documentation, security scanning, standup notes, and Git automation, straight from your terminal.
What is opsi?
opsi is a command-line tool that brings AI assistance into your daily development workflow without leaving the terminal. It connects to the Claude API (Anthropic) and gives you intelligent tools for the tasks developers do every day — writing commit messages, explaining code, auditing security, and more.
Why opsi?
- Save time on repetitive tasks — stop writing boilerplate commit messages and standup notes by hand
- Instant security feedback — scan your codebase for vulnerabilities and apply AI-suggested fixes interactively, with automatic backups
- No context switching — everything runs in your terminal, alongside your existing git workflow
- Language-aware — responses in English or Thai (ภาษาไทย), configurable with one command
- Smart caching — security scans cache results per file, so only changed files are re-scanned on subsequent runs
Requirements
- Node.js 18+
- An Anthropic API key
Installation
npm install -g opsi-cli-winneror run from source:
git clone <repo-url>
cd opsi
npm install && npm linkSetup
opsi config set --key sk-ant-xxxxQuick Reference: All Commands
| Command | Description |
|---------|-------------|
| opsi standup | Generate daily standup notes from git activity |
| opsi standup --days 3 | Look back 3 days of commits |
| opsi standup --copy | Copy result to clipboard |
| opsi commit | Preview an AI-generated commit message |
| opsi commit --commit | Generate and commit immediately |
| opsi docs <file> | Explain what a file does |
| opsi docs --update <file> | Add JSDoc/docstrings to all functions |
| opsi docs --readme . | Generate a README.md for the project |
| opsi scan . | Security audit of current directory |
| opsi scan --deps | Scan dependencies for vulnerabilities |
| opsi scan . --fix | Scan and interactively fix vulnerabilities |
| opsi config show | Show current configuration |
| opsi config set --key <key> | Set Anthropic API key |
| opsi config set --model <model> | Change AI model |
| opsi config set --lang th | Switch responses to Thai |
| opsi config set --lang en | Switch responses to English |
| opsi config reset | Reset config to defaults |
| opsi config cache | Show cache stats |
| opsi config cache-clear | Clear scan cache |
| opsi git --clone | Clone a repository, optionally using a custom SSH key |
| opsi git --upload | Stage all → semantic commit prompt → push to remote |
| opsi git --pull | Interactive pull with remote selector |
| opsi git --push | Interactive push with remote selector |
| opsi git --fetch | Interactive fetch with remote selector |
| opsi git --add-remote | Add a new named remote |
| opsi git --change-remote | Update the URL of an existing remote |
| opsi git --purge-file <path> | Permanently erase a file/folder from all Git history |
Commands
standup — Daily standup notes
Reads your recent git commits and generates a professional standup update.
opsi standup # From yesterday's commits
opsi standup --days 3 # Look back 3 days
opsi standup --copy # Generate and copy to clipboardOutput:
✅ Yesterday / What I did:
- Implemented JWT refresh token rotation in auth service
- Fixed null pointer bug in user profile endpoint
🔄 Today / What I plan to do:
- Write unit tests for the auth changes
- Review open PRs
⚠️ Blockers:
- Nonecommit — Generate commit messages
Reads your staged git diff and generates a Conventional Commits formatted message.
git add .
opsi commit # Preview the suggested message
opsi commit --commit # Generate and commit immediatelyOutput:
feat(auth): add JWT refresh token rotation
Implements automatic token rotation on refresh to reduce the risk of
stolen tokens being reused after expiry.docs — Documentation generation
opsi docs ./src/utils.js # Explain what a file does
opsi docs --update ./utils.js # Add JSDoc/docstrings to all functions
opsi docs --readme . # Generate a README.md for the projectscan — Security audit
Scans source files for hardcoded secrets, injection vulnerabilities, broken auth, and more.
Standard mode
Results are cached per file. Only files that changed since the last scan are sent to the AI.
opsi scan . # Scan current directory
opsi scan ./src # Scan a specific directory
opsi scan --deps # Scan dependencies (package.json, etc.)Output includes a security score (0–100) and findings grouped by severity: CRITICAL / HIGH / MEDIUM / LOW.
Fix mode (--fix)
The AI returns structured fixes with exact before/after code for each vulnerability. opsi shows a colored diff in the terminal and asks for confirmation before modifying any file.
opsi scan . --fix[!] Scanning codebase for security issues...
[-] Found 1 CRITICAL vulnerability: 1 CRITICAL
──────────────────────────────────────────────────
[CRITICAL] Hardcoded Secret Key (Line 12)
──────────────────────────────────────────────────
Before:
12 | const SECRET = "super-secret-key-12345";
After:
12 | require('dotenv').config();
13 | const SECRET = process.env.JWT_SECRET;
──────────────────────────────────────────────────
? Do you want opsi to automatically fix this issue? › (y/N)
[✓] Successfully updated ./src/auth.js
[ℹ] Backup saved to ./src/auth.js.opsi.bak
[ℹ] Remember to add JWT_SECRET to your .env fileA
.opsi.bakbackup is created automatically before each file is modified.
git — Git automation
A suite of interactive Git utilities that run entirely in the terminal — no need to remember flags or URLs.
--clone — Clone a repository
Prompts for a repository URL, an optional destination directory, and whether to use a custom SSH key. When a custom key is provided, it is passed via GIT_SSH_COMMAND so the clone uses that identity without touching your global SSH config.
opsi git --clone 📥 CLONE REPOSITORY
? Repository URL: › [email protected]:user/repo.git
? Destination directory (leave blank for default): ›
? Use a custom SSH key? › No
⠋ Cloning [email protected]:user/repo.git...
✔ Repository cloned successfully!
🎉 Clone complete!With a custom SSH key:
? Use a custom SSH key? › Yes
? Path to SSH private key: › ~/.ssh/id_deployThe key is used only for this clone — it does not modify
~/.ssh/configor any global git setting.
--upload — One-click deploy
Stages every changed file, walks you through a Semantic Commit type selector, commits, then pushes to the chosen remote. Automatically initialises the repo and prompts for a remote URL if neither exists yet.
opsi git --upload 🚀 UPLOAD WORKFLOW
✔ All changes staged.
? Select Semantic Commit type: › 🚀 feat — New feature
? Enter commit message: › add interactive git remote workflow
✔ Committed as "feat: add interactive git remote workflow"
? Select remote to push to: › origin https://github.com/user/repo.git
⠋ Pushing to origin/main...
✔ Pushed to origin/main successfully!
🎉 Upload complete!--pull / --push / --fetch — Interactive sync
All three commands open a remote selector first, then run the git operation against the chosen remote on the current branch.
opsi git --pull # select remote → git pull <remote> <branch>
opsi git --push # select remote → git push -u <remote> <branch>
opsi git --fetch # select remote → git fetch <remote>When only one remote is configured, the selector is skipped and the remote is used automatically.
--add-remote — Add a new remote
opsi git --add-remotePrompts for a name (default: origin) and URL, validates the name is not already taken, then runs git remote add.
--change-remote — Update a remote URL
opsi git --change-remoteShows a pick list of existing remotes (or auto-selects if only one), pre-fills the current URL so you can edit in place, then runs git remote set-url.
--purge-file <path> — Permanently erase from history
Completely removes a file or folder from every commit in the repository's history, then runs garbage collection to shrink the repo size. Use this to clean up accidentally committed secrets or large binaries.
opsi git --purge-file .env
opsi git --purge-file node_modulesIrreversible. After purging, run
git push --force --allto update the remote.
config — Manage settings
opsi config show # Show current config
opsi config set --key <key> # Set API key
opsi config set --model <model> # Change AI model
opsi config set --lang th # Switch to Thai (ภาษาไทย)
opsi config set --lang en # Switch to English
opsi config reset # Reset to defaults
opsi config cache # Show cache stats
opsi config cache-clear # Clear scan cacheCaching
opsi scan caches results per file in ~/.opsi/cache.json. On subsequent runs, only files that have changed are re-scanned — unchanged files return cached results instantly with no API call.
First run: 10 files → all sent to AI → results cached
Second run: 2 files changed → only 2 files re-scanned
Third run: nothing changed → instant results from cacheConfiguration
Config is stored at ~/.opsi/config.json.
| Key | Default | Description |
|------------|---------------------|----------------------------------|
| apiKey | null | Anthropic API key |
| model | claude-sonnet-4-6 | Claude model |
| provider | anthropic | AI provider |
| language | en | Response language (en or th) |
You can also provide the API key via environment variable:
export ANTHROPIC_API_KEY=sk-ant-xxxxLicense
MIT
