gabriel / muse public
_muse bash
709 lines 35.0 KB
Raw
sha256:660fcac1df3ab28f61862e961890bd2ca8b754fa0242079d93ca1e25037ec8a6 chore(tests): add docstring to tests/__init__.py so rc14 tr… Human 26 days ago
1 #compdef muse
2 # Zsh completion for the Muse CLI.
3 #
4 # Installation (pick one):
5 # 1. Symlink into a directory already on $fpath:
6 # ln -sf /path/to/muse/completions/_muse ~/.zsh/completions/_muse
7 # 2. Oh-My-Zsh users — copy or symlink into the custom completions dir:
8 # ln -sf /path/to/muse/completions/_muse \
9 # ~/.oh-my-zsh/completions/_muse
10 # 3. Add the completions directory directly to $fpath in ~/.zshrc:
11 # fpath=(/path/to/muse/completions $fpath)
12 # autoload -Uz compinit && compinit
13 #
14 # After installing, reload completions:
15 # exec zsh OR autoload -Uz compinit && compinit -u
16
17 # ---------------------------------------------------------------------------
18 # Helpers — read repo state directly from the filesystem; no subprocess.
19 # ---------------------------------------------------------------------------
20
21 # Walk up from $PWD and return the .muse directory path, or "" if not found.
22 _muse_dot_muse() {
23 local dir="$PWD"
24 while [[ "$dir" != "/" ]]; do
25 if [[ -f "$dir/.muse/repo.json" ]]; then
26 print -r -- "$dir/.muse"
27 return 0
28 fi
29 dir="${dir:h}"
30 done
31 return 1
32 }
33
34 # Emit branch names by listing .muse/refs/heads/ — zero subprocesses.
35 _muse_branches() {
36 local dot_muse
37 dot_muse="$(_muse_dot_muse)" || return
38 local heads_dir="$dot_muse/refs/heads"
39 [[ -d "$heads_dir" ]] || return
40 local -a branches
41 # ${heads_dir}/**/*(N:t) recurses and strips directory prefix.
42 branches=(${(f)"$(find "$heads_dir" -type f 2>/dev/null | sed "s|$heads_dir/||")"})
43 (( ${#branches} )) && _describe 'branches' branches
44 }
45
46 # Emit remote names from .muse/config.toml — zero subprocesses.
47 _muse_remotes() {
48 local dot_muse
49 dot_muse="$(_muse_dot_muse)" || { _values 'remote' 'origin' 'local'; return; }
50 local cfg="$dot_muse/config.toml"
51 local -a remotes
52 if [[ -f "$cfg" ]]; then
53 # Extract remote names from [remotes.<name>] section headers.
54 remotes=(${(f)"$(grep -E '^\[remotes\.' "$cfg" 2>/dev/null \
55 | sed -E 's/\[remotes\.([^]]+)\]/\1/')"})
56 fi
57 if (( ${#remotes} )); then
58 _describe 'remotes' remotes
59 else
60 _values 'remote' 'origin' 'local'
61 fi
62 }
63
64 # ---------------------------------------------------------------------------
65 # Command lists (kept in sync with muse/cli/app.py)
66 # ---------------------------------------------------------------------------
67
68 local -a _muse_top_cmds=(
69 'plumbing:Tier 1 machine-readable plumbing commands'
70 'init:Initialise a new Muse repository'
71 'status:Show working-tree drift against HEAD'
72 'log:Display commit history'
73 'commit:Record the current state as a new version'
74 'diff:Compare working tree against HEAD or two commits'
75 'show:Inspect a commit'
76 'branch:List, create, or delete branches'
77 'checkout:Switch branches or restore from a commit'
78 'merge:Three-way merge a branch into HEAD'
79 'reset:Move HEAD to a prior commit'
80 'revert:Undo a prior commit'
81 'cherry-pick:Apply a specific commit on top of HEAD'
82 'stash:Shelve uncommitted changes'
83 'tag:Attach and query semantic tags'
84 'push:Upload commits and objects to a remote'
85 'pull:Fetch from a remote and merge'
86 'fetch:Download commits from a remote'
87 'clone:Create a local copy of a remote repository'
88 'remote:Manage remote connections'
89 'auth:Identity management'
90 'hub:MuseHub fabric connection'
91 'config:Local repository configuration'
92 'domains:Domain plugin dashboard'
93 'attributes:Display .museattributes rules'
94 'annotate:Attach CRDT annotations to a commit'
95 'blame:Show per-line commit provenance'
96 'reflog:History of HEAD and branch-ref movements'
97 'rerere:Reuse recorded conflict resolutions'
98 'gc:Remove unreachable objects'
99 'archive:Export a historical snapshot'
100 'bisect:Binary search commit history'
101 'worktree:Manage multiple branch checkouts'
102 'workspace:Compose multiple Muse repositories'
103 'rebase:Replay commits onto a new base'
104 'clean:Remove untracked files'
105 'describe:Label a commit by its nearest tag'
106 'shortlog:Summarise history by author or agent'
107 'verify:Check repository integrity'
108 'snapshot:Explicit snapshot management'
109 'bundle:Pack commits into a portable bundle'
110 'content-grep:Search tracked file content'
111 'whoami:Show current identity'
112 'check:Run domain invariant checks'
113 'cat:Print a single tracked symbol'
114 'midi:MIDI domain semantic commands'
115 'code:Code domain semantic commands'
116 'coord:Multi-agent coordination commands'
117 )
118
119 local -a _muse_plumbing_cmds=(
120 'hash-object:SHA-256 a file and optionally store it'
121 'cat-object:Emit raw bytes of a stored object'
122 'rev-parse:Resolve branch or HEAD to a commit ID'
123 'ls-files:List tracked files and object IDs'
124 'read-commit:Emit full commit JSON'
125 'read-snapshot:Emit full snapshot JSON'
126 'commit-tree:Create a commit from an explicit snapshot ID'
127 'update-ref:Move a branch HEAD to a specific commit'
128 'commit-graph:Emit the commit DAG as JSON'
129 'pack-objects:Build a PackBundle to stdout'
130 'unpack-objects:Read a PackBundle from stdin'
131 'ls-remote:List remote branch heads'
132 'merge-base:Find the lowest common ancestor of two commits'
133 'snapshot-diff:Diff two snapshot manifests'
134 'domain-info:Inspect the active domain plugin'
135 'show-ref:List all refs and their commit IDs'
136 'check-ignore:Test paths against .museignore rules'
137 'check-attr:Query merge-strategy attributes for paths'
138 'verify-object:Re-hash stored objects to detect corruption'
139 'symbolic-ref:Read or write HEAD symbolic reference'
140 'for-each-ref:Iterate all refs with rich commit metadata'
141 'name-rev:Map commit IDs to descriptive names'
142 'check-ref-format:Validate branch or ref names'
143 'verify-pack:Verify the integrity of a PackBundle'
144 )
145
146 local -a _muse_midi_cmds=(
147 'notes:List notes in a MIDI track'
148 'note-log:Show note-level history'
149 'note-blame:Show per-note commit provenance'
150 'harmony:Analyse harmonic content'
151 'piano-roll:Render a piano-roll view'
152 'note-hotspots:Find most-changed note regions'
153 'velocity-profile:Plot velocity distribution'
154 'transpose:Shift pitches by semitones'
155 'mix:Merge MIDI tracks'
156 'query:Query note events'
157 'check:Run MIDI domain checks'
158 'rhythm:Analyse rhythmic patterns'
159 'scale:Detect active scales'
160 'contour:Analyse melodic contour'
161 'density:Compute note density over time'
162 'tension:Compute harmonic tension'
163 'cadence:Detect cadence points'
164 'motif:Find recurring motifs'
165 'voice-leading:Analyse voice-leading quality'
166 'instrumentation:List instrumentation per track'
167 'tempo:Display tempo map'
168 'compare:Compare two MIDI commits'
169 'quantize:Snap notes to a rhythmic grid'
170 'humanize:Add expressive timing variation'
171 'invert:Invert intervals around an axis'
172 'retrograde:Reverse note sequence'
173 'arpeggiate:Spread chords into arpeggios'
174 'normalize:Normalise velocity levels'
175 'shard:Split a MIDI file into shards'
176 'agent-map:Show which agents modified which notes'
177 'find-phrase:Search for a melodic phrase'
178 )
179
180 local -a _muse_code_cmds=(
181 # Navigation & reading
182 'cat:Print a symbol'\''s source'
183 'symbols:List symbols in the snapshot'
184 'grep:Search symbol names and bodies'
185 'find-symbol:Search across ALL commits and branches for a symbol'
186 'deps:Show the import graph or call graph for a file or symbol'
187 'languages:List language composition of the repository'
188 # History & provenance
189 'symbol-log:Track a symbol through the entire commit history'
190 'blame:Show which commit last touched a symbol'
191 'lineage:Trace a symbol'\''s full provenance chain'
192 'detect-refactor:Detect renames, extractions, and other refactors'
193 'compare:Deep semantic comparison between two snapshots'
194 'age:How much original implementation remains (evolutionary distance)'
195 'narrative:Plain-English story of a symbol'\''s life'
196 # Analysis
197 'impact:Transitive blast-radius of changing a symbol'
198 'dead:Find unreachable dead-code candidates'
199 'coverage:Which methods of a class are actually called'
200 'hotspots:Symbols that change most often (churn leaderboard)'
201 'stable:Symbols unchanged the longest'
202 'coupling:Files that always change together (hidden coupling)'
203 'entangle:Symbol pairs that change together but have no import link'
204 'gravity:Structural weight — how much depends on each symbol'
205 'blast-risk:Pre-release risk leaderboard: impact × churn × test-gap'
206 'velocity:Symbol-growth rate by module'
207 'predict:Predict which symbols will change next'
208 'contract:Infer behavioral contract from call sites and tests'
209 # API & public surface
210 'api-surface:Show public API surface and changes between commits'
211 'codemap:Semantic topology map of the repository'
212 'clones:Find exact and near-duplicate symbols'
213 'semantic-test-coverage:Static symbol-level test coverage (no test runner)'
214 # Surgical modification
215 'patch:Replace exactly one symbol'\''s source'
216 'rename:Rename a symbol across definition, imports, and call sites'
217 'checkout-symbol:Restore a symbol to a prior version'
218 'semantic-cherry-pick:Cherry-pick specific named symbols from a commit'
219 # Query DSL
220 'query:Query the symbol graph with a predicate DSL'
221 'query-history:Search commit history for symbols matching a predicate'
222 'code-query:Run a structured code query'
223 # Quality gates
224 'breakage:Detect structural breakage in the working tree vs HEAD'
225 'invariants:Check architectural invariants from .muse/invariants.toml'
226 'code-check:Run code-domain invariant checks'
227 'index:Manage the optional local symbol index'
228 # Staging
229 'add:Stage files for commit'
230 'reset:Unstage files'
231 )
232
233 local -a _muse_coord_cmds=(
234 'reserve:Reserve a symbol for exclusive editing'
235 'intent:Declare editing intent'
236 'forecast:Forecast merge conflicts'
237 'plan-merge:Plan a coordinated merge'
238 'shard:Partition work across agents'
239 'reconcile:Reconcile diverged agent branches'
240 )
241
242 # ---------------------------------------------------------------------------
243 # Main dispatcher
244 # ---------------------------------------------------------------------------
245
246 _muse() {
247 local curcontext="$curcontext" state line
248 typeset -A opt_args
249
250 _arguments -C \
251 '(-h --help)'{-h,--help}'[Show help]' \
252 '(-V --version)'{-V,--version}'[Show version]' \
253 '1: :->command' \
254 '*:: :->args' \
255 && return 0
256
257 case $state in
258 command)
259 _describe 'muse commands' _muse_top_cmds
260 ;;
261
262 args)
263 case $words[1] in
264
265 # --- sub-namespaces -----------------------------------------
266 plumbing)
267 _arguments '1: :->sub' '*:: :->plumbing_args'
268 case $state in
269 sub) _describe 'plumbing commands' _muse_plumbing_cmds ;;
270 esac
271 ;;
272
273 midi)
274 _arguments '1: :->sub'
275 case $state in
276 sub) _describe 'midi commands' _muse_midi_cmds ;;
277 esac
278 ;;
279
280 code)
281 _arguments -C '1: :->sub' '*:: :->code_args'
282 case $state in
283 sub) _describe 'code commands' _muse_code_cmds ;;
284 code_args)
285 case $words[1] in
286 add|reset)
287 _files
288 ;;
289 find-symbol)
290 _arguments \
291 '--name[Symbol name or prefix]:name' \
292 '--kind[Symbol kind]:kind:(function class method variable)' \
293 '--hash[Content hash prefix (≥4 chars)]:hash' \
294 '--file[Restrict to file]:file:_files' \
295 '--branch[Search within branch]:branch:_muse_branches' \
296 '--since[Ignore commits before DATE]:date' \
297 '--until[Ignore commits after DATE]:date' \
298 '--limit[Maximum results]:n' \
299 '--first[Show only first appearance]' \
300 '--last[Show only last appearance]' \
301 '--all-branches[Check HEAD of every branch]' \
302 '--count[Print count only]' \
303 '--json[JSON output]'
304 ;;
305 impact)
306 _arguments \
307 '1:address' \
308 '(-c --commit)'{-c,--commit}'[Commit ref]:ref:_muse_branches' \
309 '--depth[Maximum traversal depth]:n' \
310 '--forward[Show callees instead of callers]' \
311 '--compare[Diff blast radius vs ref]:ref:_muse_branches' \
312 '--file[Restrict callers to file]:file:_files' \
313 '--count[Print count only]' \
314 '--json[JSON output]'
315 ;;
316 dead)
317 _arguments \
318 '(-c --commit)'{-c,--commit}'[Commit ref]:ref:_muse_branches' \
319 '--file[Restrict to file]:file:_files' \
320 '--lang[Restrict to language]:lang:(python javascript typescript)' \
321 '--workers[Parallel workers]:n' \
322 '--max-file-bytes[Max file size]:bytes' \
323 '--allowlist[Path to allowlist JSON]:file:_files' \
324 '--delete[Delete dead symbols from disk]' \
325 '--compare[Diff dead candidates vs ref]:ref:_muse_branches' \
326 '--count[Print count only]' \
327 '--save-allowlist[Write candidates to file]:file:_files' \
328 '--json[JSON output]'
329 ;;
330 coverage)
331 _arguments \
332 '1:class address' \
333 '(-c --commit)'{-c,--commit}'[Commit ref]:ref:_muse_branches' \
334 '--compare[Diff coverage vs ref]:ref:_muse_branches' \
335 '--exclude-dunder[Exclude __dunder__ methods]' \
336 '--exclude-private[Exclude _private methods]' \
337 '--min-callers[Minimum callers to count as covered]:n' \
338 '--exclude-self[Exclude calls from same file]' \
339 '--count[Print count only]' \
340 '--json[JSON output]'
341 ;;
342 lineage)
343 _arguments \
344 '1:address' \
345 '(-c --commit)'{-c,--commit}'[Walk commits reachable from ref]:ref:_muse_branches' \
346 '(-b --branch)'{-b,--branch}'[Walk this branch only]:branch:_muse_branches' \
347 '--since[Ignore commits before DATE]:date' \
348 '--until[Ignore commits after DATE]:date' \
349 '--filter[Show only events of this kind]:kind:(created modified deleted renamed_from moved_from copied_from)' \
350 '--stability[Print stability score]' \
351 '--count[Print event count only]' \
352 '--json[JSON output]'
353 ;;
354 api-surface)
355 _arguments \
356 '(-c --commit)'{-c,--commit}'[Commit ref]:ref:_muse_branches' \
357 '--diff[Show changes since ref]:ref:_muse_branches' \
358 '--kind[Filter by kind]:kind:(function class method variable)' \
359 '--file[Restrict to file]:file:_files' \
360 '--count[Print count only]' \
361 '--json[JSON output]'
362 ;;
363 codemap)
364 _arguments \
365 '(-c --commit)'{-c,--commit}'[Commit ref]:ref:_muse_branches' \
366 '--top[Show top N modules]:n' \
367 '--json[JSON output]'
368 ;;
369 clones)
370 _arguments \
371 '(-c --commit)'{-c,--commit}'[Commit ref]:ref:_muse_branches' \
372 '--tier[Detection tier]:tier:(exact near both)' \
373 '--json[JSON output]'
374 ;;
375 deps)
376 _arguments \
377 '1:address or file' \
378 '(-c --commit)'{-c,--commit}'[Commit ref]:ref:_muse_branches' \
379 '--forward[Show dependencies (callees)]' \
380 '--reverse[Show dependents (callers)]' \
381 '--json[JSON output]'
382 ;;
383 query)
384 _arguments \
385 '1:predicate' \
386 '--all-commits[Search all commits]' \
387 '--json[JSON output]'
388 ;;
389 query-history)
390 _arguments \
391 '1:predicate' \
392 '--from[Start ref]:ref:_muse_branches' \
393 '--to[End ref]:ref:_muse_branches' \
394 '--json[JSON output]'
395 ;;
396 detect-refactor)
397 _arguments '--json[JSON output]'
398 ;;
399 checkout-symbol)
400 _arguments \
401 '1:address' \
402 '(-c --commit)'{-c,--commit}'[Source commit ref]:ref:_muse_branches' \
403 '--dry-run[Show changes without applying]'
404 ;;
405 semantic-cherry-pick)
406 _arguments \
407 '*:address' \
408 '--from[Source commit ref]:ref:_muse_branches' \
409 '--dry-run[Show changes without applying]' \
410 '--json[JSON output]'
411 ;;
412 breakage)
413 _arguments \
414 '(-l --language)'{-l,--language}'[Restrict to language]:lang:(Python JavaScript TypeScript)' \
415 '(-c --commit)'{-c,--commit}'[Check against this ref instead of HEAD]:ref:_muse_branches' \
416 '(-p --path)'{-p,--path}'[Only check files matching glob]:pattern:_files' \
417 '--strict[Treat warnings as errors]' \
418 '--json[JSON output]'
419 ;;
420 invariants)
421 _arguments \
422 '(-c --commit)'{-c,--commit}'[Check a historical snapshot]:ref:_muse_branches' \
423 '--json[JSON output]'
424 ;;
425 hotspots|stable|coupling|symbol-log|blame|compare)
426 _arguments \
427 '(-c --commit)'{-c,--commit}'[Commit ref]:ref:_muse_branches' \
428 '--json[JSON output]'
429 ;;
430 age)
431 _arguments \
432 '--top[Show top N symbols]:n' \
433 '--sort[Sort by field]:field:(age churn rewrite)' \
434 '--kind[Filter by kind]:kind:(function class method variable)' \
435 '--file[Restrict to file]:file:_files' \
436 '--since[Ignore commits before DATE]:date' \
437 '--max-commits[Maximum commits to scan]:n' \
438 '--explain[Show per-symbol explanation]' \
439 '--json[JSON output]'
440 ;;
441 blast-risk)
442 _arguments \
443 '--top[Show top N symbols]:n' \
444 '--since[Ignore commits before DATE]:date' \
445 '--max-commits[Maximum commits to scan]:n' \
446 '--kind[Filter by kind]:kind:(function class method variable)' \
447 '--file[Restrict to file]:file:_files' \
448 '--min-risk[Minimum risk score threshold]:score' \
449 '--explain[Show per-symbol explanation]' \
450 '--json[JSON output]'
451 ;;
452 contract)
453 _arguments \
454 '1:address' \
455 '--max-commits[Maximum commits to scan]:n' \
456 '--json[JSON output]'
457 ;;
458 entangle)
459 _arguments \
460 '--top[Show top N pairs]:n' \
461 '--min-co-changes[Minimum co-change count]:n' \
462 '--min-rate[Minimum co-change rate (0–1)]:rate' \
463 '--symbol[Restrict to pairs involving symbol]:address' \
464 '--since[Ignore commits before DATE]:date' \
465 '--max-commits[Maximum commits to scan]:n' \
466 '--include-same-file[Include same-file pairs]' \
467 '--json[JSON output]'
468 ;;
469 gravity)
470 _arguments \
471 '--explain[Show per-symbol dependents]' \
472 '--top[Show top N symbols]:n' \
473 '--sort[Sort by field]:field:(gravity name)' \
474 '--depth[Traversal depth]:n' \
475 '--kind[Filter by kind]:kind:(function class method variable)' \
476 '--file[Restrict to file]:file:_files' \
477 '--min-gravity[Minimum gravity threshold]:n' \
478 '--include-tests[Include test files in dependents]' \
479 '--json[JSON output]'
480 ;;
481 narrative)
482 _arguments \
483 '1:address' \
484 '--format[Output format]:fmt:(text markdown)' \
485 '--show-source[Include source diffs]' \
486 '--since[Ignore commits before DATE]:date' \
487 '--max-commits[Maximum commits to scan]:n' \
488 '--json[JSON output]'
489 ;;
490 predict)
491 _arguments \
492 '--horizon[Prediction window in commits]:n' \
493 '--max-commits[Commits to train on]:n' \
494 '--top[Show top N predictions]:n' \
495 '--min-confidence[Minimum confidence (0–1)]:score' \
496 '--explain[Show prediction rationale]' \
497 '--kind[Filter by kind]:kind:(function class method variable)' \
498 '--file[Restrict to file]:file:_files' \
499 '--module-depth[Module granularity]:n' \
500 '--json[JSON output]'
501 ;;
502 rename)
503 _arguments \
504 '1:address' \
505 '2:new name' \
506 '--scope[Rename scope]:scope:(repo file)' \
507 '--max-files[Maximum files to update]:n' \
508 '(-y --yes)'{-y,--yes}'[Skip confirmation]' \
509 '--dry-run[Show changes without applying]' \
510 '--force[Rename even with uncommitted changes]' \
511 '--json[JSON output]'
512 ;;
513 semantic-test-coverage)
514 _arguments \
515 '--file[Restrict to file]:file:_files' \
516 '--kind[Filter by kind]:kind:(function class method variable)' \
517 '--transitive[Follow transitive calls]' \
518 '--depth[Transitive depth]:n' \
519 '--uncovered-only[Show only uncovered symbols]' \
520 '--show-tests[List covering tests per symbol]' \
521 '--min-coverage[Minimum coverage ratio (0–1)]:ratio' \
522 '--json[JSON output]'
523 ;;
524 velocity)
525 _arguments \
526 '--window[Time window (commits)]:n' \
527 '--top[Show top N modules]:n' \
528 '--predict[Include growth prediction]' \
529 '--since[Ignore commits before DATE]:date' \
530 '--max-commits[Maximum commits to scan]:n' \
531 '--json[JSON output]'
532 ;;
533 grep)
534 _arguments \
535 '1:pattern' \
536 '--json[JSON output]'
537 ;;
538 cat)
539 _arguments '1:address'
540 ;;
541 patch)
542 _arguments \
543 '1:address' \
544 '2:file:_files'
545 ;;
546 esac
547 ;;
548 esac
549 ;;
550
551 coord)
552 _arguments '1: :->sub'
553 case $state in
554 sub) _describe 'coord commands' _muse_coord_cmds ;;
555 esac
556 ;;
557
558 # --- branch-aware commands -----------------------------------
559 checkout)
560 _arguments \
561 '(-b --branch)'{-b,--branch}'[Create new branch]:branch:_muse_branches' \
562 '(-f --force)'{-f,--force}'[Force checkout]' \
563 '1: :_muse_branches'
564 ;;
565
566 merge)
567 _arguments \
568 '--no-commit[Do not auto-commit after merge]' \
569 '--squash[Squash into a single commit]' \
570 '--strategy[Merge strategy]:strategy:(ours theirs union)' \
571 '1: :_muse_branches'
572 ;;
573
574 branch)
575 _arguments \
576 '(-d --delete)'{-d,--delete}'[Delete a branch]:branch:_muse_branches' \
577 '(-D --force-delete)'{-D,--force-delete}'[Force-delete a branch]:branch:_muse_branches' \
578 '(-m --move)'{-m,--move}'[Rename a branch]:branch:_muse_branches' \
579 '1:: :_muse_branches'
580 ;;
581
582 cherry-pick)
583 _arguments \
584 '(-n --no-commit)'{-n,--no-commit}'[Stage without committing]' \
585 '1: :_muse_branches'
586 ;;
587
588 rebase)
589 _arguments \
590 '--onto[New base branch]:branch:_muse_branches' \
591 '1: :_muse_branches'
592 ;;
593
594 # --- remote-aware commands -----------------------------------
595 push)
596 _arguments \
597 '(-b --branch)'{-b,--branch}'[Branch to push]:branch:_muse_branches' \
598 '(-u --set-upstream)'{-u,--set-upstream}'[Set upstream tracking]' \
599 '--force[Force push even if remote diverged]' \
600 '1:: :_muse_remotes' \
601 '2:: :_muse_branches'
602 ;;
603
604 pull)
605 _arguments \
606 '(-b --branch)'{-b,--branch}'[Branch to pull into]:branch:_muse_branches' \
607 '--rebase[Rebase instead of merge]' \
608 '--no-commit[Do not auto-commit after merge]' \
609 '1:: :_muse_remotes' \
610 '2:: :_muse_branches'
611 ;;
612
613 fetch)
614 _arguments \
615 '(-b --branch)'{-b,--branch}'[Specific branch to fetch]:branch:_muse_branches' \
616 '--all[Fetch from all configured remotes]' \
617 '1:: :_muse_remotes'
618 ;;
619
620 clone)
621 _arguments \
622 '(-b --branch)'{-b,--branch}'[Branch to check out after clone]:branch' \
623 '--name[Override repo directory name]:name' \
624 '1: :_urls'
625 ;;
626
627 # --- simple flag commands ------------------------------------
628 commit)
629 _arguments \
630 '(-m --message)'{-m,--message}'[Commit message]:message' \
631 '--allow-empty[Allow a commit with no changes]' \
632 '--sign[Sign the commit]' \
633 '(-f --format)'{-f,--format}'[Output format]:fmt:(text json)'
634 ;;
635
636 status)
637 _arguments \
638 '(-s --short)'{-s,--short}'[Condensed output]' \
639 '--porcelain[Machine-readable output]' \
640 '(-b --branch)'{-b,--branch}'[Show branch only]' \
641 '(-f --format)'{-f,--format}'[Output format]:fmt:(text json)'
642 ;;
643
644 log)
645 _arguments \
646 '(-n --max-count)'{-n,--max-count}'[Limit number of commits]:count' \
647 '--oneline[Compact one-line output]' \
648 '--graph[Show commit graph]' \
649 '(-f --format)'{-f,--format}'[Output format]:fmt:(text json)'
650 ;;
651
652 diff)
653 _arguments \
654 '--stat[Show diffstat summary]' \
655 '(-f --format)'{-f,--format}'[Output format]:fmt:(text json)' \
656 '1:: :_muse_branches' \
657 '2:: :_muse_branches'
658 ;;
659
660 show)
661 _arguments \
662 '(-f --format)'{-f,--format}'[Output format]:fmt:(text json)' \
663 '1:: :_muse_branches'
664 ;;
665
666 reset)
667 _arguments \
668 '--hard[Discard working tree changes]' \
669 '--soft[Keep working tree changes staged]' \
670 '1:: :_muse_branches'
671 ;;
672
673 tag)
674 _arguments \
675 '(-d --delete)'{-d,--delete}'[Delete a tag]' \
676 '(-l --list)'{-l,--list}'[List tags]' \
677 '(-f --format)'{-f,--format}'[Output format]:fmt:(text json)'
678 ;;
679
680 stash)
681 _arguments \
682 '1:: :(push pop list drop show apply)'
683 ;;
684
685 remote)
686 _arguments \
687 '1:: :(add remove list rename set-url show)'
688 ;;
689
690 auth)
691 _arguments \
692 '1:: :(login logout whoami)'
693 ;;
694
695 hub)
696 _arguments \
697 '1:: :(connect disconnect status ping)'
698 ;;
699
700 config)
701 _arguments \
702 '1:: :(show get set edit)'
703 ;;
704 esac
705 ;;
706 esac
707 }
708
709 _muse "$@"
File History 3 commits
sha256:660fcac1df3ab28f61862e961890bd2ca8b754fa0242079d93ca1e25037ec8a6 chore(tests): add docstring to tests/__init__.py so rc14 tr… Human 26 days ago
sha256:d8316ffae901be06347e16ab55be11868eb519dd16ade3e8aa16a99e662f7e62 baseline: rc14 re-baseline after rc3 store corruption recovery Human patch 26 days ago
sha256:1c4b3e3a9a1f300774c3ee662b572a698d5fd405bf765a71e6011a2e9c3eaaaa feat: Muse — version control for the agent era Human 100 days ago