#compdef vybe
# zsh completion for vybe
local -a commands
commands=(
  "run:Run command and capture output"
  "r:Alias for run"
  "retry:Re-run the last vybe run command"
  "rr:Alias for retry"
  "last:Print most recent capture"
  "l:Alias for last"
  "snip:Print output only (strip header)"
  "s:Alias for snip"
  "snipclip:Copy output only to clipboard"
  "sc:Alias for snipclip"
  "cmdcopy:Copy only the last command"
  "cc:Alias for cmdcopy"
  "tail:Tail most recent capture"
  "open:Open most recent capture in pager"
  "o:Alias for open"
  "ls:List captures"
  "ll:Alias for ls"
  "grep:Grep most recent capture"
  "md:Wrap capture in Markdown fences"
  "clip:Copy most recent capture to clipboard"
  "fail:Select most recent failing run"
  "errors:Extract likely error blocks"
  "history:Copy last N commands+outputs together"
  "select:Interactively pick captures (requires fzf)"
  "export:Export latest capture in JSON"
  "diff:Diff latest vs previous capture"
  "share:Build Markdown/JSON share bundle"
  "prompt:Generate LLM-ready prompt"
  "watch:Auto-rerun on file changes"
  "cwd:Remember/restore working directory"
  "clean:Clean up old captures"
  "stats:Show stats on runs"
  "link:Start web server (dev)"
  "flow:Save/replay command sequences"
  "doctor:Print environment diagnostics"
  "project:Show project structure and metadata"
  "proj:Alias for project"
  "self-check:Check install and update guidance"
  "cfg:Print config and paths"
  "init:Initialize vybe defaults"
  "completion:Install shell completion"
  "tags:List known tags"
  "pane:Capture tmux pane scrollback"
  "man:Show full manual"
  "version:Print version"
  "help:Show help"
)
_arguments -C   '1:command:->cmds'   '*::arg:->args'

case $state in
  cmds)
    _describe -t commands 'vybe commands' commands
  ;;
  args)
    # basic completion: nothing fancy yet
  ;;
esac
