GemCLI: Autonomous AI coding agent with local web UI, Telegram remote control, and unlimited Gemini access — all from your terminal
Project description
GemCLI
Autonomous AI agent for your terminal. Free. No API keys. No subscriptions.
GemCLI is an open-source, autonomous AI agent that runs entirely from your terminal.
It writes code, automates your system, controls your browser, manages desktop applications,
generates images, and handles git workflows — all powered by Google Gemini with zero cost.
What Can It Do?
You: "Build me a Flask API with user authentication and deploy it locally"
You: "Open YouTube and search for lofi music"
You: "Find all Python files in this project that import requests and refactor them"
You: "Go to my Gmail and read the latest email"
You: "Switch VS Code to dark theme"
You: "Create a React component for a pricing table with three tiers"
You: "Commit everything with a good message and push to main"
GemCLI handles all of these autonomously. It reads your codebase, runs shell commands, navigates websites in a real browser, controls desktop applications, and reports back when done. No copy-pasting. No manual steps.
Why GemCLI
| Completely free | Uses Google Gemini's web interface. No API keys, no tokens, no billing. |
| 2-minute setup | pip install gemcli and you're running. |
| Actually autonomous | Doesn't just suggest code. It creates files, runs commands, opens browsers, and iterates until the task is done. |
| Browser automation | Opens a real Chromium browser, reads pages, clicks buttons, fills forms, manages tabs. |
| Desktop automation | Controls native Windows applications — focus windows, click UI elements, type text, change settings. |
| Code generation | Writes, reads, edits, and refactors code across your entire project. |
| System control | Runs shell commands, manages files, launches applications. |
| Web interface | Bundled local dashboard on localhost with session management, analytics, and dark/light themes. |
| Telegram remote | Send commands from your phone and receive live output. |
| Git integration | Auto-commit with AI-generated messages, push, branch management. |
| Undo everything | Every file change is backed up. Run /undo to revert instantly. |
| 100% local | No remote server. Your data and credentials never leave your machine. |
Installation
pip install gemcli[all]
That's it. Run gemcli to start.
For browser automation, also run:
playwright install chromium
Requirements
- Python 3.8 or higher
- A Google account signed into gemini.google.com
- Git (optional, for
/commit,/push,/status)
Quick Start
gemcli
- Select Connect to Gemini from the main menu
- Authenticate -- paste cookies manually, or use auto-capture (Selenium grabs them from your browser automatically)
- Pick a session -- start a new chat or continue a previous one
- Start building -- ask GemCLI to do anything
Authentication
GemCLI authenticates through browser cookies. No API key required. Your cookies are stored locally in .gemini_cookies.json and never leave your machine.
Auto-Capture (recommended): Run gemcli, connect to Gemini, and select "Auto-capture from browser." A browser window opens, you log in, and cookies are captured automatically.
Manual: Visit gemini.google.com, open DevTools (F12), go to Application > Cookies > https://gemini.google.com, and copy __Secure-1PSID (required) and __Secure-1PSIDTS (recommended). Paste into GemCLI when prompted.
Features
Autonomous Agent
Every message goes through a unified intelligent agent that decides what to do and executes it autonomously:
- Understand -- reads your prompt and plans the approach
- Act -- runs commands, creates files, navigates browsers, controls desktop apps
- Iterate -- loops through actions until the task is complete (up to 50 steps)
- Report -- gives you a clean summary of what it did
All file changes are backed up automatically. Run /undo at any time to revert.
Code Automation
GemCLI reads your entire project context and generates, edits, or refactors code with full awareness of your codebase.
"Add error handling to all the API endpoints in server.py"
"Create unit tests for the User model"
"Refactor this function to use async/await"
The agent creates files, modifies existing code, and runs your test suite to verify changes.
Browser Automation
GemCLI launches a visible Chromium browser and controls it like a human user -- clicking, typing, scrolling, and navigating across pages and tabs.
"Open YouTube and search for lofi music"
"Go to my Gmail and read the first email"
"Navigate to this Google Form and fill it out"
"Open Amazon and add wireless earbuds to my cart"
"Go to GitHub and create a new repository called test-project"
How it works: The AI reads the actual DOM of every page, identifies interactive elements (buttons, inputs, links), decides what to click or type, executes the action, then re-reads the page and decides the next step. Persistent login sessions mean you log in once and stay logged in.
# Setup
pip install playwright
playwright install chromium
Desktop Application Automation
GemCLI can control native Windows desktop applications -- focus windows, interact with UI elements, type into command palettes, and change application settings.
"Switch VS Code to the One Dark Pro theme"
"Open Notepad and type a quick note"
"Focus the calculator app and perform a calculation"
System Automation
Run any shell command, manage files, launch applications, and automate system tasks.
"List all large files over 100MB in this directory"
"Set up a Python virtual environment and install Flask"
"Find and kill the process running on port 3000"
Web Interface
A bundled browser-based dashboard served on localhost. No external dependencies -- pure HTML, CSS, and JavaScript.
- Session sidebar -- browse, switch, and delete sessions
- Real-time sync -- messages from CLI sessions appear automatically
- Dark and light mode with saved preference
- Analytics dashboard -- token usage, request counts, backup stats
- Remote control tab for Telegram bridge monitoring
- Launch from the CLI menu or visit
http://127.0.0.1:8765
Telegram Remote Control
Control GemCLI from your phone via a Telegram bot.
- Create a bot via @BotFather on Telegram
- Get your Chat ID from @userinfobot
- In GemCLI: main menu > Settings > Telegram Remote Control
- Enter your bot token and chat ID
Send text messages to the bot and they execute as GemCLI prompts. Receive real-time output on your phone.
Git Integration
Built-in git workflows with AI-generated commit messages.
/status View repository status
/commit Commit with an AI-generated message
/push Push to the remote repository
Undo System
Every file modification is backed up before changes are applied.
/undo Revert the last change-set
/undo 3 Revert the last 3 change-sets
/history View all recorded change-sets
Backups are stored in .gemcli/backups/ with timestamped directories.
Commands
All commands work inside any session:
| Command | Description |
|---|---|
/help |
Show all available commands |
/exit |
End the session and return to session list |
/clear |
Clear the terminal screen |
/undo [N] |
Revert the last N file change-sets (default: 1) |
/history |
View file modification timeline |
/recall <keyword> |
Search past conversations by keyword |
/export |
Export the current session to a Markdown file |
/summary |
Generate an AI-powered session recap |
/analytics |
Show token usage, request counts, and backup stats |
/status |
Display git repository status |
/commit |
Create a commit with an AI-generated message |
/push |
Push commits to the remote repository |
/view <path> |
Read and display a file with syntax highlighting |
/image <prompt> |
Generate an AI image from a text description |
Architecture
gemcli/
cli.py Entry point, session selection, authentication flow
agent.py Unified chat loop — handles all user interactions
autobot.py Autonomous JSON action executor
backup.py File backup and undo system
browser.py Autonomous browser agent — Playwright-based web control
desktop.py Desktop application automation — native UI control
client.py Gemini client initialization
config.py Centralized theme, preferences, and console
context.py Workspace context builder for AI prompts
cookies.py Cookie management — manual, saved, and auto-capture
git_ops.py Git integration — status, commit, push, branch selection
history.py Session history — logging, listing, search, export
mark_page.js DOM element annotator for browser agent
remote_monitor.py Telegram bridge monitor loop
settings.py Interactive settings menu
ui.py Rich-based terminal UI — banner, spinner, animated status
web.py Local HTTP server — REST API + static file serving
workspace.py File search and workspace scanning utilities
web_assets/
index.html Single-page web interface
styles.css Full design system — dark/light themes
app.js Client-side logic — sessions, chat, analytics
Configuration
Access from the main menu under Settings:
| Setting | Description |
|---|---|
| Theme | Cyan, Pink, Gold, Green, Purple, or White color schemes |
| Git | Toggle git integration, commit timing, auto-push, branch selection |
| Image | Set the save directory for AI-generated images |
| Telegram | Bot token, chat ID, workspace path, enable/disable bridge |
Settings are stored in .gemcli/settings.json.
Privacy and Security
| Question | Answer |
|---|---|
| Where are cookies stored? | Locally in .gemini_cookies.json in your working directory |
| Do cookies leave my machine? | No. Sent only to Google's Gemini servers |
| Is there a remote server? | No. 100% client-side |
| Should I share my cookies? | Never. Treat them like passwords |
Upgrading
pip install --upgrade gemcli
If upgrading from v1.x: the multi-mode selection (Chat / System Agent / AutoBot / Image Gen) has been replaced by a single unified agent that handles everything. Your existing .gemcli/ history directory is fully compatible.
Uninstall
pip uninstall gemcli
To also remove local data:
rm -rf .gemcli/
rm -f .gemini_cookies.json
License
MIT License -- see LICENSE for details.
Links
Built by 89P13
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gemcli-2.0.4.tar.gz.
File metadata
- Download URL: gemcli-2.0.4.tar.gz
- Upload date:
- Size: 1.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bed8834f7bd8b6e3e6c6ed4b467d2aa20fc5c99b9dc477ee61aff0704137b1dd
|
|
| MD5 |
cab60eaf5c218274acea3af0cbd80d99
|
|
| BLAKE2b-256 |
76c11657e7a582931c2e9f3c1abde3867baa2727584ab6b7662dd5363b8247af
|
File details
Details for the file gemcli-2.0.4-py3-none-any.whl.
File metadata
- Download URL: gemcli-2.0.4-py3-none-any.whl
- Upload date:
- Size: 1.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4fe5105c8e36fc94b856c17116c35de7e667348330d7cc4925f8ca62af52c094
|
|
| MD5 |
7bdeac7675b6ecc426ccb2f07df33d0b
|
|
| BLAKE2b-256 |
c1901b963fd4616f322ee337c017672d77ed41bbace1da9502ab6bc63ef7370f
|