Record terminal sessions as .cast files — trim idle gaps, export to standalone HTML, no account needed
Project description
ttylog (TeleTYpewriter log) records your terminal session to a standard .cast file (asciinema v2 format), lets you trim out the idle gaps, replay it in your terminal, and export it as a fully self-contained HTML file you can open in any browser — no server, no asciinema account, no upload required.
The exported HTML embeds the player and the recording in a single file. Send it in a Slack message, attach it to a GitHub issue, drop it in docs. It just works.
Install
pip install ttylog
Or with pipx:
pipx install ttylog
Note: Recording (
ttylog record) requires Linux or macOS — it uses Unix PTY. Playback, trimming, and HTML export work on all platforms including Windows.
Usage
Record
# Record your default shell
ttylog record session.cast
# Record a specific command
ttylog record session.cast --command "python demo.py"
# Add a title
ttylog record session.cast --title "Deploy walkthrough"
# Suppress the startup banner
ttylog record session.cast --quiet
Press Ctrl-D or type exit to stop recording.
Replay
# Replay at normal speed
ttylog play session.cast
# Replay at 2× speed
ttylog play session.cast --speed 2
# Replay at 0.5× (slow motion)
ttylog play session.cast --speed 0.5
Trim idle gaps
# Trim gaps longer than 2 seconds (default)
ttylog trim session.cast session_trimmed.cast
# Custom gap threshold
ttylog trim session.cast session_trimmed.cast --max-gap 1.5
Export to HTML
# Export as self-contained HTML — no server needed
ttylog export session.cast session.html
Open session.html in any browser. The recording plays automatically. No internet connection required — the player is embedded.
Inspect a recording
ttylog info session.cast
Shows title, command, terminal dimensions, duration, event count, and file size.
.cast format compatibility
ttylog uses the standard asciinema v2 .cast format. Files recorded with ttylog are fully compatible with:
| Tool | Use |
|---|---|
| asciinema.org | Upload and share online |
| agg | Convert to animated GIF |
| svg-term | Convert to SVG |
| asciinema-player | Embed in your own website |
You can also use files recorded with asciinema directly with ttylog trim, ttylog export, and ttylog info.
All commands
ttylog record OUTPUT Record a terminal session to a .cast file
ttylog play SOURCE Replay a session in the terminal
ttylog export SOURCE OUTPUT Export a session as self-contained HTML
ttylog trim SOURCE OUTPUT Remove idle gaps from a recording
ttylog info SOURCE Show metadata and statistics
record options
--command, -c Command to run instead of $SHELL
--title, -t Session title
--quiet, -q Suppress startup banner
play options
--speed, -s Playback speed multiplier (default: 1.0, range: 0.1–10.0)
trim options
--max-gap, -g Max idle gap in seconds (default: 2.0)
Windows users
Recording requires a Unix PTY and is not supported natively on Windows. Use WSL2 to record sessions. Playback (ttylog play), export (ttylog export), trim (ttylog trim), and info (ttylog info) all work natively on Windows.
Development
git clone https://github.com/gitwingo/ttylog
cd ttylog
pip install -e .
Support
If ttylog has been useful to you, consider supporting its development:
Connect
- GitHub: @gitwingo
- Reddit: u/gitwingo
- X / Twitter: @gitwingo
License
MIT © gitwingo
Project details
Release history Release notifications | RSS feed
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 ttylog-0.1.0.tar.gz.
File metadata
- Download URL: ttylog-0.1.0.tar.gz
- Upload date:
- Size: 78.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b01eeabfae474a774f516a9d8cad5a46e1b7ef505d5f0bffd42a56fd012884e
|
|
| MD5 |
a008d9e3e75599a4e9e5fc569a7fcd18
|
|
| BLAKE2b-256 |
39c50f8cadd93c1b9b192b7d4aa2600c24096109e7cf7a3f1cc25fdde6a44b4e
|
Provenance
The following attestation bundles were made for ttylog-0.1.0.tar.gz:
Publisher:
publish.yml on gitwingo/ttylog
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ttylog-0.1.0.tar.gz -
Subject digest:
6b01eeabfae474a774f516a9d8cad5a46e1b7ef505d5f0bffd42a56fd012884e - Sigstore transparency entry: 1440106355
- Sigstore integration time:
-
Permalink:
gitwingo/ttylog@ba6996081e847d4ffb7b19197d52cceb73480a81 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/gitwingo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ba6996081e847d4ffb7b19197d52cceb73480a81 -
Trigger Event:
release
-
Statement type:
File details
Details for the file ttylog-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ttylog-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6335ff6e460baf5361769ceb742eb1508291b1056f1768962d4c035fbf818e2c
|
|
| MD5 |
d8caaa6daa8bcce1036272b98747ac1e
|
|
| BLAKE2b-256 |
672e97a86211341a3022ba65a058f11df6a6ab49e312f35e0b0b444a93d07729
|
Provenance
The following attestation bundles were made for ttylog-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on gitwingo/ttylog
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ttylog-0.1.0-py3-none-any.whl -
Subject digest:
6335ff6e460baf5361769ceb742eb1508291b1056f1768962d4c035fbf818e2c - Sigstore transparency entry: 1440106367
- Sigstore integration time:
-
Permalink:
gitwingo/ttylog@ba6996081e847d4ffb7b19197d52cceb73480a81 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/gitwingo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ba6996081e847d4ffb7b19197d52cceb73480a81 -
Trigger Event:
release
-
Statement type: