AgentAI is a simple CLI agent that uses Google AI gemini-2.0-flash-001 model to perform various file and code operations through natural language commands.
- 📁 List files and directories
- 📖 Read file contents
- 🐍 Execute Python files with optional arguments
- ✍️ Write or overwrite files
- 🗣️ Natural language interaction via CLI
AgentAI CLI was coded in semi-guided project from the Boot.dev course. Special thanks to the Boot.dev team for the excellent guided projects and learning materials!
- Python 3.10+
- uv package manager
-
Clone the repository:
git clone https://github.com/Jazzman94/agentai.git cd agentai -
Install dependencies:
uv sync
If you don't have uv installed, install it with:
pip install uv -
Set up API key:
- Create your API key in Google AI Studio
- Create a
.envfile in the root directory:
GEMINI_API_KEY=your_api_key_here
-
Test installation:
python main.py "Hello world!" --verbose
# Basic interaction
python main.py "List all Python files in the current directory"
# Verbose mode for detailed output
python main.py "Read the contents of lorem.txt" --verbose
# File operations
python main.py "Create a new file called test.py with a hello world function"
# Code execution
python main.py "Run the calculator.py file with argument 5"The agent's behavior is controlled by the prompts.system_prompt variable, which defines the CLI agent's purpose and capabilities.
Important configuration parameters in config.py:
MAX_CHARS = 10000 # Maximum characters per message
WORKING_DIR = "./calculator" # Working directory for operations
MAX_ITERS = 20 # Maximum iterations in single requestFeel free to adjust these values based on your needs:
- Change
WORKING_DIRto point to your desired working directory - Modify
MAX_CHARSto allow longer/shorter messages - Adjust
MAX_ITERSfor more complex operations
Don't hesitate to experiment! Here's how to test the agent's full potential:
-
Create a new working directory:
mkdir example
-
Update configurateion
# In config.py WORKING_DIR = "./example"
-
Run a complex task
- Run for example following:
python main.py "Create a simple REST API server using FastAPI framework with simple GET, POST, PUT, DELETE endpoints. Write down a manual how to run it and test it properly. Provide me a list of needed packages to install."agentai/
├── main.py # Entry point
├── config.py # Configuration settings
├── prompts.py # System prompts
├── .env # API keys (create this)
├── pyproject.toml # Dependencies
└── README.md
- Boot.dev for the excellent AI agent course
- Google AI team for the Gemini API
⭐ If you find this project helpful, please give it a star on GitHub!