Skip to content

feat: agent-native repo/tag mutation fixes#197

Merged
AlephNotation merged 2 commits into
mainfrom
feat/agent-native-repo-fixes
May 12, 2026
Merged

feat: agent-native repo/tag mutation fixes#197
AlephNotation merged 2 commits into
mainfrom
feat/agent-native-repo-fixes

Conversation

@AlephNotation
Copy link
Copy Markdown
Contributor

Two related agent-native fixes for the repo/tag mutation surface. Driven by principles 2 (structured, parseable output) and 6 (cross-CLI vocabulary consistency) of the agent-native-cli skill.

Fix 1: `--json` on mutating repo/tag commands

These commands previously printed only human-readable success text. An agent that wanted the freshly-created `repo_id`, `tag_id`, `commit_id`, or `reference` had to parse prose. Added `--json` (and a deprecated `--format` alias, matching the existing F1 pattern used on the corresponding `list`/`get` commands) to:

  • `vers repo create`
  • `vers repo tag create`
  • `vers repo tag update`
  • `vers tag create`
  • `vers tag update`

JSON payloads expose the identifiers/references the agent needs next:

Command JSON fields
`repo create` `name`, `repo_id`
`repo tag create` `repo`, `tag_name`, `commit_id`, `tag_id`, `reference`
`repo tag update` `repo`, `tag_name`, `reference`, `commit_id?`, `description?`
`tag create` `tag_name`, `commit_id`, `tag_id`
`tag update` `tag_name`, `commit_id?`, `description?`

Each command's `Long` help now mentions `--json` and the fields it returns.

Fix 2: `vers repo visibility` — `--public` / `--private` mutex

Replaces the awkward `--public=false` form with two explicit booleans:

```
vers repo visibility my-app --public # make public
vers repo visibility my-app --private # make private
```

  • `MarkFlagsMutuallyExclusive("public", "private")`
  • `MarkFlagsOneRequired("public", "private")`
  • Missing-flag and conflict errors enumerate the valid set (cobra default message).
  • Long help documents that `--public=false` is no longer accepted; use `--private`.
  • Also adds `--json` to this command, emitting `{"name": ..., "is_public": ...}`.

Verification

  • `make build` ✅
  • `gofmt -l cmd/ internal/` empty ✅
  • `go test ./internal/... ./cmd/...` ✅
  • `./bin/vers repo visibility foo --public --private` → mutex error ✅
  • `./bin/vers repo visibility foo` → one-required error ✅
  • `./bin/vers repo visibility foo --public` and `--private` work ✅
  • `./bin/vers agent-context | jq '.commands.repo.subcommands.visibility.flags'` lists both `--public` and `--private` ✅
  • `--help` for each of the 6 commands mentions `--json` ✅

Breaking change

`vers repo visibility --public=false` no longer works. Use `--private` instead. The bool-value parsing for `--public` is gone because `--public` is now part of a mutually exclusive group.

Adds --json (with deprecated --format alias) to the mutating commands
that previously only emitted human-readable success text:

  vers repo create
  vers repo tag create
  vers repo tag update
  vers tag create
  vers tag update

This unblocks agents that need to grab the created/updated identifiers
(repo_id, tag_id, commit_id, reference) without parsing prose. Mirrors
the existing F1 `--json` pattern used on the list/get commands in the
same files.

Long help on each command now mentions `--json` and the fields it
returns.
`vers repo visibility <name>` previously took `--public` as a single
bool, with `--public=false` to mean private. That form is hard for an
agent to discover from --help and easy to typo as `--public false`
(positional arg, not flag value). Replace with two explicit booleans:

  --public    Make the repository public
  --private   Make the repository private

The flags are marked mutually exclusive and one-required, so:

  vers repo visibility my-app                   # errors: one required
  vers repo visibility my-app --public --private # errors: mutex

The Long help now documents that `--public=false` is no longer
accepted and points at `--private` instead.

Also adds --json (with deprecated --format alias) to this command,
emitting `{"name": ..., "is_public": ...}` so agents can confirm
the new state without parsing prose.
@AlephNotation AlephNotation merged commit e9ff14c into main May 12, 2026
6 checks passed
@AlephNotation AlephNotation deleted the feat/agent-native-repo-fixes branch May 12, 2026 01:27
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