dcdpr / dcdpr/jp

Add global `edit` command to quickly edit JP state

Open
#14 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
16
Forks
3
Avg merge
1d 1h
Merged PRs (30d)
121

Description

We have unique identifiers for all state in JP:

  • jp-c17466185493-otvo8 where
    • jp is a fixed prefix,
    • c is the identifier for a conversation type,
    • 17466185493 is the unique identifier for that specific conversation, and
    • otvo8 is the identifier of the workspace.

We should leverage this to allow using jp edit <ID> to open the state file associated with the given ID.

Currently, all commands except for init require the command to be ran from within a workspace context (e.g. in the root or one of the subdirectories of a workspace). I propose we also add a new jp edit <ID> command which you can run globally (e.g. from anywhere), and the provided ID ensures we open the correct state file in the correct workspace (this is done through local mapping of the workspace ID to a local workspace path, which we already have).

We'll support the following:

  • jp edit <ID> [--local]
  • open $EDITOR to open the file associated with the given ID
  • If --local is passed, we open the relevant local counterpart to the workspace file. This will have hard-coded logic to reject certain state files that we don't support locally.
  • Based on the type (e.g. conversation or persona, etc.) we try to parse the modified content
    • If successful, we store the new content and are done.
    • If failure, we print the error, then ask the user:
      • open original file
      • edit modified file
      • cancel

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the CLI command dispatch and the existing local mapping from workspace IDs to workspace paths. Trace how state files are selected, how $EDITOR is invoked, and how conversation or persona content is parsed, including the unsupported local cases. Done means global jp edit <ID> works from outside a workspace, supports --local, and handles parse failures with the specified choices.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.