Skip to main content

TONI — Terminal Operation Natural Instruction

Describe in plain English, get a shell command. Gemini OpenAI Mistral DeepSeek Ollama Groq … one ~/.toni via litellm.

PyPI version PyPI Downloads Python 3.10+ License: MIT GitHub Stars

TONI demo: translating natural language into shell commands

TONI is a lightweight CLI that translates natural language into terminal commands — system-aware (Linux/macOS/Windows), verifies the binary exists, and optionally executes.

Inspiration

TONI was inspired by YAI (Yet Another Interpreter), but with a focused approach. While YAI offers a comprehensive terminal experience, TONI is designed specifically to suggest and execute single commands based on natural language descriptions.

Features

  • Translates natural language to terminal commands
  • Unified LLM via litellm: single entry point for 100+ providers (OpenAI, Gemini, Mistral, DeepSeek, OpenRouter, Ollama, Groq, etc.) — no per-provider boilerplate
  • Cross-platform: Works on Linux, macOS, and Windows
  • System-aware: Detects your OS and generates platform-appropriate commands
  • Verifies command availability before execution
  • Saves executed commands to shell history (ZSH on Unix, custom history on Windows)
  • Simple to use and install

Installation

# Install from PyPI
pip install toni-cli

# Or with pipx (recommended)
pipx install toni-cli

Windows Installation

TONI works on Windows via pip or pipx:

# Using pip
pip install toni-cli

# Or with pipx (recommended)
pipx install toni-cli

Note: On Windows, TONI generates Windows-native commands (CMD/PowerShell) and saves command history to ~/.toni_history.

Usage

Simply type toni followed by your natural language description:

# Basic file operations
toni list all pdf files in current directory
toni find all files modified in the last 7 days

# System queries
toni show my disk usage
toni what processes are using the most memory

# Complex tasks
toni create a backup of my Documents folder
toni find the largest files in this directory

Examples

Linux/macOS

$ toni find all python files containing the word "error"

Detected system: Linux (arch)
Suggested command: grep -r "error" --include="*.py" .
Explanation: Search recursively for the word "error" in all Python files in the current directory
Do you want to execute this command? (y/n):

Windows

> toni find all python files containing the word "error"

Detected system: Windows 10 (10.0.19045)
Suggested command: findstr /s /i "error" *.py
Explanation: Search for "error" in all Python files recursively
Do you want to execute this command? (Y/n):

Configuration

TONI uses a configuration file at ~/.toni (INI format) and env vars. Since 0.1.23 all providers are routed through litellm — one completion() call for 100+ models, no per-provider boilerplate. Old ~/.toni files remain fully compatible.

Built-in Providers

Defaults (override in ~/.toni or env):

Provider Model default Env var Priority
GEMINI gemini-2.0-flash GOOGLEAI_API_KEY 40
OPENAI gpt-4o-mini OPENAI_API_KEY 50
MISTRAL mistral-small-latest MISTRAL_API_KEY 30
DEEPSEEK deepseek-v4-flash DEEPSEEK_API_KEY 25
OPENROUTER openrouter/free OPENROUTER_API_KEY 50
export GOOGLEAI_API_KEY='your-gemini-api-key'
export OPENAI_API_KEY='your-openai-api-key'
export MISTRAL_API_KEY='your-mistral-api-key'

Per-provider ~/.toni overrides:

[GEMINI]
model=gemini-2.5-flash-lite
priority=40

[OPENAI]
model=gpt-4o-mini
priority=50

Custom Providers (litellm)

Any section with url is treated as an OpenAI-compatible endpoint (model → openai/<model> + api_base=url). Built-ins map to litellm prefixes (gemini/, openai/, mistral/, deepseek/, openrouter/).

Example: Ollama (local)

[ollama]
url = http://localhost:11434/v1
key = ollama
model = llama3.2:latest
priority = 100

Example: Groq / OpenRouter / custom gateway

[groq]
url = https://api.groq.com/openai/v1
model = llama-3.1-8b-instant
env-key = GROQ_API_KEY
priority = 90

[openrouter]
url = https://openrouter.ai/api/v1
key = sk-or-v1-xxx...
model = anthropic/claude-3.5-sonnet
priority = 80

Priority & Fallback

  • All providers (custom + native) are merged and tried in priority descending (higher first, default 50).
  • disabled=true skips a provider; failure falls through to next.
  • env-key lets a section read its key from a custom env var (e.g. env-key=GROQ_API_KEY).

Environment Variables

For any custom provider [my-provider], you can set the key via:

export MY_PROVIDER_API_KEY='your-key'

or env-key in the INI. GOOGLEAI_API_KEY is also accepted for GEMINI.

Development

To contribute to TONI:

git clone https://github.com/Dakai/toni.git
cd toni
  • Create a virtual environment:
python -m venv venv
source venv/bin/activate
  • Install for development:
pip install -e .
  • Make your changes and submit a pull request!

License

MIT

Acknowledgements

  • YAI for the inspiration
  • BerriAI/litellm for the unified LLM gateway
  • Google Gemini, OpenAI, Mistral, DeepSeek for their APIs

Metadata

Release files for toni-cli 0.1.30

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for toni-cli 0.1.30
File Size Uploaded Provenance Actions
toni_cli-0.1.30.tar.gz 16.4 kB Without provenance Details for toni_cli-0.1.30.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for toni-cli 0.1.30
File Interpreter ABI Platform Actions
toni_cli-0.1.30-py3-none-any.whl Python 3 none any Details for toni_cli-0.1.30-py3-none-any.whl

Total release size: 31.2 kB

Release files / toni_cli-0.1.30.tar.gz

Download URL toni_cli-0.1.30.tar.gz
Size 16.4 kB
Tags Source
SHA-256 checksum
How to use checksums
833d6bf1831ad3fb20e8843c3994a8b17fa8b3948eda9ce73348093c9f245597
BLAKE2b-256 checksum
How to use checksums
56684b5030887cd861afb553d1ac03bd340ad6da429103ed90001e306737176e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / toni_cli-0.1.30-py3-none-any.whl

Download URL toni_cli-0.1.30-py3-none-any.whl
Size 14.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0d6df20c4dfebddedbf9f4c294976c327de3000d7b138a20ce6e88628cb94818
BLAKE2b-256 checksum
How to use checksums
38f48f2932af9113ad16ff6724f7c8c22263939629dcea0fa9a74a94f13b1ba9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Security for toni-cli 0.1.30

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page