Prompt Assembler Integration
Enable prompt-assembler support to expose reusable prompt recipes as virtual profiles.
Requirements
prompt-assembler(thepaCLI) must be onPATH.- tx v0.1.0 or newer.
- Configuration managed under the usual directories (
~/.config/txby 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"
namespacecontrols the prefix shown in the TUI (for examplepa/bootstrap).- Restart tx to refresh the list; the TUI re-runs
pa list --jsonwhen 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
markdownthat contains the assembled prompt frompa show --json <prompt-name>. Enterlaunches the pipeline immediately;Tabprints it for shell reuse.- When a previous session is highlighted you can press
Ctrl+Yto print its ID orCtrl+Eto 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 doctorto confirmpais discoverable. - Increase logging with
RUST_LOG=tx=debug txif profiles disappear. - Restart tx after changing prompts in the
prompt-assemblerrepository.
Known limitation: additional metadata beyond tags and contents still requires future enhancements.