# Print an optspec for argparse to handle cmd's options that are independent of any subcommand. function __fish_am_global_optspecs string join \n h/help V/version end function __fish_am_needs_command # Figure out if the current invocation already has a command. set -l cmd (commandline -opc) set -e cmd[1] argparse -s (__fish_am_global_optspecs) -- $cmd 2>/dev/null or return if set -q argv[1] # Also print the command, so this can be used to figure out what it is. echo $argv[1] return 1 end return 0 end function __fish_am_using_subcommand set -l cmd (__fish_am_needs_command) test -z "$cmd" and return 1 contains -- $cmd[1] $argv end complete -c am -n "__fish_am_needs_command" -s h -l help -d 'Print help' complete -c am -n "__fish_am_needs_command" -s V -l version -d 'Print version' complete -c am -n "__fish_am_needs_command" -f -a "add" -d 'Add a new alias' complete -c am -n "__fish_am_needs_command" -f -a "remove" -d 'Remove an alias' complete -c am -n "__fish_am_needs_command" -f -a "ls" -d 'List all profiles and project aliases' complete -c am -n "__fish_am_needs_command" -f -a "la" -d 'List all active profiles and project aliases' complete -c am -n "__fish_am_needs_command" -f -a "status" -d 'Check if the shell is set up correctly' complete -c am -n "__fish_am_needs_command" -f -a "profile" -d 'Manage profiles (defaults to listing when no subcommand given)' complete -c am -n "__fish_am_needs_command" -f -a "var" -d 'Manage alias variables — substituted as `{{name}}` in alias commands' complete -c am -n "__fish_am_needs_command" -f -a "init" -d 'Print shell init code' complete -c am -n "__fish_am_needs_command" -f -a "setup" -d 'Guided setup — adds amoxide to your shell profile' complete -c am -n "__fish_am_needs_command" -f -a "use" -d 'Shortcut for `am profile use` — toggle one or more profiles' complete -c am -n "__fish_am_needs_command" -f -a "tui" -d 'Launch the interactive TUI for managing aliases and profiles' complete -c am -n "__fish_am_needs_command" -f -a "export" -d 'Export aliases to stdout as TOML' complete -c am -n "__fish_am_needs_command" -f -a "import" -d 'Import aliases from a URL or file' complete -c am -n "__fish_am_needs_command" -f -a "share" -d 'Generate a share command for posting aliases to a pastebin service' complete -c am -n "__fish_am_needs_command" -f -a "trust" -d 'Review and trust the project .aliases file in the current directory' complete -c am -n "__fish_am_needs_command" -f -a "untrust" -d 'Remove trust for the project .aliases file in the current directory' complete -c am -n "__fish_am_needs_command" -f -a "sync" -d 'Internal: compute and emit the minimal shell ops to sync the shell with the effective merged alias state (global + profile + project)' complete -c am -n "__fish_am_needs_command" -f -a "__update-check" -d 'Internal: refresh the update-check cache from crates.io. Spawned detached by the listing commands; never invoked directly by users' complete -c am -n "__fish_am_needs_command" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' complete -c am -n "__fish_am_using_subcommand add" -s p -l profile -d 'Operate on a specific profile (defaults to active profile)' -r complete -c am -n "__fish_am_using_subcommand add" -l sub -d 'Define a subcommand alias (repeatable: --sub short long)' -r complete -c am -n "__fish_am_using_subcommand add" -s l -l local -d 'Operate on the project\'s .aliases file' complete -c am -n "__fish_am_using_subcommand add" -s g -l global -d 'Operate on global config' complete -c am -n "__fish_am_using_subcommand add" -l raw -d 'Disable {{N}} template detection (treat command as literal)' complete -c am -n "__fish_am_using_subcommand add" -s h -l help -d 'Print help' complete -c am -n "__fish_am_using_subcommand add" -s V -l version -d 'Print version' complete -c am -n "__fish_am_using_subcommand remove" -s p -l profile -d 'Operate on a specific profile (defaults to active profile)' -r complete -c am -n "__fish_am_using_subcommand remove" -l sub -d 'Subcommand path segments to complete the key (e.g. --sub b --sub l removes jj:b:l)' -r complete -c am -n "__fish_am_using_subcommand remove" -s l -l local -d 'Operate on the project\'s .aliases file' complete -c am -n "__fish_am_using_subcommand remove" -s g -l global -d 'Operate on global config' complete -c am -n "__fish_am_using_subcommand remove" -s h -l help -d 'Print help' complete -c am -n "__fish_am_using_subcommand remove" -s V -l version -d 'Print version' complete -c am -n "__fish_am_using_subcommand ls" -s u -l used -d 'Show only active profiles and loaded project aliases' complete -c am -n "__fish_am_using_subcommand ls" -s h -l help -d 'Print help' complete -c am -n "__fish_am_using_subcommand ls" -s V -l version -d 'Print version' complete -c am -n "__fish_am_using_subcommand la" -s h -l help -d 'Print help' complete -c am -n "__fish_am_using_subcommand la" -s V -l version -d 'Print version' complete -c am -n "__fish_am_using_subcommand status" -s h -l help -d 'Print help' complete -c am -n "__fish_am_using_subcommand status" -s V -l version -d 'Print version' complete -c am -n "__fish_am_using_subcommand profile; and not __fish_seen_subcommand_from add use remove list help" -s h -l help -d 'Print help' complete -c am -n "__fish_am_using_subcommand profile; and not __fish_seen_subcommand_from add use remove list help" -s V -l version -d 'Print version' complete -c am -n "__fish_am_using_subcommand profile; and not __fish_seen_subcommand_from add use remove list help" -f -a "add" -d 'Add a new profile' complete -c am -n "__fish_am_using_subcommand profile; and not __fish_seen_subcommand_from add use remove list help" -f -a "use" -d 'Toggle one or more profiles as active/inactive, optionally at a specific priority' complete -c am -n "__fish_am_using_subcommand profile; and not __fish_seen_subcommand_from add use remove list help" -f -a "remove" -d 'Remove a profile' complete -c am -n "__fish_am_using_subcommand profile; and not __fish_seen_subcommand_from add use remove list help" -f -a "list" -d 'List all profiles' complete -c am -n "__fish_am_using_subcommand profile; and not __fish_seen_subcommand_from add use remove list help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' complete -c am -n "__fish_am_using_subcommand profile; and __fish_seen_subcommand_from add" -s h -l help -d 'Print help' complete -c am -n "__fish_am_using_subcommand profile; and __fish_seen_subcommand_from add" -s V -l version -d 'Print version' complete -c am -n "__fish_am_using_subcommand profile; and __fish_seen_subcommand_from use" -s n -l priority -d 'Activate at specific priority position (1-based). Repositions if already active' -r complete -c am -n "__fish_am_using_subcommand profile; and __fish_seen_subcommand_from use" -s e -l enable -d 'Enable given profile(s), does not toggle' complete -c am -n "__fish_am_using_subcommand profile; and __fish_seen_subcommand_from use" -s d -l disable -d 'Disable given profile(s), does not toggle' complete -c am -n "__fish_am_using_subcommand profile; and __fish_seen_subcommand_from use" -s i -l inverse -d 'Reverse the processing order (first listed = highest priority)' complete -c am -n "__fish_am_using_subcommand profile; and __fish_seen_subcommand_from use" -s h -l help -d 'Print help' complete -c am -n "__fish_am_using_subcommand profile; and __fish_seen_subcommand_from use" -s V -l version -d 'Print version' complete -c am -n "__fish_am_using_subcommand profile; and __fish_seen_subcommand_from remove" -s f -l force -d 'Skip confirmation prompt' complete -c am -n "__fish_am_using_subcommand profile; and __fish_seen_subcommand_from remove" -s h -l help -d 'Print help' complete -c am -n "__fish_am_using_subcommand profile; and __fish_seen_subcommand_from remove" -s V -l version -d 'Print version' complete -c am -n "__fish_am_using_subcommand profile; and __fish_seen_subcommand_from list" -s u -l used -d 'Show only active profiles and loaded project aliases' complete -c am -n "__fish_am_using_subcommand profile; and __fish_seen_subcommand_from list" -s h -l help -d 'Print help' complete -c am -n "__fish_am_using_subcommand profile; and __fish_seen_subcommand_from list" -s V -l version -d 'Print version' complete -c am -n "__fish_am_using_subcommand profile; and __fish_seen_subcommand_from help" -f -a "add" -d 'Add a new profile' complete -c am -n "__fish_am_using_subcommand profile; and __fish_seen_subcommand_from help" -f -a "use" -d 'Toggle one or more profiles as active/inactive, optionally at a specific priority' complete -c am -n "__fish_am_using_subcommand profile; and __fish_seen_subcommand_from help" -f -a "remove" -d 'Remove a profile' complete -c am -n "__fish_am_using_subcommand profile; and __fish_seen_subcommand_from help" -f -a "list" -d 'List all profiles' complete -c am -n "__fish_am_using_subcommand profile; and __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' complete -c am -n "__fish_am_using_subcommand var; and not __fish_seen_subcommand_from set unset get list help" -s h -l help -d 'Print help' complete -c am -n "__fish_am_using_subcommand var; and not __fish_seen_subcommand_from set unset get list help" -s V -l version -d 'Print version' complete -c am -n "__fish_am_using_subcommand var; and not __fish_seen_subcommand_from set unset get list help" -f -a "set" -d 'Set a variable\'s value (upsert)' complete -c am -n "__fish_am_using_subcommand var; and not __fish_seen_subcommand_from set unset get list help" -f -a "unset" -d 'Remove a variable' complete -c am -n "__fish_am_using_subcommand var; and not __fish_seen_subcommand_from set unset get list help" -f -a "get" -d 'Print a variable\'s value' complete -c am -n "__fish_am_using_subcommand var; and not __fish_seen_subcommand_from set unset get list help" -f -a "list" -d 'List variables (all scopes if no flag given)' complete -c am -n "__fish_am_using_subcommand var; and not __fish_seen_subcommand_from set unset get list help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' complete -c am -n "__fish_am_using_subcommand var; and __fish_seen_subcommand_from set" -s p -l profile -d 'Operate on a specific profile (defaults to active profile)' -r complete -c am -n "__fish_am_using_subcommand var; and __fish_seen_subcommand_from set" -s l -l local -d 'Operate on the project\'s .aliases file' complete -c am -n "__fish_am_using_subcommand var; and __fish_seen_subcommand_from set" -s g -l global -d 'Operate on global config' complete -c am -n "__fish_am_using_subcommand var; and __fish_seen_subcommand_from set" -s h -l help -d 'Print help' complete -c am -n "__fish_am_using_subcommand var; and __fish_seen_subcommand_from set" -s V -l version -d 'Print version' complete -c am -n "__fish_am_using_subcommand var; and __fish_seen_subcommand_from unset" -s p -l profile -d 'Operate on a specific profile (defaults to active profile)' -r complete -c am -n "__fish_am_using_subcommand var; and __fish_seen_subcommand_from unset" -s l -l local -d 'Operate on the project\'s .aliases file' complete -c am -n "__fish_am_using_subcommand var; and __fish_seen_subcommand_from unset" -s g -l global -d 'Operate on global config' complete -c am -n "__fish_am_using_subcommand var; and __fish_seen_subcommand_from unset" -s h -l help -d 'Print help' complete -c am -n "__fish_am_using_subcommand var; and __fish_seen_subcommand_from unset" -s V -l version -d 'Print version' complete -c am -n "__fish_am_using_subcommand var; and __fish_seen_subcommand_from get" -s p -l profile -d 'Operate on a specific profile (defaults to active profile)' -r complete -c am -n "__fish_am_using_subcommand var; and __fish_seen_subcommand_from get" -s l -l local -d 'Operate on the project\'s .aliases file' complete -c am -n "__fish_am_using_subcommand var; and __fish_seen_subcommand_from get" -s g -l global -d 'Operate on global config' complete -c am -n "__fish_am_using_subcommand var; and __fish_seen_subcommand_from get" -s h -l help -d 'Print help' complete -c am -n "__fish_am_using_subcommand var; and __fish_seen_subcommand_from get" -s V -l version -d 'Print version' complete -c am -n "__fish_am_using_subcommand var; and __fish_seen_subcommand_from list" -s p -l profile -d 'Operate on a specific profile (defaults to active profile)' -r complete -c am -n "__fish_am_using_subcommand var; and __fish_seen_subcommand_from list" -s l -l local -d 'Operate on the project\'s .aliases file' complete -c am -n "__fish_am_using_subcommand var; and __fish_seen_subcommand_from list" -s g -l global -d 'Operate on global config' complete -c am -n "__fish_am_using_subcommand var; and __fish_seen_subcommand_from list" -s h -l help -d 'Print help' complete -c am -n "__fish_am_using_subcommand var; and __fish_seen_subcommand_from list" -s V -l version -d 'Print version' complete -c am -n "__fish_am_using_subcommand var; and __fish_seen_subcommand_from help" -f -a "set" -d 'Set a variable\'s value (upsert)' complete -c am -n "__fish_am_using_subcommand var; and __fish_seen_subcommand_from help" -f -a "unset" -d 'Remove a variable' complete -c am -n "__fish_am_using_subcommand var; and __fish_seen_subcommand_from help" -f -a "get" -d 'Print a variable\'s value' complete -c am -n "__fish_am_using_subcommand var; and __fish_seen_subcommand_from help" -f -a "list" -d 'List variables (all scopes if no flag given)' complete -c am -n "__fish_am_using_subcommand var; and __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' complete -c am -n "__fish_am_using_subcommand init" -s f -l force -d 'Force re-initialisation: unload all previously tracked aliases (both alias and function forms) before re-loading. Use after config changes such as toggling `use_abbr`' complete -c am -n "__fish_am_using_subcommand init" -s h -l help -d 'Print help (see more with \'--help\')' complete -c am -n "__fish_am_using_subcommand init" -s V -l version -d 'Print version' complete -c am -n "__fish_am_using_subcommand setup" -s h -l help -d 'Print help' complete -c am -n "__fish_am_using_subcommand setup" -s V -l version -d 'Print version' complete -c am -n "__fish_am_using_subcommand use" -s n -l priority -d 'Activate at specific priority position (1-based). Repositions if already active' -r complete -c am -n "__fish_am_using_subcommand use" -s e -l enable -d 'Enable given profile(s), does not toggle' complete -c am -n "__fish_am_using_subcommand use" -s d -l disable -d 'Disable given profile(s), does not toggle' complete -c am -n "__fish_am_using_subcommand use" -s i -l inverse -d 'Reverse the processing order (first listed = highest priority)' complete -c am -n "__fish_am_using_subcommand use" -s h -l help -d 'Print help' complete -c am -n "__fish_am_using_subcommand use" -s V -l version -d 'Print version' complete -c am -n "__fish_am_using_subcommand tui" -s h -l help -d 'Print help' complete -c am -n "__fish_am_using_subcommand tui" -s V -l version -d 'Print version' complete -c am -n "__fish_am_using_subcommand export" -s p -l profile -d 'Operate on specific profile(s) — can be repeated' -r complete -c am -n "__fish_am_using_subcommand export" -s l -l local -d 'Operate on project-local aliases' complete -c am -n "__fish_am_using_subcommand export" -s g -l global -d 'Operate on global aliases' complete -c am -n "__fish_am_using_subcommand export" -l all -d 'Operate on everything (global + all profiles + local)' complete -c am -n "__fish_am_using_subcommand export" -s b -l base64 -d 'Encode output as base64' complete -c am -n "__fish_am_using_subcommand export" -s h -l help -d 'Print help' complete -c am -n "__fish_am_using_subcommand export" -s V -l version -d 'Print version' complete -c am -n "__fish_am_using_subcommand import" -s p -l profile -d 'Operate on specific profile(s) — can be repeated' -r complete -c am -n "__fish_am_using_subcommand import" -s l -l local -d 'Operate on project-local aliases' complete -c am -n "__fish_am_using_subcommand import" -s g -l global -d 'Operate on global aliases' complete -c am -n "__fish_am_using_subcommand import" -l all -d 'Operate on everything (global + all profiles + local)' complete -c am -n "__fish_am_using_subcommand import" -s b -l base64 -d 'Decode base64 input before parsing' complete -c am -n "__fish_am_using_subcommand import" -s y -l yes -d 'Skip all confirmation prompts' complete -c am -n "__fish_am_using_subcommand import" -l trust -d 'DANGER: Skip safety checks for suspicious content (escape sequences). Only use for your own exports. Never trust external input blindly — it can carry invisible escape sequences that hide malicious commands' complete -c am -n "__fish_am_using_subcommand import" -s h -l help -d 'Print help' complete -c am -n "__fish_am_using_subcommand import" -s V -l version -d 'Print version' complete -c am -n "__fish_am_using_subcommand share" -s p -l profile -d 'Operate on specific profile(s) — can be repeated' -r complete -c am -n "__fish_am_using_subcommand share" -s l -l local -d 'Operate on project-local aliases' complete -c am -n "__fish_am_using_subcommand share" -s g -l global -d 'Operate on global aliases' complete -c am -n "__fish_am_using_subcommand share" -l all -d 'Operate on everything (global + all profiles + local)' complete -c am -n "__fish_am_using_subcommand share" -l termbin -d 'Generate command for termbin.com (netcat)' complete -c am -n "__fish_am_using_subcommand share" -l paste-rs -d 'Generate command for paste.rs (curl)' complete -c am -n "__fish_am_using_subcommand share" -s h -l help -d 'Print help' complete -c am -n "__fish_am_using_subcommand share" -s V -l version -d 'Print version' complete -c am -n "__fish_am_using_subcommand trust" -s h -l help -d 'Print help' complete -c am -n "__fish_am_using_subcommand trust" -s V -l version -d 'Print version' complete -c am -n "__fish_am_using_subcommand untrust" -s f -l forget -d 'Forget the path entirely (remove from security tracking instead of marking untrusted)' complete -c am -n "__fish_am_using_subcommand untrust" -s h -l help -d 'Print help' complete -c am -n "__fish_am_using_subcommand untrust" -s V -l version -d 'Print version' complete -c am -n "__fish_am_using_subcommand sync" -s q -l quiet -d 'Suppress info and warning messages (still unloads/loads aliases)' complete -c am -n "__fish_am_using_subcommand sync" -s h -l help -d 'Print help' complete -c am -n "__fish_am_using_subcommand sync" -s V -l version -d 'Print version' complete -c am -n "__fish_am_using_subcommand __update-check" -s h -l help -d 'Print help' complete -c am -n "__fish_am_using_subcommand __update-check" -s V -l version -d 'Print version' complete -c am -n "__fish_am_using_subcommand help; and not __fish_seen_subcommand_from add remove ls la status profile var init setup use tui export import share trust untrust sync __update-check help" -f -a "add" -d 'Add a new alias' complete -c am -n "__fish_am_using_subcommand help; and not __fish_seen_subcommand_from add remove ls la status profile var init setup use tui export import share trust untrust sync __update-check help" -f -a "remove" -d 'Remove an alias' complete -c am -n "__fish_am_using_subcommand help; and not __fish_seen_subcommand_from add remove ls la status profile var init setup use tui export import share trust untrust sync __update-check help" -f -a "ls" -d 'List all profiles and project aliases' complete -c am -n "__fish_am_using_subcommand help; and not __fish_seen_subcommand_from add remove ls la status profile var init setup use tui export import share trust untrust sync __update-check help" -f -a "la" -d 'List all active profiles and project aliases' complete -c am -n "__fish_am_using_subcommand help; and not __fish_seen_subcommand_from add remove ls la status profile var init setup use tui export import share trust untrust sync __update-check help" -f -a "status" -d 'Check if the shell is set up correctly' complete -c am -n "__fish_am_using_subcommand help; and not __fish_seen_subcommand_from add remove ls la status profile var init setup use tui export import share trust untrust sync __update-check help" -f -a "profile" -d 'Manage profiles (defaults to listing when no subcommand given)' complete -c am -n "__fish_am_using_subcommand help; and not __fish_seen_subcommand_from add remove ls la status profile var init setup use tui export import share trust untrust sync __update-check help" -f -a "var" -d 'Manage alias variables — substituted as `{{name}}` in alias commands' complete -c am -n "__fish_am_using_subcommand help; and not __fish_seen_subcommand_from add remove ls la status profile var init setup use tui export import share trust untrust sync __update-check help" -f -a "init" -d 'Print shell init code' complete -c am -n "__fish_am_using_subcommand help; and not __fish_seen_subcommand_from add remove ls la status profile var init setup use tui export import share trust untrust sync __update-check help" -f -a "setup" -d 'Guided setup — adds amoxide to your shell profile' complete -c am -n "__fish_am_using_subcommand help; and not __fish_seen_subcommand_from add remove ls la status profile var init setup use tui export import share trust untrust sync __update-check help" -f -a "use" -d 'Shortcut for `am profile use` — toggle one or more profiles' complete -c am -n "__fish_am_using_subcommand help; and not __fish_seen_subcommand_from add remove ls la status profile var init setup use tui export import share trust untrust sync __update-check help" -f -a "tui" -d 'Launch the interactive TUI for managing aliases and profiles' complete -c am -n "__fish_am_using_subcommand help; and not __fish_seen_subcommand_from add remove ls la status profile var init setup use tui export import share trust untrust sync __update-check help" -f -a "export" -d 'Export aliases to stdout as TOML' complete -c am -n "__fish_am_using_subcommand help; and not __fish_seen_subcommand_from add remove ls la status profile var init setup use tui export import share trust untrust sync __update-check help" -f -a "import" -d 'Import aliases from a URL or file' complete -c am -n "__fish_am_using_subcommand help; and not __fish_seen_subcommand_from add remove ls la status profile var init setup use tui export import share trust untrust sync __update-check help" -f -a "share" -d 'Generate a share command for posting aliases to a pastebin service' complete -c am -n "__fish_am_using_subcommand help; and not __fish_seen_subcommand_from add remove ls la status profile var init setup use tui export import share trust untrust sync __update-check help" -f -a "trust" -d 'Review and trust the project .aliases file in the current directory' complete -c am -n "__fish_am_using_subcommand help; and not __fish_seen_subcommand_from add remove ls la status profile var init setup use tui export import share trust untrust sync __update-check help" -f -a "untrust" -d 'Remove trust for the project .aliases file in the current directory' complete -c am -n "__fish_am_using_subcommand help; and not __fish_seen_subcommand_from add remove ls la status profile var init setup use tui export import share trust untrust sync __update-check help" -f -a "sync" -d 'Internal: compute and emit the minimal shell ops to sync the shell with the effective merged alias state (global + profile + project)' complete -c am -n "__fish_am_using_subcommand help; and not __fish_seen_subcommand_from add remove ls la status profile var init setup use tui export import share trust untrust sync __update-check help" -f -a "__update-check" -d 'Internal: refresh the update-check cache from crates.io. Spawned detached by the listing commands; never invoked directly by users' complete -c am -n "__fish_am_using_subcommand help; and not __fish_seen_subcommand_from add remove ls la status profile var init setup use tui export import share trust untrust sync __update-check help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' complete -c am -n "__fish_am_using_subcommand help; and __fish_seen_subcommand_from profile" -f -a "add" -d 'Add a new profile' complete -c am -n "__fish_am_using_subcommand help; and __fish_seen_subcommand_from profile" -f -a "use" -d 'Toggle one or more profiles as active/inactive, optionally at a specific priority' complete -c am -n "__fish_am_using_subcommand help; and __fish_seen_subcommand_from profile" -f -a "remove" -d 'Remove a profile' complete -c am -n "__fish_am_using_subcommand help; and __fish_seen_subcommand_from profile" -f -a "list" -d 'List all profiles' complete -c am -n "__fish_am_using_subcommand help; and __fish_seen_subcommand_from var" -f -a "set" -d 'Set a variable\'s value (upsert)' complete -c am -n "__fish_am_using_subcommand help; and __fish_seen_subcommand_from var" -f -a "unset" -d 'Remove a variable' complete -c am -n "__fish_am_using_subcommand help; and __fish_seen_subcommand_from var" -f -a "get" -d 'Print a variable\'s value' complete -c am -n "__fish_am_using_subcommand help; and __fish_seen_subcommand_from var" -f -a "list" -d 'List variables (all scopes if no flag given)'