Skip to main content

Command-line coding agent with iterative reasoning, inspired by Claude Code and Cursor CLI, powered by Google Gemini API.

Project description

CodeGen-CLI - Coding Agent

PyPI License: 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

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
  • Structured Responses: Uses Pydantic for structured input and outputs
  • 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

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:

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:
pip install codegen-cli
codegen
  1. Local (from source) — users can clone the repo and run it locally:
git clone https://github.com/vaishnavip-23/CodeGen-CLI.git
cd codegen-cli
python -m codegen_cli.main

Or run directly with uv:

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 or codegen 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codegen_cli-0.5.0.tar.gz (54.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codegen_cli-0.5.0-py3-none-any.whl (68.5 kB view details)

Uploaded Python 3

File details

Details for the file codegen_cli-0.5.0.tar.gz.

File metadata

  • Download URL: codegen_cli-0.5.0.tar.gz
  • Upload date:
  • Size: 54.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for codegen_cli-0.5.0.tar.gz
Algorithm Hash digest
SHA256 b06cb2a0fdd926f0dd3c4289213e9efbae41c8c271db042d43945e6a147952f6
MD5 6df21d6df057758ae992baf51ad0dedb
BLAKE2b-256 a829208334e9c0da75612a2935b0477e2c66a8ff1f1dcab4d1101165a0d07a3e

See more details on using hashes here.

File details

Details for the file codegen_cli-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: codegen_cli-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 68.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for codegen_cli-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8c61217fca3bc7fcc291740b51fe65c0245a5ae20f3fd43c6526f7cf911d6b74
MD5 83d88e10556951687327f5bff6613218
BLAKE2b-256 3e1d4d0a490453b820a96603f78fa993d68a743b47e03f8bc72edcb4fef33f74

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page