Skip to main content

shtym

AI-powered summary filter that distills any command's output.

Overview

Shtym is a command wrapper designed to reduce context size for both human users and AI coding agents. It wraps command execution and, when an LLM is available, summarizes the output; otherwise it passes output through unchanged.

Installation

pip install shtym

# with Ollama support (requires a running Ollama instance)
pip install "shtym[ollama]"

Configuration

Basic Configuration (Environment Variables)

Configure Ollama settings using environment variables:

  • SHTYM_LLM_SETTINGS__BASE_URL: Ollama server URL (defaults to http://localhost:11434)
  • SHTYM_LLM_SETTINGS__MODEL: Model to use (defaults to gpt-oss:20b)

Example:

export SHTYM_LLM_SETTINGS__BASE_URL=http://localhost:11434
export SHTYM_LLM_SETTINGS__MODEL=llama2
stym run pytest tests/

Advanced Configuration (Profiles)

For more control, create profiles in ~/.config/shtym/profiles.toml with custom prompts and LLM settings:

[profiles.summary]
type = "llm"
system_prompt_template = "You are summarizing: $command"
user_prompt_template = "Output:\n$stdout"

[profiles.summary.llm_settings]
model_name = "gpt-oss:20b"
base_url = "http://localhost:11434"

Use profiles with the --profile option:

stym run --profile summary pytest tests/

See the Profiles documentation for more details.

Usage

Wrap any command with stym run:

# Run tests
stym run pytest tests/

# Run linter
stym run ruff check .

# Build project
stym run npm run build

# Any command with options
stym run ls -la

# Pipe output to other commands
stym run pytest tests/ | grep FAILED

Key Features

  • Exit code inheritance: Shtym preserves the wrapped command's exit code, making it CI/CD friendly
  • Clean stdout: Output contains only command results, no progress indicators or metadata
  • Transparent wrapper: Works seamlessly with existing workflows and scripts
  • Optional LLM summaries: If Ollama is available, output is summarized by the configured model; otherwise passthrough is used automatically

Design Philosophy

Shtym follows Unix conventions for command wrappers (like sudo, timeout, time):

  • Executes commands as subprocesses
  • Inherits and propagates exit codes exactly
  • Maintains clean stdout for composability
  • Enables reliable integration with automated workflows

Documentation

  • Profiles - Advanced configuration with custom profiles
  • Roadmap - Planned features and enhancements

Development

For development documentation, see:

License

MIT

Metadata

Release files for shtym 0.2.0

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

Source distribution (sdist)

Source distribution for shtym 0.2.0
File Size Uploaded
shtym-0.2.0.tar.gz 14.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for shtym 0.2.0
File Interpreter ABI Platform
shtym-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 33.1 kB

Release files / shtym-0.2.0.tar.gz

Download URL shtym-0.2.0.tar.gz
Size 14.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3201baca684caebf61008c8ecacfd8974f023660c0b872e5f4b1f08a71202a3f
BLAKE2b-256 checksum
How to use checksums
ddb0b97a14135d6e93978896db4fd38ef872e5b1bcd05a516fb8f0b030ff63a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 19, 2025.

Transparency log

Release files / shtym-0.2.0-py3-none-any.whl

Download URL shtym-0.2.0-py3-none-any.whl
Size 18.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6391cdfa8960d287f696c3ff501fe5df47f21877eb56b41ac56d8e1fe734c0bd
BLAKE2b-256 checksum
How to use checksums
c3c49afa337ede40b0a34717ef14ead4dee4571459afe0b898cf2884fcbddfb2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 19, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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