AI-powered terminal assistant that generates shell commands from natural language.
Project description
tutr - Terminal Utility for Con(T)extual Responses
A stupid simple, AI-powered terminal assistant that generates commands from natural language.
What does it do?
Generates terminal commands from natural language queries.
> tutr git create and switch to a new branch called testing
git checkout -b testing
> tutr go back to the previous directory
cd -
Installation
Requires Python 3.10+.
git clone https://github.com/spi/tutr.git
cd tutr
uv sync
Setup
On first run, tutr launches an interactive setup to select your provider, model, and API key:
$ tutr git "show recent commits"
Welcome to tutr! Let's get you set up.
Select your LLM provider:
1. Gemini
2. Anthropic
3. OpenAI
4. Ollama (local, no API key needed)
Enter choice (1-4): 1
Enter your Gemini API key:
API key:
Select a model:
1. Gemini 3 Flash (recommended)
2. Gemini 2.0 Flash
3. Gemini 2.5 Pro
Enter choice (1-3): 1
Configuration saved to ~/.tutr/config.json
Setup is skipped if ~/.tutr/config.json already exists or provider API key environment variables are set.
Usage
tutr <command> <what you want to do>
Examples
tutr git "create and switch to a new branch called testing"
tutr sed "replace all instances of 'foo' with 'bar' in myfile.txt"
tutr curl "http://example.com and display all request headers"
Arguments
| Argument | Description |
|---|---|
command |
The terminal command to get help with (e.g., git, sed, curl) |
query |
What you want to do, in natural language |
Options
| Flag | Description |
|---|---|
-h, --help |
Show help message |
-V, --version |
Show version |
-d, --debug |
Enable debug logging |
-e, --explain |
Show LLM explanation and source for the generated command |
Configuration
Config is stored in ~/.tutr/config.json. Environment variables override the config file.
| Environment Variable | Description | Default |
|---|---|---|
TUTR_MODEL |
LLM model to use (litellm format) | gemini/gemini-3-flash-preview |
GEMINI_API_KEY |
Gemini API key | — |
ANTHROPIC_API_KEY |
Anthropic API key | — |
OPENAI_API_KEY |
OpenAI API key | — |
You can also enable command explanations persistently in ~/.tutr/config.json:
{
"show_explanation": true
}
To re-run setup, delete the config file:
rm ~/.tutr/config.json
Development
Run all quality checks:
uv run poe check
Run tests only:
uv run pytest
Lint and format:
uv run ruff check .
uv run ruff format .
Publishing to PyPI
Build and validate distribution artifacts:
uv sync
uv run poe dist
Upload to TestPyPI first:
export TWINE_USERNAME=__token__
export TWINE_PASSWORD=<testpypi-api-token>
uv run poe publish_testpypi
Then upload to PyPI:
export TWINE_USERNAME=__token__
export TWINE_PASSWORD=<pypi-api-token>
uv run poe publish_pypi
You can create API tokens in your account settings:
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
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 tutr-0.1.0.tar.gz.
File metadata
- Download URL: tutr-0.1.0.tar.gz
- Upload date:
- Size: 16.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27a6726c474b9b695b45f0834d2a360727cec2adb4805a5a6f3f31941e479fc5
|
|
| MD5 |
944dafb601d4bb524549b842e57c5a0d
|
|
| BLAKE2b-256 |
00ea0d7a27cf868842dd11f15abd3a1488b959731d383b53e0e706a4227eb727
|
Provenance
The following attestation bundles were made for tutr-0.1.0.tar.gz:
Publisher:
python-publish.yml on spi3/tutr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tutr-0.1.0.tar.gz -
Subject digest:
27a6726c474b9b695b45f0834d2a360727cec2adb4805a5a6f3f31941e479fc5 - Sigstore transparency entry: 975661222
- Sigstore integration time:
-
Permalink:
spi3/tutr@7de67664bce3073796287a741e6b12dc70ff6ade -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/spi3
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@7de67664bce3073796287a741e6b12dc70ff6ade -
Trigger Event:
release
-
Statement type:
File details
Details for the file tutr-0.1.0-py3-none-any.whl.
File metadata
- Download URL: tutr-0.1.0-py3-none-any.whl
- Upload date:
- Size: 22.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9498899c532d11508e1ced0737ad908b156c59be37a5fecf8663157b5d1963c2
|
|
| MD5 |
9eb4fedafafd8eb012a862dfe2a8472a
|
|
| BLAKE2b-256 |
65089b95683aa3d0b591c4e6fbc66311301155e6f29a5ec390b55aff50660bd0
|
Provenance
The following attestation bundles were made for tutr-0.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on spi3/tutr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tutr-0.1.0-py3-none-any.whl -
Subject digest:
9498899c532d11508e1ced0737ad908b156c59be37a5fecf8663157b5d1963c2 - Sigstore transparency entry: 975661223
- Sigstore integration time:
-
Permalink:
spi3/tutr@7de67664bce3073796287a741e6b12dc70ff6ade -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/spi3
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@7de67664bce3073796287a741e6b12dc70ff6ade -
Trigger Event:
release
-
Statement type: