Dhruv CLI
Install
npm install -g @rahul05ranjan/dhruv-cli
Also available on npm.
Usage Examples
dhruv suggest "deploy react app to vercel"
dhruv explain "git rebase vs merge"
dhruv fix "cors error in express"
dhruv review src/
dhruv optimize package.json
dhruv security-check src/
dhruv generate tests src/utils/helpers.js
dhruv init
dhruv completion bash > dhruv-complete.sh
All Commands
- suggest
<query>— Smart suggestions for any dev task - explain
<query>— Explain concepts, errors, or commands - fix
<query>— Get AI-powered fixes for errors - review
<fileOrDir>— Review code for improvements - optimize
<file>— Optimize files (e.g.,package.json) - security-check
[fileOrDir]— Security analysis of code - generate
<type> <target>— Generate code/tests - init — Interactive setup/configuration wizard
- completion
[shell]— Output shell completion script - project-type — Detect project type
- hello-plugin — Example plugin command
Plugin Example
export default (program) => {
program.command('hello-plugin').action(() => console.log('Hello from plugin!'));
};
- Add new commands by dropping ESM modules in the
plugins/directory. - Plugins are loaded automatically before CLI parsing.
Open Source & Community
Dhruv CLI is fully open source and welcomes contributions!
GitHub Repo Issues Pull Requests Contributing GuideConfiguration & Context
- Run
dhruv initto set model, response format, and verbosity. - Project type is auto-detected for context-aware suggestions.
- Works offline with local Ollama models.