Skip to content

Terminal based AI agent. Giving LLM the power to modify my files, run arbitrary codes generated by it .

Notifications You must be signed in to change notification settings

SHresTho12/ai-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ai-agent

📌 Overview

This project is an AI-powered coding assistant built on top of Google’s Gemini API.
The assistant is designed to operate in a restricted working directory (currently set to calculator/).
Within this sandboxed environment, it can:

  • List files and directories
  • Read file contents
  • Create or edit files
  • Execute Python files

This makes it useful for interactive coding tasks, debugging, and project management while ensuring safe, controlled access to the filesystem.


📂 Project Structure

├── calculator/ # Current working directory (sandbox)
│ ├── lorem.txt
│ ├── main.py
│ ├── pkg/
│ │ ├── calculator.py
│ │ ├── morelorem.txt
│ │ ├── render.py
│ ├── README.md
│ └── tests.py
│
├── functions/ # Contains tool definitions and executors
│ ├── function_executor.py
│ ├── get_files_info.py
│ ├── run_python.py
│
├── schemas/ # Function schemas for LLM tools
│
├── main.py # Entry point for running the assistant
├── requirements.txt # Python dependencies
├── README.md # Project documentation (this file)
└── tests.py # Top-level tests

⚙️ Setup

1. Clone Repository

git clone <your-repo-url>
uv venv ai-agent ## I have used uv you can use any other tool to create virtual environment
cd ai-agent

source venv/bin/activate
  1. Install Dependencies
uv pip install -r requirements.txt

Make sure you have Python 3.9+.

  1. Environment Variables

Create a .env file in the project root:

GEMINI_API_KEY=your_api_key_here

🚀 Usage

Run Assistant

python main.py "your prompt here"

Example:

python main.py "List all files in the project"

Verbose Mode

Enable detailed logging:

python main.py "Read main.py" --verbose

🔒 Restricted Workspace

The assistant is restricted to the calculator/ folder by default. You can change the working directory to another safe location if required.

This ensures the LLM only operates within a controlled environment and cannot access system files outside the sandbox.

Features

🗂 File exploration (list, read, create, edit)

🐍 Execute Python scripts with arguments

🔁 Iterative conversation until completion

🛡️ Safe restricted workspace

📌 Notes

This project is an early prototype (v1.0) and may evolve with new tools. The assistant is not a general-purpose shell — it is limited to the functions explicitly defined in the functions/ module.

About

Terminal based AI agent. Giving LLM the power to modify my files, run arbitrary codes generated by it .

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages