Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Prompt Assembler Integration

Enable prompt-assembler support to expose reusable prompt recipes as virtual profiles.

Requirements

  • prompt-assembler (the pa CLI) must be on PATH.
  • tx v0.1.0 or newer.
  • Configuration managed under the usual directories (~/.config/tx by default).

If pa returns an error or invalid JSON, tx hides the virtual profiles and prints a notice in the TUI footer.

Configuration

Create a drop-in file such as ~/.config/tx/conf.d/20-pa.toml:

[features.pa]
enabled = true
namespace = "pa"
  • namespace controls the prefix shown in the TUI (for example pa/bootstrap).
  • Restart tx to refresh the list; the TUI re-runs pa list --json when it launches.

Using Virtual Profiles

When the feature is active:

  • Virtual entries appear in the profiles pane alongside regular profiles.
  • The preview pane renders Markdown metadata (bold headings for provider, description, and tags) followed by a fenced code block labelled markdown that contains the assembled prompt from pa show --json <prompt-name>.
  • Enter launches the pipeline immediately; Tab prints it for shell reuse.
  • When a previous session is highlighted you can press Ctrl+Y to print its ID or Ctrl+E to export its transcript before switching back to the profile pane.

Before any wrapper or provider is launched, tx feeds the selected prompt to pa, prompting you in the controlling terminal for each missing positional argument (such as {0}). The assembled text is stored in TX_CAPTURE_STDIN_DATA, which the capture helper reads when it spawns your provider. Combine the feature with stdin_mode = "capture_arg" to pass the rendered prompt as an argument:

[providers.codex]
bin = "codex"
flags = ["--search"]
stdin_mode = "capture_arg"
stdin_to = "codex:{prompt}"

With that configuration, selecting pa/hello gathers the prompt before any wrapper starts and then invokes the provider with codex --search "<prompt-text>".

Prefer using the prompt_assembler key on a profile when you want the same behavior without maintaining a manual snippet:

[profiles.troubleshooting]
provider = "codex"
wrap = "troubleshooting_tmux"
prompt_assembler = "troubleshooting"
prompt_assembler_args = ["--limit", "5"]

The profile variant still runs the wrapper, sets up snippets, and injects the assembled prompt as a provider argument.

Troubleshooting

  • Run tx doctor to confirm pa is discoverable.
  • Increase logging with RUST_LOG=tx=debug tx if profiles disappear.
  • Restart tx after changing prompts in the prompt-assembler repository.

Known limitation: additional metadata beyond tags and contents still requires future enhancements.