Skip to main content

Linux-first speech-to-text terminal UI

Project description

sttui logo

sttui: Speech To Text in your terminal

No browser. No Web UI. Fast speech-to-text with the best models

PyPI version

https://github.com/user-attachments/assets/252ba77e-d3f3-4689-bcc1-77f536f10c60

Setup

pip install sttui

(or if you have uv installed, uvx sttui)

Then, you must have an account on openrouter, and get an API key.

To register it, run:

sttui auth
Storage of your key

Your key will be stored inside ~/.config/sttui/auth.json

Make sure you don't commit this file !

Config

When you first start the app, a config file is created at: ~/.config/sttui/config.toml

You can specify the default model (without the openrouter prefix), the prompt, and the maximum audio length.

[transcription]
model = "mistralai/voxtral-small-24b-2507"
prompt = """
You are a helpful assistant that can hear audio and write text.
Return a transcription of the user audio as json. If the user request is empty, return null.
<format>
{
  "transcription": ""
}
</format>
<format>
{
  "transcription": null
}
</format>
"""
max_seconds = 600

⚠️ Make sure that the prompt asks the model to answer in this json format, it's the one expected by sttui

Commands

# Start interactive dictation TUI
sttui

# Equivalent explicit run command
sttui run

# Show CLI help
sttui --help

# Set or update API key
sttui auth

# TUI + write transcript to stdout on Enter
sttui --stdout

# Override model and recording cap for this run
sttui --model google/gemini-2.5-flash --max-seconds 120

# Use a custom config file
sttui --config ~/.config/sttui/config.toml

# Record, transcribe, and send to an HTTP endpoint
sttui --send-post https://example.com --send-body '{"text": $0}'

# Send transcript to a shell command
sttui --send-command 'xargs -I {} notify-send "{}"'

# Send transcript to a Unix socket (e.g., pi coding agent)
sttui --send-socket /run/user/1000/pi/sttui.sock --send-body '{"message": $0}'

# Chain multiple sends (with 1s delay between them)
sttui --send-post https://example.com/foo --send-body '{"a": $1}' \
           --send-post https://example.com/bar --send-body '{}' \
           --send-delay 1000

# Background lifecycle (no TUI)
sttui background start
sttui background stop
sttui background toggle

# Same with desktop notifications
sttui background --notify start

Send Command Templates

In --body templates, use $0 for the full transcript, $1/$2/etc. for individual parts.

Values are JSON-escaped automatically when a --body template is provided.

All recordings and transcripts are stored in ~/.local/share/sttui/recordings/.

Integrations

AI coding agents (opencode, pi)

Dictate directly into coding agents.

pi coding agent

Dictate directly into pi using sttui's socket integration.

Copy the extension to your pi extensions folder:

mkdir -p ~/.pi/agent/extensions
cp integrations/pi.ts ~/.pi/agent/extensions/sttui.ts

After starting pi, you'll see the sttui command in the chat.

Contributing

This is a side-project of mine. I must admit there is mostly AI-generated code, but I try to review and ensure good practices.

I don't have strong opinions about how this project should evolve. If you find it useful, feel free to contribute !

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

sttui-0.3.0a3.tar.gz (29.7 kB view details)

Uploaded Source

Built Distribution

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

sttui-0.3.0a3-py3-none-any.whl (29.8 kB view details)

Uploaded Python 3

File details

Details for the file sttui-0.3.0a3.tar.gz.

File metadata

  • Download URL: sttui-0.3.0a3.tar.gz
  • Upload date:
  • Size: 29.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sttui-0.3.0a3.tar.gz
Algorithm Hash digest
SHA256 84e2577d6f4858254f9add766b1bafd2f6991e4181fee9021b7c61f46c6506f4
MD5 9e93107148f838cad328c3db8cd48cc4
BLAKE2b-256 951827239258433a975e631859234d8a50632c795e44fd9aba38a7cb30eb0f77

See more details on using hashes here.

Provenance

The following attestation bundles were made for sttui-0.3.0a3.tar.gz:

Publisher: publish.yaml on rambip/sttui

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

File details

Details for the file sttui-0.3.0a3-py3-none-any.whl.

File metadata

  • Download URL: sttui-0.3.0a3-py3-none-any.whl
  • Upload date:
  • Size: 29.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sttui-0.3.0a3-py3-none-any.whl
Algorithm Hash digest
SHA256 d63a0c4ea6886519a45178c59bac33665ad378bd4f0ae3037a94d4fef40cbb5b
MD5 47ebea785d13354727e9d129cd32ab53
BLAKE2b-256 f571e870ab1ef250adc428b209ba7fa58c500f7c17f2512944c86683056e9e40

See more details on using hashes here.

Provenance

The following attestation bundles were made for sttui-0.3.0a3-py3-none-any.whl:

Publisher: publish.yaml on rambip/sttui

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