# claude-cli.nvim **Repository Path**: yeahnoob/claude-cli.nvim ## Basic Information - **Project Name**: claude-cli.nvim - **Description**: No description available - **Primary Language**: Lua - **License**: GPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-08-24 - **Last Updated**: 2025-08-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # claude-cli.nvim A Neovim plugin for seamless integration with Claude CLI and Claude Cost tracking. ## ✨ Features - **Floating Terminal Integration** - Clean, modern floating terminal for Claude CLI - **Context-Aware Commands** - Send current file or selection to Claude - **Cost Tracking** - Integrated with claude-cost for balance monitoring - **Multiple Provider Support** - Support for Kimi, OpenAI, and Anthropic - **Telescope Integration** - Command picker via Telescope - **LazyVim Compatible** - Fully integrated with LazyVim plugin manager ## 📦 Installation ### [LazyVim](https://github.com/LazyVim/LazyVim) Add to your `~/.config/nvim/lua/plugins/claude.lua`: ```lua return { { "your-username/claude-cli.nvim", dependencies = { "akinsho/toggleterm.nvim", "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim", }, keys = { { "cc", function() require("claude-cli").open_claude_terminal() end, desc = "Open Claude CLI" }, { "ca", function() require("claude-cli").claude_with_context() end, desc = "Claude with file context" }, { "cs", function() require("claude-cli").claude_with_selection() end, desc = "Claude with selection", mode = { "v" } }, { "cb", function() require("claude-cli").check_balance() end, desc = "Check Claude balance" }, { "cp", function() require("claude-cli").claude_picker() end, desc = "Claude CLI Picker" }, }, opts = {}, }, } ``` ### [packer.nvim](https://github.com/wbthomason/packer.nvim) ```lua use { 'your-username/claude-cli.nvim', requires = { 'akinsho/toggleterm.nvim', 'nvim-telescope/telescope.nvim', 'nvim-lua/plenary.nvim', }, config = function() require('claude-cli').setup({}) end } ``` ## ⚙️ Configuration ```lua require("claude-cli").setup({ -- Claude CLI command (default: auto-detect) claude_cmd = "claude", -- Claude cost command (default: auto-detect) cost_cmd = "claude-cost", -- Default provider for cost checking default_provider = "kimi", -- Terminal options terminal = { direction = "float", float_opts = { border = "rounded", width = 0.8, height = 0.8, }, }, }) ``` ## ⌨️ Key Bindings | Key | Description | |-----|-------------| | `cc` | Open Claude CLI terminal | | `ca` | Claude with current file context | | `cs` | Claude with visual selection | | `cb` | Check account balance | | `cp` | Command picker via Telescope | ## 🛠️ Commands | Command | Description | |---------|-------------| | `:Claude [args]` | Run Claude CLI with arguments | | `:ClaudeCost [provider]` | Check balance for provider | | `:ClaudeContext` | Analyze current file | | `:ClaudeSelection` | Analyze selected text | ## 📋 Requirements - **Neovim** 0.7+ - **Claude CLI** installed and in PATH - **claude-cost** (optional, for balance tracking) - **toggleterm.nvim** (for terminal integration) - **telescope.nvim** (for command picker) ## 🔧 Setup 1. Install Claude CLI: ```bash npm install -g @anthropic-ai/claude-cli ``` 2. Install claude-cost (optional): ```bash # Copy claude-cost script to your PATH chmod +x claude-cost sudo cp claude-cost /usr/local/bin/ ``` 3. Set environment variables: ```bash export ANTHROPIC_API_KEY="your-key-here" # or for claude-cost export MOONSHOT_API_KEY="your-key-here" ``` ## 🚀 Usage Examples ### Basic Usage ```vim :Claude :ClaudeCost kimi ``` ### With Context ```vim :ClaudeContext :ClaudeSelection ``` ### Custom Commands ```vim :Claude --help :ClaudeCost openai ``` ## 🤝 Contributing Contributions are welcome! Please feel free to submit a Pull Request. ## 📄 License MIT License - see [LICENSE](LICENSE) for details.