Skip to content

feat(cli): Add conversation path, extend edit#542

Merged
JeanMertz merged 1 commit intomainfrom
prr109
Apr 11, 2026
Merged

feat(cli): Add conversation path, extend edit#542
JeanMertz merged 1 commit intomainfrom
prr109

Conversation

@JeanMertz
Copy link
Copy Markdown
Collaborator

Implements RFD 047. Two new capabilities for direct filesystem access to conversation data, replacing the manual path-hunting workflow.

jp conversation path is a new subcommand that prints the filesystem path to a conversation's storage directory. With --events, --metadata, or --base-config flags it prints the path to that specific file instead. Multiple flags can be combined, with paths printed one per line for shell composition:

vim $(jp conversation path --events)
cat $(jp conversation path --metadata) | jq .
cp $(jp conversation path --events) /tmp/backup.json

jp conversation edit now opens the conversation directory in $EDITOR when invoked without property flags, replacing the previous behavior of showing help text. The same --events, --metadata, and --base-config flags are supported to open a specific file directly. The existing property flags (--local, --title, --tmp, etc.) continue to work as before and conflict with the new file flags.

To support path resolution, jp_storage gains build_conversation_dir, find_conversation_dir, and per-file path methods (events, metadata, base_config). These are surfaced on jp_workspace as well. The previously public CONVERSATIONS_DIR and METADATA_FILE constants are narrowed to pub(crate) now that callers use the new path API instead.

Implements RFD 047. Two new capabilities for direct filesystem access to
conversation data, replacing the manual path-hunting workflow.

`jp conversation path` is a new subcommand that prints the filesystem
path to a conversation's storage directory. With `--events`,
`--metadata`, or `--base-config` flags it prints the path to that
specific file instead. Multiple flags can be combined, with paths
printed one per line for shell composition:

    vim $(jp conversation path --events)
    cat $(jp conversation path --metadata) | jq .
    cp $(jp conversation path --events) /tmp/backup.json

`jp conversation edit` now opens the conversation directory in `$EDITOR`
when invoked without property flags, replacing the previous behavior of
showing help text. The same `--events`, `--metadata`, and
`--base-config` flags are supported to open a specific file directly.
The existing property flags (`--local`, `--title`, `--tmp`, etc.)
continue to work as before and conflict with the new file flags.

To support path resolution, `jp_storage` gains `build_conversation_dir`,
`find_conversation_dir`, and per-file path methods (`events`,
`metadata`, `base_config`). These are surfaced on `jp_workspace` as
well. The previously public `CONVERSATIONS_DIR` and `METADATA_FILE`
constants are narrowed to `pub(crate)` now that callers use the new path
API instead.

Signed-off-by: Jean Mertz <git@jeanmertz.com>
@JeanMertz JeanMertz merged commit 3238767 into main Apr 11, 2026
13 checks passed
@JeanMertz JeanMertz deleted the prr109 branch April 11, 2026 10:32
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