Skip to main content

llm plugins for loading tmux panes

Project description

llm-fragments-tmux

PyPI Changelog Tests License

A plugin for LLM that provides fragments from tmux panes. It allows you to capture the content of a tmux pane and use it as a fragment in LLM prompts, or list available tmux panes for selection.

Installation

Install this plugin in the same environment as LLM.

llm install llm-fragments-tmux

Example

Here's a step-by-step example of how you might use this plugin in practice:

  1. Open tmux
tmux
  1. Run a command in your tmux pane
echo "Hello, world! This is a test."
  1. Use LLM with the tmux fragment to explain what happened
llm -f tmux: "Explain what happened in this terminal session."

This will capture the output from your current tmux pane and send it to LLM for explanation.

Usage

This plugin provides a tmux fragment for use with LLM's -f/--fragment option.

You can use the content of one or more tmux panes directly in your LLM prompts using positional arguments:

llm -f tmux:1,2:20 "Summarize the following terminal output:"
  • The first field (before the colon) is a comma-separated list of tmux pane ids (e.g., 1,2). Omit for the current pane.
  • The second field (after the colon) is the number of lines from the bottom of the pane(s) to capture (e.g., 20). Omit for all lines.
  • Examples:
    • tmux:1,2:20 — panes 1 and 2, last 20 lines
    • tmux:1 — pane 1, all lines
    • tmux::20 — current pane, last 20 lines
    • tmux: — current pane, all lines (default)

You can also use the fragment in other LLM commands that support -f/--fragment.

Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:

cd llm-fragments-tmux
python -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

python -m pip install -e '.[test]'

To run the tests:

python -m pytest

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_fragments_tmux-0.1.0a2.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

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

llm_fragments_tmux-0.1.0a2-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file llm_fragments_tmux-0.1.0a2.tar.gz.

File metadata

  • Download URL: llm_fragments_tmux-0.1.0a2.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for llm_fragments_tmux-0.1.0a2.tar.gz
Algorithm Hash digest
SHA256 e4157c1a8e22669ca1ad4b5a718443fe115bdddee192f73a83fdc40c91fa49f1
MD5 4b0d8c26f494dca70dd7068c4b8774b4
BLAKE2b-256 48fcf9e58fbfd1e3c38e8d6e1732615631f5460fc2adc67089964e26deba580e

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_fragments_tmux-0.1.0a2.tar.gz:

Publisher: publish.yml on kj-9/llm-fragments-tmux

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

File details

Details for the file llm_fragments_tmux-0.1.0a2-py3-none-any.whl.

File metadata

File hashes

Hashes for llm_fragments_tmux-0.1.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 b185e84e25271dff714fa1ddcfb291a440b0f5507c8053c8e00bf5e002a53b00
MD5 ef6228d1372f5224d14072d4fd9f4419
BLAKE2b-256 a1180fd22ce468f6258dbb2c55eba65287a2b11c2502961764833c6500a9edca

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_fragments_tmux-0.1.0a2-py3-none-any.whl:

Publisher: publish.yml on kj-9/llm-fragments-tmux

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