Sync commands/ from zilliz-plugin upstream
What this sync does
commands/zilliz/<domain>.toml is a Gemini-CLI-native wrapper around the
plugins/zilliz/skills/<domain>/SKILL.md content in zilliztech/zilliz-plugin
(the path prefix lives in SOURCE_PREFIX). The sync script fetches upstream, strips YAML frontmatter, neutralizes Claude-specific
phrasing, wraps the body in the TOML command template (with !{zilliz <domain> --help} injection and safety rules), and writes it back.
Scope
In scope (19 domain commands, auto-synced): cluster, database, collection, partition, index, vector, import, backup, user-role, acl, monitoring, project-region, billing, external-collection, job, on-demand-cluster, privatelink, diagnose, ask-zilliz.
That is every skill upstream ships except the onboarding trio below. If upstream
adds another, references to it render as a prose pointer at upstream (not a
dangling /zilliz: link) until it is added to DOMAINS.
Out of scope (hand-maintained, do not auto-sync):
setup.toml— no upstream source; bootstraps zilliz-cli install + auth.quickstart.toml/status.toml— adapted fromzilliz-plugin/commands/*.mdwith Gemini-CLI framing changes that a naive sync would clobber.GEMINI.md— global context; review manually if upstream restructures skills.
If the user wants to resync onboarding commands too, do it manually: diff
against zilliz-plugin/commands/quickstart.md / status.md and merge by hand.
Four things the script does that are easy to break
COMMAND_NAMES— the command file, its reference dir, and every cross-reference follow this map when the command should not be named after the upstream skill (ask-zillizships as/zilliz:ask)..sync-state.jsonstill keys on the upstream skill name and records the command alongside it.HELP_CMDS— a skill name is not always azillizsubcommand.user-roleiszilliz user+zilliz role,project-regionisproject+volume,monitoring/diagnosearecluster+collection, andask-zillizhas no CLI surface at all (empty list = no!{}block). Get this wrong and the command silently injects "zilliz-cli not installed" instead of real help. Verify withzilliz <cmd> --helpbefore adding a mapping.ASSET_DIRS—ask-zillizships 14 reference files, copied intoreferences/ask/(named for the command). The prompt resolves that directory at runtime by probing the install location, so the files must actually be committed. The script errors out rather than emitting a prompt pointing at a missing dir.REWRITE—ask-zillizupstream depends on an Inkeep MCP server this extension does not ship; its Inkeep directives are rewritten onto the bundled references plus https://docs.zilliz.com. A survivingInkeepmention fails the sync loudly, so upstream edits to that skill need a rewrite rule, not a silent pass-through.
How to run
# Rewrite TOMLs in place, update .sync-state.json
node scripts/sync.mjs
# Report drift without writing (CI-friendly; exit 1 if any drift)
node scripts/sync.mjs --check
# Show what would change without writing
node scripts/sync.mjs --dry-run
# Sync from a different branch (default: main)
SYNC_BRANCH=master node scripts/sync.mjs
# Avoid GitHub API rate limits
GITHUB_TOKEN=ghp_... node scripts/sync.mjs
Requires Node 18+ (uses built-in fetch). A full run makes ~20 GitHub API calls,
which blows the 60/hour unauthenticated limit in three runs — pass
GITHUB_TOKEN=$(gh auth token) for anything more than a one-off.
Recommended workflow
- Run
node scripts/sync.mjsfrom the repo root. git diff commands/zilliz/— review each changed TOML. Look for:- New command flags or subcommands (desirable).
- Regressions in the rendered prompt (e.g., broken markdown, orphan references).
- Any
Claude-flavored phrasing the neutralizer missed — if found, add a rule to theneutralize()function inscripts/sync.mjs. A cross-skill reference only becomes a/zilliz:link when the name is inSHIPPED.
- Spot-check that the TOMLs parse (
tomllibon Python 3.11+,tomlibelow that):python3 -c "import tomli,glob; [tomli.load(open(f,'rb')) for f in glob.glob('commands/zilliz/*.toml')]". - If upstream added a new skill domain not in the
DOMAINSarray ofsync.mjs, add it there (the script writes the new TOML itself, but it does not discover new upstream directories), give it aHELP_CMDSentry if the name is not azillizsubcommand, and add it to the README and GEMINI.md command tables. - Commit:
git commit -m "chore(sync): pull from zilliz-plugin @ <short-sha>". The short SHA for each file is in.sync-state.json.
When upstream frontmatter description changes
The TOML description = "..." line (shown in /help inside Gemini CLI) is
pulled from the SKILL.md YAML frontmatter. If upstream rewords a description,
the sync picks it up automatically — no special action needed.
When to skip a domain
If you have intentional local divergence for one command (e.g., hand-tuned
prompt), the cleanest path is to temporarily remove that domain from the
DOMAINS array in scripts/sync.mjs, add a comment explaining why, and
resync the others. Avoid editing the generated TOML directly — the next sync
will overwrite it.
State file
.sync-state.json records, per domain: the upstream source path and the SHA
of the most recent commit touching that file. Useful for:
- Quick answer to "which upstream commit are we on for
vector?" - Detecting rebases / force-pushes on the upstream branch.
Commit this file along with the TOML changes.