Skip to content

feat(cli, editor): Allow editing configuration in query editor#310

Merged
JeanMertz merged 1 commit intomainfrom
improve-tool-inquery26
Nov 3, 2025
Merged

feat(cli, editor): Allow editing configuration in query editor#310
JeanMertz merged 1 commit intomainfrom
improve-tool-inquery26

Conversation

@JeanMertz
Copy link
Collaborator

Users can now modify the active configuration directly within the QUERY_MESSAGE.md editor when using jp query. The editor displays a subset of the current configuration in a TOML code block below a cut marker, which can be edited (and amended) before submitting the query. Invalid configuration will cause the editor to reopen with an error message, allowing immediate correction.

Currently, the configuration section shows the model ID and reasoning parameters, but any valid configuration properties can be set in this code block. Changes made in the editor are merged with the existing configuration and stored with the conversation message, eliminating the need to close the editor and restart with different CLI arguments.

The editor also shows an improved conversation history section with timestamps, model information, and properly formatted markdown for assistant responses including reasoning content when available.

Implementation adds a new QueryDocument parser in crates/jp_cli/src/editor/parser.rs that handles the structured format of the query file, separating the query content from metadata sections. The edit_query function now returns both the query text and any configuration changes, which are merged into the partial config before storing messages. Error handling includes validation feedback displayed directly in the editor to streamline the correction workflow.

Related: #217

Users can now modify the active configuration directly within the
`QUERY_MESSAGE.md` editor when using `jp query`. The editor displays a
subset of the current configuration in a TOML code block below a cut
marker, which can be edited (and amended) before submitting the query.
Invalid configuration will cause the editor to reopen with an error
message, allowing immediate correction.

Currently, the configuration section shows the model ID and reasoning
parameters, but any valid configuration properties can be set in this
code block. Changes made in the editor are merged with the existing
configuration and stored with the conversation message, eliminating the
need to close the editor and restart with different CLI arguments.

The editor also shows an improved conversation history section with
timestamps, model information, and properly formatted markdown for
assistant responses including reasoning content when available.

Implementation adds a new `QueryDocument` parser in
`crates/jp_cli/src/editor/parser.rs` that handles the structured format
of the query file, separating the query content from metadata sections.
The `edit_query` function now returns both the query text and any
configuration changes, which are merged into the partial config before
storing messages. Error handling includes validation feedback displayed
directly in the editor to streamline the correction workflow.

Related: #217

Signed-off-by: Jean Mertz <git@jeanmertz.com>
@JeanMertz JeanMertz merged commit 44eb950 into main Nov 3, 2025
12 checks passed
@JeanMertz JeanMertz deleted the improve-tool-inquery26 branch January 2, 2026 07:05
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