feat: top-level ocas tag command for CAS nodes #50

Closed
opened 2026-06-02 10:30:00 +00:00 by xiaoju · 1 comment
Owner

Background

TagStore is now a first-class sub-store (store.tag) that can tag any CAS node by hash. Currently tagging is only available through ocas var tag — this replaces it with a unified top-level command.

Design

Commands

ocas tag <target> <tag> [<tag> ...]     # attach tags
ocas untag <target> <tag> [<tag> ...]   # remove tags
  • <target>: hash, or @scope/name variable (resolved to its current value hash via resolveHash)
  • <tag> format: key:value (tag) or bare name (label)
  • Example: ocas tag @user/config env:prod stable
  • Example: ocas tag 8F134E9GNSCGM reviewed

Enhanced existing commands

  • ocas get <target> — include tag info in output
  • ocas list — support --tag filter (e.g. ocas list --tag env:prod)
  • ocas var get <name> — include tag info in output
  • ocas var list — support --tag filter

Removed

  • ocas var tag — removed, replaced by ocas tag @scope/name ...

Tag format

  • key:value — key-value tag (e.g. env:prod, status:reviewed)
  • name — label (bare string, no colon)

Breaking change

  • ocas var tag subcommand removed

Depends on

#38 unified Store refactor (done )


小橘 🍊(NEKO Team)

## Background TagStore is now a first-class sub-store (`store.tag`) that can tag **any CAS node by hash**. Currently tagging is only available through `ocas var tag` — this replaces it with a unified top-level command. ## Design ### Commands ``` ocas tag <target> <tag> [<tag> ...] # attach tags ocas untag <target> <tag> [<tag> ...] # remove tags ``` - `<target>`: hash, or `@scope/name` variable (resolved to its current value hash via `resolveHash`) - `<tag>` format: `key:value` (tag) or bare `name` (label) - Example: `ocas tag @user/config env:prod stable` - Example: `ocas tag 8F134E9GNSCGM reviewed` ### Enhanced existing commands - **`ocas get <target>`** — include tag info in output - **`ocas list`** — support `--tag` filter (e.g. `ocas list --tag env:prod`) - **`ocas var get <name>`** — include tag info in output - **`ocas var list`** — support `--tag` filter ### Removed - **`ocas var tag`** — removed, replaced by `ocas tag @scope/name ...` ### Tag format - `key:value` — key-value tag (e.g. `env:prod`, `status:reviewed`) - `name` — label (bare string, no colon) ## Breaking change - `ocas var tag` subcommand removed ## Depends on #38 unified Store refactor (done ✅) -------- 小橘 🍊(NEKO Team)
Author
Owner

All phases complete

  • Phase 1 (#52, PR #55) — ocas tag / ocas untag, removed var tag
  • Phase 2 (#53, PR #56) — get / var get show tag info
  • Phase 3 (#54, PR #57) — list / var list support --tag filter

617 tests pass.

小橘 🍊(NEKO Team)

All phases complete ✅ - Phase 1 (#52, PR #55) — `ocas tag` / `ocas untag`, removed `var tag` - Phase 2 (#53, PR #56) — `get` / `var get` show tag info - Phase 3 (#54, PR #57) — `list` / `var list` support `--tag` filter 617 tests pass. 小橘 🍊(NEKO Team)
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shazhou/ocas#50