Skip to content

feat(cli): Add --style preset flag to conversation print#568

Merged
JeanMertz merged 1 commit intomainfrom
prr135
Apr 16, 2026
Merged

feat(cli): Add --style preset flag to conversation print#568
JeanMertz merged 1 commit intomainfrom
prr135

Conversation

@JeanMertz
Copy link
Copy Markdown
Collaborator

Add a --style / -s flag to jp conversation print with two presets that override the active config's rendering behaviour:

  • brief: hides reasoning blocks, tool arguments, and tool results; only user messages, assistant text, and tool-call headers are shown.
  • full: forces reasoning visible, shows full JSON tool arguments, and renders tool results without truncation.

Example usage:

jp conversation print --style brief
jp conversation print --style full

This is useful when piping a conversation to another tool or reading it as a quick summary (brief), or when debugging an agentic run and needing every detail (full).

The renderer's tool-style lookup was also corrected: tool call and response rendering now properly fall back to defaults.style when no per-tool override exists, rather than silently using hard-coded defaults. Custom-formatter output is now only replayed when the parameters style is Custom, preventing stale rendered arguments from appearing with other styles.

ToolsConfig::iter_mut was added to jp_config to support bulk mutation of per-tool styles when applying a preset.

@JeanMertz JeanMertz changed the base branch from prr111 to main April 16, 2026 15:27
Add a `--style` / `-s` flag to `jp conversation print` with two presets
that override the active config's rendering behaviour:

- `brief`: hides reasoning blocks, tool arguments, and tool results;
  only user messages, assistant text, and tool-call headers are shown.
- `full`: forces reasoning visible, shows full JSON tool arguments, and
  renders tool results without truncation.

Example usage:

```
jp conversation print --style brief
jp conversation print --style full
```

This is useful when piping a conversation to another tool or reading it
as a quick summary (`brief`), or when debugging an agentic run and
needing every detail (`full`).

The renderer's tool-style lookup was also corrected: tool call and
response rendering now properly fall back to `defaults.style` when no
per-tool override exists, rather than silently using hard-coded
defaults. Custom-formatter output is now only replayed when the
parameters style is `Custom`, preventing stale rendered arguments from
appearing with other styles.

`ToolsConfig::iter_mut` was added to `jp_config` to support bulk
mutation of per-tool styles when applying a preset.

Signed-off-by: Jean Mertz <git@jeanmertz.com>
@JeanMertz JeanMertz merged commit 9ac9d6d into main Apr 16, 2026
13 checks passed
@JeanMertz JeanMertz deleted the prr135 branch April 16, 2026 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant