Skip to main content

Vendor-neutral CLI/TUI for browsing local agent logs

Project description

trailback

Vendor-neutral CLI/TUI for browsing local agent logs.

Note: The package is called trailback (uv pip install trailback), but the CLI command is trail — short to type, easy to remember. See docs/NAMING.md for background.

Current MVP supports Codex, Claude, and Gemini sessions for listing, viewing transcripts, and usage stats.

Install

Install the CLI as a uv tool so the trail executable is available from anywhere:

uv tool install -e .

Ensure the uv tool bin directory is on your PATH (usually ~/.local/bin):

export PATH="$HOME/.local/bin:$PATH"

Verify:

command -v trail
trail tui

CLI

  • trail sources
  • trail ls [--source codex] [--no-cwd]
  • trail ls [--group] [--header] [--show-ids]
  • trail open <session_id> [--source codex]
  • trail open <group_id>
  • trail stats [--source codex] [--format text|csv|json] [--period all|daily|monthly|yearly] [--no-header]
  • trail tui
  • trail init [--path PATH] [--force]

Config

Use ~/.config/trail/config.toml to add sources. Default Codex example:

[sources.codex]
kind = "codex"
path = "~/.codex"
include = ["sessions/**/*.jsonl", "sessions/**/*.json"]

Claude example:

[sources.claude]
kind = "claude"
path = "~/.claude"
include = ["projects/**/*.jsonl"]

Gemini example:

[sources.gemini]
kind = "gemini"
path = "~/.gemini"
include = ["tmp/*/chats/session-*.json", "tmp/*/logs.json"]

Log sync (multi-machine)

Use scripts/sync-logs.sh to sync logs from a secondary machine to a primary. It is designed for one-way sync (secondary -> primary) and uses a quiet window to avoid in-progress files.

Manual run:

PRIMARY_USER=youruser PRIMARY_HOST=your-primary-host ./scripts/sync-logs.sh

Dry run:

DRY_RUN=1 PRIMARY_USER=youruser PRIMARY_HOST=your-primary-host ./scripts/sync-logs.sh

Optional SSH options:

SSH_OPTS="-i ~/.ssh/your_key -o StrictHostKeyChecking=accept-new" \
  PRIMARY_USER=youruser PRIMARY_HOST=your-primary-host ./scripts/sync-logs.sh

LaunchAgent example (runs every 6 hours):

~/Library/LaunchAgents/com.trail.logs-sync.plist

Reload after edits:

launchctl unload -w ~/Library/LaunchAgents/com.trail.logs-sync.plist 2>/dev/null || true
launchctl load -w ~/Library/LaunchAgents/com.trail.logs-sync.plist
launchctl kickstart -k gui/$(id -u)/com.trail.logs-sync

For design details, see docs/LOG_SYNC.md.

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

trailback-0.1.1.tar.gz (72.3 kB view details)

Uploaded Source

Built Distribution

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

trailback-0.1.1-py3-none-any.whl (36.0 kB view details)

Uploaded Python 3

File details

Details for the file trailback-0.1.1.tar.gz.

File metadata

  • Download URL: trailback-0.1.1.tar.gz
  • Upload date:
  • Size: 72.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for trailback-0.1.1.tar.gz
Algorithm Hash digest
SHA256 78c5396b91a55d13d87fbe53bfad7db8920ed82c33cde47a40ca8638d398e10f
MD5 7a58e71cf7a0a63446efb386b7197a67
BLAKE2b-256 3cc17dd50a6cc1eb889fc57394f280cf858c1482ca053d818c394dd551b50f4f

See more details on using hashes here.

File details

Details for the file trailback-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: trailback-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 36.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for trailback-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 930c98ff15ec48beb09887e82074c682588a1c00888662b757097047222a7775
MD5 af48f414fe39d1b6af925a433a6ff48d
BLAKE2b-256 2df7d0b4c98405e5c88088465d4b3c50d001e7c6b72c272f63a519454b4eb665

See more details on using hashes here.

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