# CodeGen-CLI - Coding Agent
[](https://pypi.org/project/codegen-cli/)
[](https://opensource.org/licenses/MIT)
A powerful command-line coding agent with **iterative reasoning** capabilities, inspired by Claude Code and Cursor CLI, powered by Google Gemini API. Published on PyPI for easy installation and updates.
> Your expert developer assistant that understands any codebase, never gets tired, and continuously learns from results.
**BYOK (Bring Your Own Key)**: This tool requires you to provide your own Google Gemini API key. CodeGen-CLI does not include or provide API keys. You are responsible for obtaining a key and managing your API usage and costs. Codegen works the best with a pro account!
## Requirements
- Python 3.10 or higher
- Google Gemini API key https://aistudio.google.com/api-keys
- Better if you upgrade to a pro account
## Key Features
- **Conversation Memory**: Maintains context across tasks - understands "that file", "the comment", "that function" from previous interactions
- **Auto-detection**: Automatically detects project type (Python, JS, Go, Rust, Java, C#, PHP, Ruby) and package managers (pip, poetry, npm, yarn, cargo, etc.)
- **Agentic Loop**: Iterative reasoning where agent sees results and adapts strategy for decision making
- **Tools Used**:
- **File operations**: read_file, write_file, edit_file, multi_edit, delete_file
- **Search & Discovery**: list_files (ls), find_files (glob), grep
- **Execution**: run_command (bash)
- **Task management**: manage_todos
- **Web helpers**: fetch_url, search_web
- **Safety First**: Filters risky folders (.env, secrets),asks for confirmation before destructive actions, clear error messages with recovery suggestions.
## API and Installation Guide
Get a Gemini API key from Google AI Studio and choose one of the following options
### Option 1: Use the --set-key command
```bash
codegen --set-key YOUR_API_KEY
```
This saves the key to `~/.config/codegen/.env` so it's available for all projects.
### Option 2: Project .env file
Create a .env file in your project root:
```bash
GEMINI_API_KEY=your_api_key
```
>There's a .env.example file for your reference in the project root. Make sure to add .env to your .gitignore file!
You can use the agent in both ways:
1. Package (PyPI) — users can install and run the published package:
```bash
pip install codegen-cli
codegen
```
2. Local (from source) — users can clone the repo and run it locally:
```bash
git clone https://github.com/vaishnavip-23/CodeGen-CLI.git
cd codegen-cli
python -m codegen_cli.main
```
Or run directly with uv:
```bash
uv run -m codegen_cli.main
```
## How to Use
Once in the REPL, you can:
Use natural language: "find all functions named test_*"
Use tool names directly: "read README.md", "grep 'TODO'"
Ask for help: Type "help" for guidance
## Commands
| Command | Description |
|---------|-------------|
| `help` | Show help information |
| `exit` or `Ctrl+C` | Exit the REPL |
| `codegen --version` | Show version |
| `codegen --check-update` | Check for updates |
| `codegen --set-key` | Save API key |
## License
This project uses the **MIT License**. See the `LICENSE` file for details.
*Inspired by Claude Code and Cursor CLI. Powered by Gemini API*
Raw data
{
"_id": null,
"home_page": null,
"name": "codegen-cli",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "CodeGen CLI Team <vaishnavipullakhandam@gmail.com>",
"keywords": "agent, ai, assistant, cli, code, coding, development, go, javascript, natural-language, programming, python, rust, universal",
"author": null,
"author_email": "CodeGen CLI Team <vaishnavipullakhandam@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/70/43/27768eaf8ac1cb3f03947c02501fe05dd3d478ceb73e5a410ea6d0a3d3de/codegen_cli-0.3.5.tar.gz",
"platform": null,
"description": "# CodeGen-CLI - Coding Agent\n[](https://pypi.org/project/codegen-cli/)\n[](https://opensource.org/licenses/MIT)\nA powerful command-line coding agent with **iterative reasoning** capabilities, inspired by Claude Code and Cursor CLI, powered by Google Gemini API. Published on PyPI for easy installation and updates.\n> Your expert developer assistant that understands any codebase, never gets tired, and continuously learns from results.\n\n**BYOK (Bring Your Own Key)**: This tool requires you to provide your own Google Gemini API key. CodeGen-CLI does not include or provide API keys. You are responsible for obtaining a key and managing your API usage and costs. Codegen works the best with a pro account!\n\n## Requirements\n- Python 3.10 or higher\n- Google Gemini API key https://aistudio.google.com/api-keys\n- Better if you upgrade to a pro account\n\n## Key Features\n- **Conversation Memory**: Maintains context across tasks - understands \"that file\", \"the comment\", \"that function\" from previous interactions\n- **Auto-detection**: Automatically detects project type (Python, JS, Go, Rust, Java, C#, PHP, Ruby) and package managers (pip, poetry, npm, yarn, cargo, etc.)\n- **Agentic Loop**: Iterative reasoning where agent sees results and adapts strategy for decision making\n- **Tools Used**: \n - **File operations**: read_file, write_file, edit_file, multi_edit, delete_file\n - **Search & Discovery**: list_files (ls), find_files (glob), grep\n - **Execution**: run_command (bash)\n - **Task management**: manage_todos\n - **Web helpers**: fetch_url, search_web\n- **Safety First**: Filters risky folders (.env, secrets),asks for confirmation before destructive actions, clear error messages with recovery suggestions.\n\n## API and Installation Guide\nGet a Gemini API key from Google AI Studio and choose one of the following options\n### Option 1: Use the --set-key command\n```bash\ncodegen --set-key YOUR_API_KEY\n```\nThis saves the key to `~/.config/codegen/.env` so it's available for all projects.\n### Option 2: Project .env file\nCreate a .env file in your project root:\n```bash\nGEMINI_API_KEY=your_api_key\n```\n>There's a .env.example file for your reference in the project root. Make sure to add .env to your .gitignore file!\n\nYou can use the agent in both ways:\n\n1. Package (PyPI) \u2014 users can install and run the published package:\n```bash\npip install codegen-cli\ncodegen\n```\n2. Local (from source) \u2014 users can clone the repo and run it locally:\n```bash\ngit clone https://github.com/vaishnavip-23/CodeGen-CLI.git\ncd codegen-cli\npython -m codegen_cli.main\n```\nOr run directly with uv:\n```bash\nuv run -m codegen_cli.main\n```\n## How to Use\nOnce in the REPL, you can:\n\nUse natural language: \"find all functions named test_*\"\nUse tool names directly: \"read README.md\", \"grep 'TODO'\"\nAsk for help: Type \"help\" for guidance\n\n## Commands\n\n| Command | Description |\n|---------|-------------|\n| `help` | Show help information |\n| `exit` or `Ctrl+C` | Exit the REPL |\n| `codegen --version` | Show version |\n| `codegen --check-update` | Check for updates |\n| `codegen --set-key` | Save API key |\n\n## License\nThis project uses the **MIT License**. See the `LICENSE` file for details.\n\n*Inspired by Claude Code and Cursor CLI. Powered by Gemini API*",
"bugtrack_url": null,
"license": "MIT",
"summary": "Command-line coding agent with iterative reasoning, inspired by Claude Code and Cursor CLI, powered by Google Gemini API.",
"version": "0.3.5",
"project_urls": {
"Documentation": "https://github.com/vaishnavip-23/CodeGen-CLI/blob/main/docs/README.md",
"Homepage": "https://github.com/vaishnavip-23/CodeGen-CLI",
"Repository": "https://github.com/vaishnavip-23/CodeGen-CLI"
},
"split_keywords": [
"agent",
" ai",
" assistant",
" cli",
" code",
" coding",
" development",
" go",
" javascript",
" natural-language",
" programming",
" python",
" rust",
" universal"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "4d76160a9e84f1d818646319647b222c6e2cd5e11965c20c73f89b9a98653967",
"md5": "76722c508376320f60dfe50b6be52dc0",
"sha256": "1184bc9274b8a2327d7f98f66f0edd797348e8681c38d0e7ef38ab2a3ad9d582"
},
"downloads": -1,
"filename": "codegen_cli-0.3.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "76722c508376320f60dfe50b6be52dc0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 60601,
"upload_time": "2025-10-06T08:26:06",
"upload_time_iso_8601": "2025-10-06T08:26:06.341605Z",
"url": "https://files.pythonhosted.org/packages/4d/76/160a9e84f1d818646319647b222c6e2cd5e11965c20c73f89b9a98653967/codegen_cli-0.3.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "704327768eaf8ac1cb3f03947c02501fe05dd3d478ceb73e5a410ea6d0a3d3de",
"md5": "8a15159a768163abd1eb23b313bb0068",
"sha256": "80239f63f6c75a9e8a14ecf5b22946b60bd9f6de09efdf951d01069c8e90f479"
},
"downloads": -1,
"filename": "codegen_cli-0.3.5.tar.gz",
"has_sig": false,
"md5_digest": "8a15159a768163abd1eb23b313bb0068",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 46791,
"upload_time": "2025-10-06T08:26:09",
"upload_time_iso_8601": "2025-10-06T08:26:09.824204Z",
"url": "https://files.pythonhosted.org/packages/70/43/27768eaf8ac1cb3f03947c02501fe05dd3d478ceb73e5a410ea6d0a3d3de/codegen_cli-0.3.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-06 08:26:09",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "vaishnavip-23",
"github_project": "CodeGen-CLI",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "codegen-cli"
}