Skip to main content

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+.

pipx install tutr

Or run it without installing:

uvx tutr

For development from source:

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.

To re-run or modify configuration at any time:

tutr-cli configure

Usage

tutr <command> <what you want to do>

Auto-start in Every Terminal

tutr is an interactive shell wrapper. To launch it automatically for every new interactive terminal, add this to your shell rc file.

Bash (~/.bashrc)

if [[ $- == *i* ]] && [[ -z "${TUTR_AUTOSTARTED:-}" ]] && [[ -z "${TUTR_SKIP_AUTOSTART:-}" ]]; then
  export TUTR_AUTOSTARTED=1
  exec tutr
fi

Zsh (~/.zshrc)

if [[ -o interactive ]] && [[ -z "${TUTR_AUTOSTARTED:-}" ]] && [[ -z "${TUTR_SKIP_AUTOSTART:-}" ]]; then
  export TUTR_AUTOSTARTED=1
  exec tutr
fi

Notes:

  • TUTR_AUTOSTARTED prevents recursion when tutr sources your normal rc file.
  • Set TUTR_SKIP_AUTOSTART=1 before opening a terminal to temporarily bypass autostart.
  • Active wrapped shells show a prompt prefix (default [tutr]) and set TUTR_ACTIVE=1.
  • Customize the prefix with TUTR_PROMPT_PREFIX (example: export TUTR_PROMPT_PREFIX="[ai]").
  • Use tutr-cli ... if you want the original one-shot command generator behavior.

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

Configure Command

Use configure to update provider/model selection and config flags.

Interactive wizard:

tutr-cli configure

Non-interactive examples:

tutr-cli configure --provider openai --model openai/gpt-4o --show-explanation
tutr-cli configure --provider anthropic --model anthropic/claude-sonnet-4-6
tutr-cli configure --provider ollama --ollama-host http://localhost:11434
tutr-cli configure --clear-api-key

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
OLLAMA_HOST Ollama host URL override http://localhost:11434

You can edit settings with tutr-cli configure or directly in ~/.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

tutr-0.1.5.tar.gz (20.2 kB view details)

Uploaded Source

Built Distribution

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

tutr-0.1.5-py3-none-any.whl (28.3 kB view details)

Uploaded Python 3

File details

Details for the file tutr-0.1.5.tar.gz.

File metadata

  • Download URL: tutr-0.1.5.tar.gz
  • Upload date:
  • Size: 20.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tutr-0.1.5.tar.gz
Algorithm Hash digest
SHA256 c72fc1413f0190873c96b6d6ceea29b207f98c0e21b033dc883392a29ea716da
MD5 0c5f548637b558179b2a49b5205ad4e2
BLAKE2b-256 ebe42663b87cbdd05f84f4fd6e3cb2fb35bcf447916194f93e171431f6320312

See more details on using hashes here.

Provenance

The following attestation bundles were made for tutr-0.1.5.tar.gz:

Publisher: python-publish.yml on spi3/tutr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tutr-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: tutr-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 28.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tutr-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 03cdba9134b4565335d6e16cc3eb379760e54a898a52fe992a42862f19d39777
MD5 8c0071b10f411263fd57128ae42ed4b4
BLAKE2b-256 a85a0f948c114180b80f2d78ae2542d2f4340d5854fc6188a6385d248b269824

See more details on using hashes here.

Provenance

The following attestation bundles were made for tutr-0.1.5-py3-none-any.whl:

Publisher: python-publish.yml on spi3/tutr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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