Skip to main content

LLM fragment & template loaders for tmux scrollback and helpful prompt templates

Project description

llm-tmux-fragments

Expose tmux scrollback to LLM via fragments, and ship shassist-inspired templates.

Install

llm install llm-tmux-fragments            # from PyPI
# or, local dev:
llm install -e .

Use: fragments

llm -f tmux:current:2000 "Explain the last error"
llm -f tmux:%1:500 "Summarize what happened in pane %1"
llm -f tmux:all:800 "Give me a cross-pane diagnosis"
llm -f tmux:sys -f tmux:current "Given sys+history, propose a safe fix"

Notes: content is limited by tmux history-limit; consider raising it (e.g., set -g history-limit 50000). (GitHub, Stack Overflow)

Use: templates

llm -t shassist:default -f tmux:current "Why did this pip install fail?"
llm -t shassist:command -f tmux:%1:200 "Give only the exact fix command"
llm -t shassist:default -f tmux:all:600 "Plan the next steps across panes"
llm -t shassist:default -f tmux:current "Critique my awk, then improve it"

Don’t want bundled templates? DIY:

llm --system 'You are a shell mentor…' --save shassist-default
llm -t shassist-default -f tmux:current 'Explain last error'

(See LLM templates docs for --save and template usage.) (llm.datasette.io)

How it works

The plugin registers a fragment loader (tmux:) and a template loader (shassist:). The fragment loader calls tmux capture-pane with a default line count based on #{history-limit}, returning one or more fragments (one per pane for all). Template loader returns prompts for a shell assistant.

Credit: Inspired by Answer.AI’s shell_sage. ([shell_sage][6])

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

llm_tmux_fragments-1.0.0.tar.gz (53.4 kB view details)

Uploaded Source

Built Distribution

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

llm_tmux_fragments-1.0.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file llm_tmux_fragments-1.0.0.tar.gz.

File metadata

  • Download URL: llm_tmux_fragments-1.0.0.tar.gz
  • Upload date:
  • Size: 53.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for llm_tmux_fragments-1.0.0.tar.gz
Algorithm Hash digest
SHA256 632443e647f8dc66bf57b81f334da257bedbd42051b7cce79c6b4d1de835858c
MD5 d65e2ed63ec9475c093bbe719274dc08
BLAKE2b-256 ec978a0fcbdb53ac0444de2d095ff71099b108eb88c47ab144bd6f313af89ba9

See more details on using hashes here.

File details

Details for the file llm_tmux_fragments-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llm_tmux_fragments-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ccbebb6d2370bba340dd89895acf5a6d8848ec2d0014b6eb1727f0d0d847dd13
MD5 49f2dfe5dc33b8ba29626b701d30110d
BLAKE2b-256 67ad0e965965146502ae4c829d65f408ab7d35e8178f14b861d536fe140c1901

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