feat(cli): workspace management verbs + docs (MCP stays read-only)#145
Merged
Conversation
…e/delete)
Add mutation verbs to `cix ws`, calling the server's existing endpoints
(POST/PATCH/DELETE /workspaces and POST/DELETE /workspaces/{id}/projects).
The CLI was previously read-only (list/describe/repos/search); workspace
management was dashboard-only.
client: CreateWorkspace, UpdateWorkspace, DeleteWorkspace,
LinkProjectToWorkspace, UnlinkProjectFromWorkspace.
cmd: name-first grammar gains create / add(link) / remove(unlink) / rename /
update / delete. `create` is a reserved leading keyword (like `list`).
- add/remove resolve a project identifier (absolute path / host_path /
16-hex path_hash) to its indexed path_hash; a local project resolves via
the re-derived hash because the server stores its host_path as the
namespaced identity key `local:{machine_id}:{path}`, not the bare path.
- add/remove are best-effort over several projects, defaulting to the cwd,
and return a non-zero exit on any failure.
- delete prompts on a TTY and refuses on a pipe without --yes.
- SilenceUsage/SilenceErrors on the ws command so errors read as one line.
12 new tests; verified end-to-end against a live server (create → add →
dup(409) → unknown → list → describe → rename → update → remove → delete).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Close the doc/skill gaps for `cix ws` management, which was previously undocumented (dashboard-only). MCP is intentionally left read-only — no new tools; docs just clarify that management lives in the CLI/dashboard. - CLI_REFERENCE + skills/cix (and its plugin copy): add a Workspaces "Manage" block (create/add/remove/rename/update/delete). - workspaces.md + WORKSPACES.md: document the CLI link-existing flow, kept clearly distinct from the dashboard clone-new (`git-repos`) flow. - cix-workspace skill: prerequisite note on creating/populating a workspace. - COWORK_MCP + cowork cix-workspace skill: clarify the cix_* MCP tools are read-only and management is done via the CLI or dashboard. Canonical skills mirrored into plugins/cix via sync-skills.sh (--check clean); plugin bats suite green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…; test rename/update Address PR review feedback on the workspace management verbs: - add/remove/delete now honour --json (structured stdout instead of the human ✓ lines), so all verbs are consistent for agent consumption. - guardVerbFlags rejects a management flag set for a verb it doesn't apply to (e.g. `cix ws create foo --name bar`) instead of silently ignoring it. - create refuses `list`/`create` as names — they'd be unaddressable by the name-first grammar — and quotes the workspace name in its hint. - resolveProjectHash comment corrected: tier 3 matches on the re-derived path_hash, not host_path, and there is no ~ expansion. - new tests cover rename, update's clear-on-empty --description and no-flags error (the cmd.Flags().Changed semantics), the flag guard, the reserved-name reject, and --json for add/delete. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The REST table claimed `DELETE /workspaces/{id}` "cascades to repos +
clones", contradicting the rest of the doc. Service.Delete only removes the
`workspaces` row; the ON DELETE CASCADE on `workspace_projects` clears
membership rows only — projects, their `git_repos` peers, and on-disk clones
are untouched.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds workspace management to the
cixCLI. Previouslycix wswasread-only (
list/describe/repos/search) and creating a workspaceor attaching projects was dashboard-only. The server already exposed all the
mutation endpoints — this wires the CLI to them and documents the surface.
MCP is intentionally left read-only (no new
cix_*tools); the docs justclarify that management lives in the CLI/dashboard.
New CLI verbs (name-first grammar)
A
<project>is any already-indexed project addressed by absolute path,host_path (
github.com/owner/repo@main), or 16-hexpath_hash; no argdefaults to the cwd.
addlinks an existing index — it does not clone;cloning a new GitHub repo into a workspace stays a dashboard/
git-reposoperation.
Notable implementation details
internal/client/workspace.go):CreateWorkspace,UpdateWorkspace,DeleteWorkspace,LinkProjectToWorkspace,UnlinkProjectFromWorkspace.host_pathis thenamespaced key
local:{machine_id}:{path}(bare path is incontainer_path), soadd <abs-path>resolves by re-deriving thepath_hash(EncodeProjectPath), not by a host_path string compare. Thiswas a real bug caught in end-to-end testing.
deleteprompts on a TTY and refuses on a pipe without--yes(never deletes without explicit consent).
deleteremoves the workspace +its membership links only — the underlying projects are untouched.
SilenceUsage/SilenceErrorson thewscommand so errors read as oneclean line.
Docs / skills (2nd commit)
doc/CLI_REFERENCE.md,skills/cix/SKILL.md(+ plugin copy): Workspaces"Manage" block.
workspaces.md,doc/WORKSPACES.md: CLI link-existing flow, kept distinctfrom the dashboard clone-new flow.
skills/cix-workspace/SKILL.md: prerequisite note on creating/populating aworkspace.
doc/COWORK_MCP.md,plugins/cix-cowork/skills/cix-workspace/SKILL.md:clarify the MCP surface is read-only.
plugins/cixviasync-skills.sh.Testing
go build/go vet/go test ./...green; 12 new tests incli/cmd/workspace_test.go.unknown → list → describe → rename → update → remove → delete → 404.
sync-skills.sh --checkclean; plugin bats suite 15/15.Server-side: no changes (endpoints pre-existed). No
openapi/AUTH_REVIEWchanges needed.
🤖 Generated with Claude Code