Skip to content

feat(cli, workspace): Add jp workspace and RFD 087 bootstrap#866

Open
JeanMertz wants to merge 6 commits into
mainfrom
rfd-087
Open

feat(cli, workspace): Add jp workspace and RFD 087 bootstrap#866
JeanMertz wants to merge 6 commits into
mainfrom
rfd-087

Conversation

@JeanMertz

Copy link
Copy Markdown
Collaborator

Adds jp workspace (alias jp w), with use, ls, and show subcommands, plus a global --workspace grammar (ID, path, cwd, - for stdin, and interactive keywords like ?, s, l). Selecting a workspace with jp w use makes it the session's active workspace, so subsequent commands in that terminal session run against it from any directory, the way an active conversation already follows the session (RFD 020). Standing inside a different workspace than the session's active one now prompts to resolve the conflict (c/C/ a/A/q), with A pinning the session sticky to its active workspace across cwd changes.

A new pre-workspace bootstrap step in jp_cli resolves the launch cwd, the selected checkout root, and the working directory for spawned children once, before any Workspace is constructed. When JP operates on a workspace other than the launch cwd's own, MCP servers, plugins, and the .jp.toml config chain all run as if launched from the selected workspace root instead of the process cwd. Commands that only need to select or inspect a workspace (jp w ls, jp w use) no longer pay for workspace construction or conversation indexing.

Workspace checkouts are now tracked in a per-workspace roots registry (workspace/<slug>-<id>/roots/) instead of the single storage symlink, so a workspace with multiple live checkouts (e.g. git worktrees) can be targeted and listed by any of them; a one-time migration folds the legacy symlink into the registry. A new user-global sessions/ store maps each terminal session to its active workspace, cleaned up on the same source-split liveness rules as the existing per-workspace session-to-conversation mapping (RFD 020).

WorkspaceIdOrPath and the ad hoc -w <id> directory scan are removed in favor of the shared WorkspaceTarget grammar and roots registry, and the "silo" terminology in docs and code comments is renamed to "user-workspace directory" for clarity.

JeanMertz added 6 commits July 9, 2026 22:39
Adds `jp workspace` (alias `jp w`), with `use`, `ls`, and `show`
subcommands, plus a global `--workspace` grammar (ID, path, `cwd`,
`-` for stdin, and interactive keywords like `?`, `s`, `l`). Selecting
a workspace with `jp w use` makes it the session's active workspace,
so subsequent commands in that terminal session run against it from
any directory, the way an active conversation already follows the
session (RFD 020). Standing inside a different workspace than the
session's active one now prompts to resolve the conflict (`c`/`C`/
`a`/`A`/`q`), with `A` pinning the session sticky to its active
workspace across cwd changes.

A new pre-workspace bootstrap step in `jp_cli` resolves the launch cwd,
the selected checkout root, and the working directory for spawned
children once, before any `Workspace` is constructed. When JP operates
on a workspace other than the launch cwd's own, MCP servers, plugins,
and the `.jp.toml` config chain all run as if launched from the
selected workspace root instead of the process cwd. Commands that only
need to select or inspect a workspace (`jp w ls`, `jp w use`) no longer
pay for workspace construction or conversation indexing.

Workspace checkouts are now tracked in a per-workspace roots registry
(`workspace/<slug>-<id>/roots/`) instead of the single `storage`
symlink, so a workspace with multiple live checkouts (e.g. git
worktrees) can be targeted and listed by any of them; a one-time
migration folds the legacy symlink into the registry. A new
user-global `sessions/` store maps each terminal session to its active
workspace, cleaned up on the same source-split liveness rules as the
existing per-workspace session-to-conversation mapping (RFD 020).

`WorkspaceIdOrPath` and the ad hoc `-w <id>` directory scan are
removed in favor of the shared `WorkspaceTarget` grammar and roots
registry, and the "silo" terminology in docs and code comments is
renamed to "user-workspace directory" for clarity.

Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
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