This repository was archived by the owner on Jul 15, 2026. It is now read-only.
api: human-readable references, one-shot config errors, quieter logs - #15
Merged
Conversation
Getting one work item previously took four steps: list projects for the UUID, list every work item, filter by sequence client-side, then get. The by-identifier endpoint the attach command already uses makes that a single call, so the same resolution now backs every command. - New `commands/api/reference.rs`: UUID-shaped input passes through untouched; `<KEY>-<SEQ>` work-item references resolve through the workspace-scoped by-identifier endpoint (which answers 403, not 404, for unknown keys — both map to a friendly error); non-UUID project references match project identifiers case-insensitively. - `work-item get/update/delete` and the work-item sub-resources (`comment`/`link`/`relation`/`activity`) take `<KEY>-<SEQ>` directly and make `--project` optional, since the reference carries its project. Every other `--project` (and the `project` positional ids) accepts the identifier form. - `attach` reuses the shared parser/resolver instead of its private copy. - New `workspace_client` helper reports missing api_key and workspace together with a plane.toml template, so a cold start surfaces every missing setting in one run instead of one per run. `--dry-run` with UUID references stays fully offline; human-readable references cost one read-only resolution call first (same trade dep add already makes to validate its target). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Every API call printed an INFO line with ANSI colors to stderr by default, which pollutes agent transcripts and piped output. The line is diagnostic, not output, so it now logs at debug; --verbose (which maps to the debug level) restores it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
PerishCode
force-pushed
the
api/human-readable-refs
branch
from
July 2, 2026 05:34
23b0a69 to
15077a3
Compare
lefarcen
approved these changes
Jul 2, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Why
Dogfooding the CLI from an agent session, fetching one work item (
OPEND-372) took four steps:project listfor the project UUID,work-item list --all, client-side filtering bysequence_id, thenget— because every command demanded UUIDs while humans (and agents reading a Plane board) holdKEY-SEQidentifiers. Two smaller papercuts compounded the cold start: an empty config surfaced its missing settings one error per run (--project→ workspace → api_key), and every API call printed an ANSI-colored INFO line to stderr, which pollutes agent transcripts and piped output.What
Human-readable references everywhere. New
commands/api/reference.rsbacks every command:work-item get/update/deleteand the work-item sub-resources (comment/link/relation/activity, plus thework-item pagecommands that landed in feat(cli): add work-item page link commands #14) take<KEY>-<SEQ>directly and make--projectoptional (the reference carries its project); every other--projectflag and theprojectpositional ids accept the project identifier (e.g.OPEND). Resolution reuses the workspace-scoped by-identifier endpoint thatattachalready shipped with;attachnow shares the same parser/resolver instead of a private copy. UUID-shaped input passes through untouched, so scripted UUID flows pay no extra request.plane api work-item get OPEND-372 # was: 4 commands + jq plane api comment list --work-item OPEND-372 plane api label list --project OPENDOne-shot config errors. The new
workspace_clienthelper reports a missingapi_keyandworkspace_slugtogether with aplane.tomltemplate, instead of one per run.Quieter default logging. The per-request
calling Plane APIlines drop from INFO to DEBUG;--verboserestores them.Tests
cargo fmt --all --check,cargo clippy --locked --workspace --all-targets -- -D warnings,cargo test --locked --workspace(99 passing, 6 new cases),plane helpsmoke — all green (also enforced by the pre-commit hook).Verified against the production backend (so review can focus on the code, not re-testing):
New reference forms (read):
work-item get OPEND-372(no--project),comment list --work-item OPEND-372,work-item list --project OPEND,project get OPEND,label list --project OPEND,member list --project PLANECLI,dep ls --project PLANECLI, mixed form (UUID work-item + identifier--project), lowercaseopend-372/--project opend, and--workspaceflag override.Full write lifecycle (scratch item
PLANECLI-10, deleted afterwards): identifiercreate→ KEY-SEQget/update→ old-form UUIDupdate→ KEY-SEQcomment create→attachthrough the shared resolver → KEY-SEQdelete→ post-deletegetreturns the friendly not-found error.Backward compatibility: old-form
work-item get --project <UUID> <UUID>andproject listoutput byte-identical to the installed v0.1.2 binary (diffempty); old-formcomment list/work-item list --json/ UUIDupdateall behave unchanged.Dry-run invariant: with a workspace-only config (no
api_key),--dry-run+ UUID references still succeeds fully offline;--dry-run+ identifier reports the missingapi_keyas documented below.Error paths: unknown key (
NOPE-999), unknown project identifier, UUID without--project, malformed reference — all return actionable messages; default stderr is silent and--verboserestores the request log.Compatibility
--dry-runstays fully offline for UUID references. Human-readable references cost one read-only resolution call first (the same tradedep addalready makes to validate its target), so identifier-based--dry-runnow needs anapi_key. The existing dry-run unit test was updated to pin the UUID-offline invariant.--projectbecame optional onwork-item get/update/deleteand the work-item sub-resources — additive; existing UUID invocations behave identically.PROJECT_ID/WORK_ITEM_IDtoPROJECT/WORK_ITEMwith both forms documented.--verbose.Trade-off worth flagging
Non-UUID project references resolve by listing the workspace's projects and matching
identifierclient-side (no by-identifier endpoint exists for projects). That is one paginated list call per invocation — fine at current workspace sizes; a cache or server-side lookup can come later if it ever shows up in latency.