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.0a1.tar.gz (8.1 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.0a1-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: llm_fragments_tmux-0.1.0a1.tar.gz
  • Upload date:
  • Size: 8.1 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.0a1.tar.gz
Algorithm Hash digest
SHA256 53d1e1851905f5a84ed7b498c315b4e0761a54f2a55452e2972bcd0936de0fa5
MD5 bf9d2ee986f792a55e16ac2c5493a1fa
BLAKE2b-256 e07ea8d1dad3a578dbd2ee0bcd54fe56a7ca713b5ed7a6c0bfbdaacf713f4981

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_fragments_tmux-0.1.0a1.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.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for llm_fragments_tmux-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 571451d187e20c5321c1ff3e510551e495ffd8532d563bad0df23970e8e3ae85
MD5 873874eb3b19262729f4bdf3c50cb85e
BLAKE2b-256 8962a383f88eb7a86530e2a242eca7d9639a56e0d4139ef22d533afeed4d0ac1

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_fragments_tmux-0.1.0a1-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