Skip to content

adi-2254/cli-coding-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CLI Coding Agent πŸ€–

A lightweight, autonomous AI agent that runs in your terminal. It uses OpenAI's GPT-4o and Pydantic structured outputs to create folders, write Python code, and manage software projects autonomously based on simple text commands.

Status Python OpenAI

🌟 Features

  • Autonomous File Management: Can create directories and subdirectories (make_directory).
  • Code Generation: Writes full, executable Python files (create_file).
  • Self-Correction: Can read files (read_file) to check its own work or debug errors.
  • Structured Thinking: Uses a strict "Thought -> Action -> Result" loop to prevent hallucinations.
  • Safe Execution: Checks if directories exist before writing files to prevent crashes.

πŸ› οΈ Tech Stack

  • Core Logic: Python
  • AI Model: OpenAI GPT-4o-mini (via openai SDK)
  • Data Validation: Pydantic (BaseModel)
  • Environment Management: python-dotenv

πŸš€ Installation & Setup

  1. Clone the Repository

    git clone [https://github.com/YOUR_USERNAME/cli-coding-agent.git](https://github.com/YOUR_USERNAME/cli-coding-agent.git)
    cd cli-coding-agent
  2. Create a Virtual Environment (Optional but Recommended)

    python -m venv venv
    # Windows
    venv\Scripts\activate
    # Mac/Linux
    source venv/bin/activate
  3. Install Dependencies

    pip install -r requirements.txt
  4. Set Up API Key

    • Create a file named .env in the root folder.
    • Add your OpenAI API key:
      MY_API_KEY=sk-proj-xxxxxxxxxxxxxxxxxxxx
      

πŸ’» Usage

Run the agent from your terminal:

python coder.py

About

A CLI-based AI Agent that uses OpenAI and Pydantic to autonomously write code, manage directories, and build software projects.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages