A command-line AI coding agent which can we run via Google's API key. Bog can autonomously inspect, read, edit, and execute code in a project through a tool-calling loop.
- File and directory listing
- File reading and writing
- Python file execution
- Iterative tool-use loop with the model (up to 20 iterations per prompt)
- Verbose mode for token usage and step tracing
- Path sandboxing — all operations are confined to a working directory
- Python 3
- Google Gemini API (
google-genai) uvfor dependency management
-
Clone the repository.
-
Create a
.envfile with your Gemini API key:GEMINI_API_KEY=your_key_here -
Install dependencies:
uv sync -
Change Gemini model from config.py
uv run main.py "your prompt here"
uv run main.py "your prompt here" --verbose
uv run main.py "list files in the calculator directory"uv run main.py "read main.py in calculator" --verboseuv run main.py "run tests.py"uv run main.py "write hello world to notes.txt"
main.py— entry point, agent loop, and message history managementcall_function.py— dispatches model tool calls to the correct functionfunctions/— tool implementations (get_files_info,get_file_content,run_python_file,write_file) and their Gemini function schemas
The test_agent/ folder contains a calculator subfolder with a small sample program you can use to see the full agent loop in action.
-
Open one of the files in
test_agent/calculator/and break the code. -
Run the agent and let it diagnose and fix the issue:
uv run main.py "fix the calculator for me" -
Use
--verboseto watch each tool call and token usage:uv run main.py "fix the calculator for me" --verbose
The agent will list the directory, read files, run the tests, edit the broken code, and re-run the tests to confirm the fix — all without any further input.