A plain-English terminal agent that plans and runs shell commands for you.
Project description
๐ฅ๏ธ terminal-agent
A plain-English terminal agent. Tell it what you want done โ it plans the shell commands, runs them, and adapts based on what happens. No more copy-pasting commands out of a chatbot.
๐ Table of Contents
- Why this exists
- How it works
- Safety model
- Install
- Usage
- Cross-platform support
- Project structure
- Limitations
- Roadmap
- Author
๐ก Why this exists
Copy-pasting shell commands out of an LLM chat window into your terminal is slow, breaks your flow, and is easy to get wrong. terminal-agent closes that loop:
You: "set up docker"
โ
Agent proposes a command โ you approve (if risky) โ it runs โ output feeds back
โ
Agent decides the next step, or says it's done
No copy-paste. No context-switching between a chat tab and your terminal.
โ๏ธ How it works
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ
โ Your task โ โโโโถ โ agent.py โ โโโโถ โ executor.py โ
โ (plain text) โ โ (asks LLM โ โ (runs command โ
โโโโโโโโโโโโโโโ โ for next โ โ safely) โ
โ command) โ โโโโโโโโโฌโโโโโโโโ
โโโโโโโโฒโโโโโโโโ โ
โ output โ
โโโโโโโโโโโโโโโโโโโโโโโโโโ
(loops until task is done,
or 12-step safety cap is hit)
The agent never runs blind โ every command passes through a safety classifier before execution.
๐ก๏ธ Safety model
Every command gets classified into one of three tiers before it runs:
| Tier | Behavior | Example commands |
|---|---|---|
| ๐ข AUTO | Runs immediately | ls, cat, docker --version, dir |
| ๐ก CONFIRM | Asks before running | sudo, rm, chmod, del, git push --force |
| ๐ด BLOCKED | Never runs โ no override | rm -rf /, format c:, fork bombs |
A hard 12-step limit per task also prevents runaway loops.
๐ฆ Install
git clone https://github.com/AnuragBel/terminal-agent.git
cd terminal-agent
Get a free Groq API key โ console.groq.com
cp .env.example .env # then paste your key into .env
See Cross-platform support below for OS-specific setup.
๐ Usage
tagent "check disk usage and list the top 5 largest folders in home"
Task: check disk usage and list the top 5 largest folders in home
[AUTO] du -h --max-depth=1 ~ | sort -rh | head -5
reason: list top 5 largest folders by size
/home/user/Downloads 4.2G
/home/user/Projects 1.8G
...
โ Done โ Found and listed the 5 largest folders in your home directory.
Auto-approve CONFIRM-tier steps (use with care):
tagent "install nodejs and check the version" --yes
๐ Cross-platform support
The agent auto-detects the OS at runtime and adjusts its command vocabulary and safety patterns accordingly โ one codebase, no manual flags needed.
| WSL Ubuntu | Native Ubuntu | Native Windows | |
|---|---|---|---|
| Create venv | python3 -m venv venv |
python3 -m venv venv |
python -m venv venv |
| Activate | source venv/bin/activate |
source venv/bin/activate |
venv\Scripts\activate |
| Install | pip install -e . |
pip install -e . |
pip install -e . |
| Env file | cp .env.example .env |
cp .env.example .env |
copy .env.example .env |
| Agent proposes | df -h, ls |
df -h, ls |
dir, wmic |
Each environment needs its own
venv/and.envโ these aren't shared across OSes.
๐๏ธ Project structure
terminal-agent/
โโโ terminal_agent/
โ โโโ __init__.py
โ โโโ agent.py # LLM decision loop + OS auto-detection
โ โโโ executor.py # 3-tier safety-gated command execution
โ โโโ cli.py # tagent entry point
โโโ pyproject.toml # pip-installable packaging
โโโ .env.example
โโโ README.md
โ ๏ธ Limitations
- Requires an internet connection (cloud LLM via Groq โ no local model support yet)
- CONFIRM/BLOCKED detection is pattern-based, not exhaustive โ always read a command before approving it
- Tested primarily on WSL2 Ubuntu; native Windows and native Ubuntu support is newer and less battle-tested
๐บ๏ธ Roadmap
-
--dry-runflag to preview the full plan before executing anything - Docker sandbox mode for isolated execution
- Local model support via Ollama
-
--platformoverride flag for edge cases (e.g. WSL running Windows-style commands)
๐ค Author
Anurag Belgudri โ Agentic AI Engineer Intern @ Entra Innovation GitHub ยท LinkedIn
Built as a hands-on exploration of agentic AI systems โ LLM decision loops, tool use, and safety-first automation.
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 tagent_cli-0.1.0.tar.gz.
File metadata
- Download URL: tagent_cli-0.1.0.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f049cb5cce2b0a6f38c28ed5698a42d01ed8b4b3fa8d25657541315cd787bf88
|
|
| MD5 |
12d90611d917f50af6523a4a2db297da
|
|
| BLAKE2b-256 |
8a00bbd7ca2a16b21881f50021fb25e047f191dcea45d66879a35fe7fafa43ff
|
File details
Details for the file tagent_cli-0.1.0-py3-none-any.whl.
File metadata
- Download URL: tagent_cli-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c87e041b89ec95ee2fec4f71e9597bb22f92ef9e43053368eec8b89f1a67aec2
|
|
| MD5 |
ce0f34e8c033b2c407e8b329456bc5fc
|
|
| BLAKE2b-256 |
349fcf5da8cb2978ed7703b20afc5b2f70d92cec184a423eb0c9cb820901caf6
|