Skip to content

CLI: uploads staged — first-class view of what's staged for a branch (+ binding state) #405

Description

@zachdunn

Problem

With #403, bare put on a branch stages automatically — so "what's currently staged for this branch?" becomes a question agents ask routinely (before opening a PR, before deciding whether to re-capture, when resuming a branch days later). The primitives exist but require insider knowledge:

  • uploads list --prefix gh/<repo>/branch/<branch>/ — needs the key layout
  • uploads find gh.branch=<name> — needs the metadata vocabulary (gh.staged-at gives recency)

Neither answers the adjacent question an agent actually cares about: will these auto-attach? (repo binding state, #398).

Proposal

A first-class read-only view: uploads staged [--branch <name>] [--repo <owner/name>].

Considered and rejected: local history cache

A CLI-side cache of recent uploads was considered for performance and offline recall. Rejected for v1: the CLI is deliberately stateless across invocations (#393 explicitly avoided cross-invocation state), the server list is a single fast call, and a cache can lie after another machine/agent stages to the same branch — the server is the only truthful answer to "what's staged." Revisit only if listing latency actually shows up in practice.

MCP

  • Hosted MCP: already covered by list/find_files with a documented prefix/metadata recipe — add that recipe to the tool descriptions or skill rather than a new tool.
  • Local stdio MCP: expose staged as a tool mirroring the CLI command (shared implementation).

Sequencing

Blocked on #403 (same code area: commands.ts staging paths, skills). Implement after it merges; update skills/uploads-cli/SKILL.md in the same PR with the new command (and the find/list recipes for hosted-MCP agents).

Testing

Branch/repo resolution matrix (explicit flags, current-branch default, worktrees); empty staging → clean zero-state message (note: find --format json prints empty stdout on zero matches — this command must print []/empty-array JSON instead); binding states wire through; JSON schema; wording reuse from #398 verified by test.

Changeset: minor, @buildinternet/uploads only.

Related: #403, #398, #393.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions