Skip to main content

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.

Python 3.10+ Groq Llama 3.3 Cross-platform MIT License


๐Ÿ“‹ Table of Contents


๐Ÿ’ก 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-run flag to preview the full plan before executing anything
  • Docker sandbox mode for isolated execution
  • Local model support via Ollama
  • --platform override 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tagent_cli-0.1.0.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tagent_cli-0.1.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

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

Hashes for tagent_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f049cb5cce2b0a6f38c28ed5698a42d01ed8b4b3fa8d25657541315cd787bf88
MD5 12d90611d917f50af6523a4a2db297da
BLAKE2b-256 8a00bbd7ca2a16b21881f50021fb25e047f191dcea45d66879a35fe7fafa43ff

See more details on using hashes here.

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

Hashes for tagent_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c87e041b89ec95ee2fec4f71e9597bb22f92ef9e43053368eec8b89f1a67aec2
MD5 ce0f34e8c033b2c407e8b329456bc5fc
BLAKE2b-256 349fcf5da8cb2978ed7703b20afc5b2f70d92cec184a423eb0c9cb820901caf6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page