{"_id":"@abhisheksharma069/code-agent","name":"@abhisheksharma069/code-agent","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@abhisheksharma069/code-agent","version":"1.0.0","description":"Multi-provider coding agent CLI (Gemini, OpenAI, Anthropic)","type":"module","main":"./dist/cli/index.js","bin":{"code-agent":"bin/code-agent.js"},"engines":{"node":">=18"},"scripts":{"build":"tsc && chmod +x dist/cli/index.js bin/code-agent.js","start":"tsx cli/index.ts","dev":"tsx cli/index.ts","agent":"tsx cli/index.ts","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"keywords":["cli","coding-agent","gemini","openai","anthropic"],"author":{"name":"Abhishek Sharma","email":"abhisheksharma069x@gmail.com"},"license":"MIT","dependencies":{"@anthropic-ai/sdk":"^0.71.2","@google/genai":"^2.14.0","openai":"^7.1.0","prompts":"^2.4.2"},"devDependencies":{"@types/node":"^26.1.2","@types/prompts":"^2.4.9","tsx":"^4.23.1","typescript":"^7.0.2"},"gitHead":"64c446f04fc2c7d3ad3b1fd6868e963a0e34d316","types":"./dist/cli/index.d.ts","_id":"@abhisheksharma069/code-agent@1.0.0","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-AdtWoIkmryN8TDCLCn2kqnlPSOOCFjm0Dl+rxmbaMTEwh2zNs1aoUymxEKaa6aVPOVzi9+hwkzbHvsPS9vokgw==","shasum":"2379b9d5e590a1fe682afd314e30e9418492aa92","tarball":"https://registry.npmjs.org/@abhisheksharma069/code-agent/-/code-agent-1.0.0.tgz","fileCount":36,"unpackedSize":101736,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIA1hJ3KXN5iQqxfxl9UIUU0y3x+m1C7hLCiR0lOR8R9rAiBmVa7mm5dnW35yQzibwXGgM3TMPYtaIvy0bWqLgaFU8w=="}]},"_npmUser":{"name":"abhisheksharma069","email":"abhisheksharma069x@gmail.com"},"directories":{},"maintainers":[{"name":"abhisheksharma069","email":"abhisheksharma069x@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/code-agent_1.0.0_1785950460077_0.16329409232863723"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-05T17:20:59.946Z","1.0.0":"2026-08-05T17:21:00.234Z","modified":"2026-08-05T17:21:00.470Z"},"maintainers":[{"name":"abhisheksharma069","email":"abhisheksharma069x@gmail.com"}],"description":"Multi-provider coding agent CLI (Gemini, OpenAI, Anthropic)","keywords":["cli","coding-agent","gemini","openai","anthropic"],"author":{"name":"Abhishek Sharma","email":"abhisheksharma069x@gmail.com"},"license":"MIT","readme":"# code-agent\n\nA coding agent CLI for **Gemini**, **OpenAI**, and **Anthropic**.\n\nOpen a project folder, describe what you want in chat, and the agent plans changes, edits files, runs checks, and can write a summary. Switch providers anytime — keys stay on your machine.\n\n## Quick start\n\n```bash\n# 1. Install\nnpm install -g @abhisheksharma069/code-agent\n\n# 2. Save an API key (once)\ncode-agent auth login\n\n# 3. Open any project and chat\ncd /path/to/your-project\ncode-agent\n```\n\nThat is the full setup. No project `.env` for API keys.\n\n## Requirements\n\n- Node.js **18+**\n- An API key from at least one of:\n  - [Google AI Studio](https://aistudio.google.com/apikey) (Gemini)\n  - [OpenAI](https://platform.openai.com/api-keys)\n  - [Anthropic](https://console.anthropic.com/) (Claude)\n\n## Commands\n\n| Command | What it does |\n|---------|----------------|\n| `code-agent` | Start interactive chat in the **current directory** |\n| `code-agent auth login` | Paste and save a provider API key |\n| `code-agent auth status` | Show which providers are configured (keys masked) |\n| `code-agent auth logout [provider\\|--all]` | Remove stored key(s) |\n| `code-agent use <provider> [--model <id>]` | Set default provider/model |\n| `code-agent --provider <name> [--model <id>]` | One-session override |\n| `code-agent help` | Show CLI help |\n\nProviders: `gemini` · `openai` · `anthropic`\n\n### Examples\n\n```bash\ncode-agent use anthropic --model claude-sonnet-4-5\ncode-agent --provider openai --model gpt-4o-mini\ncode-agent auth logout gemini\ncode-agent auth logout --all\n```\n\n## How chat works\n\n1. `cd` into the project you want to change.\n2. Run `code-agent`.\n3. Type a request and press **Enter** to send.\n4. The agent uses tools (read/write files, run commands, etc.) and shows **colored diffs** when it edits files.\n5. Keep chatting in the same session, or start fresh with **Ctrl+N**.\n\nWorkspace = current working directory (unless you set `WORKSPACE_ROOT` or `workspaceRoot` in config).\n\n### Keyboard shortcuts\n\n| Key | Action |\n|-----|--------|\n| **Enter** | Send message |\n| **Shift+Enter** | New line (if your terminal ignores Shift+Enter, use **Alt+Enter** or **Ctrl+J**) |\n| **/** | Settings (change provider/model, auth status, help) |\n| **@** | Attach a file from the workspace |\n| **Ctrl+N** | New chat |\n| **Ctrl+R** | Clear chat history |\n| **?** | In-chat help |\n| **Ctrl+C** | Exit |\n\n## Where keys are stored\n\n| File | Purpose |\n|------|---------|\n| `~/.code-agent/credentials.json` | API keys (file mode `0600`) |\n| `~/.code-agent/config.json` | Default provider, models, optional workspace |\n\nOverride the config directory with `CODE_AGENT_HOME`.\n\n**Important:** Provider keys are **not** read from a project `.env`. Use `code-agent auth login` only.\n\n## Default models\n\n| Provider | Default |\n|----------|---------|\n| Gemini | `gemini-flash-latest` |\n| OpenAI | `gpt-4o-mini` |\n| Anthropic | `claude-sonnet-4-5` |\n\nChange them with `code-agent use …`, `--model`, or `/` → settings in chat.\n\n## What the agent can do\n\n- Scan the repo (tree, stack, important files)\n- Read and write files (diffs shown in the terminal)\n- Run shell commands and project scripts (lint / typecheck / test when available)\n- Write `AGENT_SUMMARY.md` when summarizing work\n\n## Troubleshooting\n\n| Problem | What to try |\n|---------|-------------|\n| Quota / rate limit (e.g. Gemini free tier) | Wait, change model in `/` settings, or `auth login` another provider |\n| Auth / invalid key | `code-agent auth login` again; check `auth status` |\n| Need retry details | `CODE_AGENT_VERBOSE=1 code-agent` |\n| Wrong folder edited | Run `code-agent` from the project root (workspace is `cwd`) |\n\n## Develop from source\n\n```bash\ngit clone <your-repo-url>\ncd Code-Agent\nnpm install\nnpm run build\nnpm link          # optional: install local binary globally\n```\n\n| Script | Command |\n|--------|---------|\n| Build | `npm run build` |\n| Dev run | `npm start` |\n| Typecheck | `npm run typecheck` |\n\n## License\n\nMIT © Abhishek Sharma\n","readmeFilename":"README.md","_rev":"1-4e2f7400adc5f6067ac97b58d216efec"}