fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
01d7f9391
master
1# npm (https://npmjs.org) completions for Fish shell 2# __fish_npm_needs_* and __fish_npm_using_* taken from: 3# https://stackoverflow.com/questions/16657803/creating-autocomplete-script-with-sub-commands 4# see also Fish's large set of completions for examples: 5# https://github.com/fish-shell/fish-shell/tree/master/share/completions 6 7__fish_npm_helper 8set -l npm_install"npm install --global" 9 10function __fish_npm_needs_command 11set -l cmd( commandline -xpc) 12 13if test ( count $cmd ) -eq 1 14return 0 15end 16 17return 1 18end 19 20function __fish_npm_using_command 21set -l cmd( commandline -xpc) 22 23if test ( count $cmd ) -gt 1 24if contains --$cmd [ 2 ] $argv 25return 0 26end 27end 28 29return 1 30end 31 32function __fish_npm_needs_option 33switch ( commandline -ct) 34case "-*" 35return 0 36end 37return 1 38end 39 40# list available npm scripts and their partial content 41function __fish_parse_npm_run_completions 42while read -l name 43set -l trim20 44read -l value 45set value( string sub -l$trim --$value ) 46printf "%s\t%s\n" $name $value 47end 48end 49 50function __fish_npm_run 51# Complete `npm run` scripts 52# These are stored in package.json, which we need a tool to read. 53# python is very probably installed (we use it for other things!), 54# jq is slower but also a common tool, 55# npm is dog-slow and might check for updates online! 56if test -e package.json;and set -l python( __fish_anypython ) 57# Warning: That weird indentation is necessary, because python. 58$python -S -c'import json, sys; data = json.load(sys.stdin); 59for k,v in data["scripts"].items(): print(k + "\t" + v[:18])' < package.json2> /dev/null 60else if command -sq jq;and test -e package.json 61jq -r'.scripts | to_entries | map("\(.key)\t\(.value | tostring | .[0:20])") | .[]' package.json 62else if command -sq npm 63# Like above, only try to call npm if there's a command by that name to facilitate aliases that call nvm. 64command npm run| string match -r -v'^[^ ]|^$' | string trim| __fish_parse_npm_run_completions 65end 66end 67 68# run 69complete -f -c npm -n __fish_npm_needs_command -a'run-script run' -d'Run arbitrary package scripts' 70for cin run-script run rum urn 71complete -f -c npm -n"__fish_npm_using_command $c " -a"(__fish_npm_run)" 72complete -f -c npm -n"__fish_npm_using_command $c " -l if-present -d"Don't error on nonexistent script" 73complete -f -c npm -n"__fish_npm_using_command $c " -l ignore-scripts -d"Don't run pre-, post- and life-cycle scripts" 74complete -x -c npm -n"__fish_npm_using_command $c " -s script-shell -d'The shell to use for scripts' 75complete -f -c npm -n"__fish_npm_using_command $c " -l foreground-scripts -d'Run all build scripts in the foreground' 76end 77 78# access 79set -l access_commands'list get set grant revoke' 80complete -f -c npm -n __fish_npm_needs_command -a access -d'Set access level on published packages' 81complete -x -c npm -n'__fish_npm_using_command access' -n"not __fish_seen_subcommand_from $access_commands " -a list -d'List access info' 82complete -x -c npm -n'__fish_npm_using_command access' -n"not __fish_seen_subcommand_from $access_commands " -a get -d'Get access level' 83complete -x -c npm -n'__fish_npm_using_command access' -n"not __fish_seen_subcommand_from $access_commands " -a grant -d'Grant access to users' 84complete -x -c npm -n'__fish_npm_using_command access' -n"not __fish_seen_subcommand_from $access_commands " -a revoke -d'Revoke access from users' 85complete -x -c npm -n'__fish_npm_using_command access' -n"not __fish_seen_subcommand_from $access_commands " -a set -d'Set access level' 86complete -x -c npm -n'__fish_npm_using_command access' -n'__fish_seen_subcommand_from list' -a'packages collaborators' 87complete -x -c npm -n'__fish_npm_using_command access' -n'__fish_seen_subcommand_from get' -a status 88complete -x -c npm -n'__fish_npm_using_command access' -n'__fish_seen_subcommand_from grant' -a'read-only read-write' 89complete -x -c npm -n'__fish_npm_using_command access' -n'__fish_seen_subcommand_from set' -a'status=public status=private' -d'Set package status' 90complete -x -c npm -n'__fish_npm_using_command access' -n'__fish_seen_subcommand_from set' -a'mfa=none mfa=publish mfa=automation' -d'Set package MFA' 91complete -x -c npm -n'__fish_npm_using_command access' -n'__fish_seen_subcommand_from set' -a'2fa=none 2fa=publish 2fa=automation' -d'Set package MFA' 92complete -f -c npm -n'__fish_npm_using_command access' -l json -d'Output JSON' 93complete -x -c npm -n'__fish_npm_using_command access' -l otp -d'2FA one-time password' 94complete -x -c npm -n'__fish_npm_using_command access' -l registry -d'Registry base URL' 95complete -f -c npm -n'__fish_npm_using_command access' -s h -l help -d'Display help' 96 97# adduser 98complete -f -c npm -n __fish_npm_needs_command -a adduser -d'Add a registry user account' 99complete -f -c npm -n __fish_npm_needs_command -a login -d'Login to a registry user account' 100for cin adduser add-user login 101complete -x -c npm -n"__fish_npm_using_command $c " -l registry -d'Registry base URL' 102complete -x -c npm -n"__fish_npm_using_command $c " -l scope -d'Log into a private repository' 103complete -x -c npm -n"__fish_npm_using_command $c " -l auth-type -a'legacy web' -d'Authentication strategy' 104complete -f -c npm -n"__fish_npm_using_command $c " -s h -l help -d'Display help' 105end 106 107# audit 108complete -f -c npm -n __fish_npm_needs_command -a audit -d'Run a security audit' 109complete -f -c npm -n'__fish_npm_using_command audit' -a signatures -d'Verify registry signatures' 110complete -f -c npm -n'__fish_npm_using_command audit' -a fix -d'Install compatible updates to vulnerable deps' 111complete -x -c npm -n'__fish_npm_using_command audit' -l audit-level -a'info low moderate high critical none' -d'Audit level' 112complete -f -c npm -n'__fish_npm_using_command audit' -l dry-run -d'Do not make any changes' 113complete -f -c npm -n'__fish_npm_using_command audit' -s f -l force -d'Removes various protections' 114complete -f -c npm -n'__fish_npm_using_command audit' -l json -d'Output JSON' 115complete -f -c npm -n'__fish_npm_using_command audit' -l package-lock-only -d'Only use package-lock.json, ignore node_modules' 116complete -x -c npm -n'__fish_npm_using_command audit' -l omit -a'dev optional peer' -d'Omit dependency type' 117complete -f -c npm -n'__fish_npm_using_command audit' -l foreground-scripts -d'Run all build scripts in the foreground' 118complete -f -c npm -n'__fish_npm_using_command audit' -l ignore-scripts -d"Don't run pre-, post- and life-cycle scripts" 119complete -f -c npm -n'__fish_npm_using_command audit' -l install-links -d'Install file: protocol deps as regular deps' 120complete -f -c npm -n'__fish_npm_using_command audit' -s h -l help -d'Display help' 121 122# bugs 123for cin bugs issues 124complete -f -c npm -n __fish_npm_needs_command -a" $c " -d'Report bugs for a package in a web browser' 125complete -x -c npm -n"__fish_npm_using_command $c " -l browser -d'Set browser' 126complete -x -c npm -n"__fish_npm_using_command $c " -l no-browser -d'Print to stdout' 127complete -x -c npm -n"__fish_npm_using_command $c " -l registry -d'Registry base URL' 128complete -f -c npm -n"__fish_npm_using_command $c " -s h -l help -d'Display help' 129end 130 131# cache 132complete -f -c npm -n __fish_npm_needs_command -a cache -d"Manipulates package's cache" 133complete -f -c npm -n'__fish_npm_using_command cache' -a add -d'Add the specified package to the local cache' 134complete -f -c npm -n'__fish_npm_using_command cache' -a clean -d'Delete data out of the cache folder' 135complete -f -c npm -n'__fish_npm_using_command cache' -a ls -d'Show the data in the cache' 136complete -f -c npm -n'__fish_npm_using_command cache' -a verify -d'Verify the contents of the cache folder' 137complete -x -c npm -n'__fish_npm_using_command cache' -l cache -a'(__fish_complete_directories)' -d'Cache location' 138complete -f -c npm -n'__fish_npm_using_command cache' -s h -l help -d'Display help' 139 140# ci 141# install-ci-test 142complete -f -c npm -n __fish_npm_needs_command -a'ci clean-install' -d'Clean install a project' 143complete -f -c npm -n __fish_npm_needs_command -a'install-ci-test cit' -d'Install a project with a clean slate and run tests' 144# typos are intentional 145for cin ci clean-install ic install-clean isntall-clean install-ci-test cit clean-install-test sit 146complete -x -c npm -n"__fish_npm_using_command $c " -l install-strategy -a'hoisted nested shallow linked' -d'Install strategy' 147complete -x -c npm -n"__fish_npm_using_command $c " -l omit -a'dev optional peer' -d'Omit dependency type' 148complete -x -c npm -n"__fish_npm_using_command $c " -l strict-peer-deps -d'Treat conflicting peerDependencies as failure' 149complete -f -c npm -n"__fish_npm_using_command $c " -l foreground-scripts -d'Run all build scripts in the foreground' 150complete -f -c npm -n"__fish_npm_using_command $c " -l ignore-scripts -d"Don't run pre-, post- and life-cycle scripts" 151complete -f -c npm -n"__fish_npm_using_command $c " -l no-audit -d"Don't submit audit reports" 152complete -f -c npm -n"__fish_npm_using_command $c " -l no-bin-links -d"Don't symblink package executables" 153complete -f -c npm -n"__fish_npm_using_command $c " -l no-fund -d"Don't display funding info" 154complete -f -c npm -n"__fish_npm_using_command $c " -l dry-run -d'Do not make any changes' 155complete -f -c npm -n"__fish_npm_using_command $c " -l install-links -d'Install file: protocol deps as regular deps' 156complete -f -c npm -n"__fish_npm_using_command $c " -s h -l help -d'Display help' 157end 158 159# completion 160complete -f -c npm -n __fish_npm_needs_command -a completion -d'Tab Completion for npm' 161complete -f -c npm -n'__fish_npm_using_command completion' -s h -l help -d'Display help' 162 163# config 164complete -f -c npm -n __fish_npm_needs_command -a config -d'Manage the npm configuration files' 165for cin config c 166set -l config_commands'set get delete list edit fix' 167complete -x -c npm -n"__fish_npm_using_command $c " -n"not __fish_seen_subcommand_from $config_commands " -a set -d'Sets the config keys to the values' 168complete -x -c npm -n"__fish_npm_using_command $c " -n"not __fish_seen_subcommand_from $config_commands " -a get -d'Echo the config value(s) to stdout' 169complete -x -c npm -n"__fish_npm_using_command $c " -n"not __fish_seen_subcommand_from $config_commands " -a delete -d'Deletes the key from all config files' 170complete -x -c npm -n"__fish_npm_using_command $c " -n"not __fish_seen_subcommand_from $config_commands " -a list -d'Show all config settings' 171complete -x -c npm -n"__fish_npm_using_command $c " -n"not __fish_seen_subcommand_from $config_commands " -a edit -d'Opens the config file in an editor' 172complete -x -c npm -n"__fish_npm_using_command $c " -n"not __fish_seen_subcommand_from $config_commands " -a fix -d'Attempts to repair invalid config items' 173complete -f -c npm -n"__fish_npm_using_command $c " -l json -d'Output JSON' 174complete -f -c npm -n"__fish_npm_using_command $c " -s g -l global -d'Edit global config' 175complete -x -c npm -n"__fish_npm_using_command $c " -l editor -d'Specify the editor' 176complete -x -c npm -n"__fish_npm_using_command $c " -s L -l location -a'global user project' -d'Which config file' 177complete -f -c npm -n"__fish_npm_using_command $c " -s l -l long -d'Show extended information' 178complete -f -c npm -n"__fish_npm_using_command $c " -s h -l help -d'Display help' 179end 180# get, set also exist as shorthands 181complete -f -c npm -n __fish_npm_needs_command -a get -d'Get a value from the npm configuration' 182complete -f -c npm -n'__fish_npm_using_command get' -s l -l long -d'Show extended information' 183complete -f -c npm -n'__fish_npm_using_command get' -s h -l help -d'Display help' 184# set 185complete -f -c npm -n __fish_npm_needs_command -a set -d'Set a value in the npm configuration' 186complete -x -c npm -n'__fish_npm_using_command set' -s L -l location -a'global user project' -d'Which config file' 187complete -f -c npm -n'__fish_npm_using_command set' -s g -l global -d'Edit global config' 188complete -f -c npm -n'__fish_npm_using_command set' -s h -l help -d'Display help' 189 190# dedupe 191complete -f -c npm -n __fish_npm_needs_command -a dedupe -d'Reduce duplication' 192complete -f -c npm -n __fish_npm_needs_command -a find-dupes -d'Find duplication' 193for cin dedupe ddp find-dupes 194complete -x -c npm -n"__fish_npm_using_command $c " -l install-strategy -a'hoisted nested shallow linked' -d'Install strategy' 195complete -x -c npm -n"__fish_npm_using_command $c " -l strict-peer-deps -d'Treat conflicting peerDependencies as failure' 196complete -x -c npm -n"__fish_npm_using_command $c " -l no-package-lock -d'Ignore package-lock.json' 197complete -x -c npm -n"__fish_npm_using_command $c " -l omit -a'dev optional peer' -d'Omit dependency type' 198complete -f -c npm -n"__fish_npm_using_command $c " -l ignore-scripts -d"Don't run pre-, post- and life-cycle scripts" 199complete -f -c npm -n"__fish_npm_using_command $c " -l no-audit -d"Don't submit audit reports" 200complete -f -c npm -n"__fish_npm_using_command $c " -l no-bin-links -d"Don't symblink package executables" 201complete -f -c npm -n"__fish_npm_using_command $c " -l no-fund -d"Don't display funding info" 202complete -f -c npm -n"__fish_npm_using_command $c " -l install-links -d'Install file: protocol deps as regular deps' 203complete -f -c npm -n"__fish_npm_using_command $c " -s h -l help -d'Display help' 204 205if test $c != find-dupes 206complete -f -c npm -n"__fish_npm_using_command $c " -l dry-run -d"Don't display funding info" 207end 208end 209 210# deprecate 211complete -f -c npm -n __fish_npm_needs_command -a deprecate -d'Deprecate a version of a package' 212complete -x -c npm -n'__fish_npm_using_command deprecate' -l registry -d'Registry base URL' 213complete -x -c npm -n'__fish_npm_using_command deprecate' -l otp -d'2FA one-time password' 214complete -f -c npm -n'__fish_npm_using_command deprecate' -s h -l help -d'Display help' 215 216# diff 217complete -f -c npm -n __fish_npm_needs_command -a diff -d'The registry diff command' 218complete -x -c npm -n'__fish_npm_using_command diff' -l diff -d'Arguments to compare' 219complete -f -c npm -n'__fish_npm_using_command diff' -l diff-name-only -d'Prints only filenames' 220complete -x -c npm -n'__fish_npm_using_command diff' -l diff-unified -d'The number of lines to print' 221complete -f -c npm -n'__fish_npm_using_command diff' -l diff-ignore-all-space -d'Ignore whitespace' 222complete -f -c npm -n'__fish_npm_using_command diff' -l diff-no-prefix -d'Do not show any prefix' 223complete -x -c npm -n'__fish_npm_using_command diff' -l diff-src-prefix -d'Source prefix' 224complete -x -c npm -n'__fish_npm_using_command diff' -l diff-dst-prefix -d'Destination prefix' 225complete -f -c npm -n'__fish_npm_using_command diff' -l diff-text -d'Treat all files as text' 226complete -f -c npm -n'__fish_npm_using_command diff' -s g -l global -d'Operates in "global" mode' 227complete -x -c npm -n'__fish_npm_using_command diff' -l tag -d'The tag used to fetch the tarball' 228complete -f -c npm -n'__fish_npm_using_command diff' -s h -l help -d'Display help' 229 230# dist-tag 231complete -f -c npm -n __fish_npm_needs_command -a dist-tag -d'Modify package distribution tags' 232for cin dist-tag dist-tags 233complete -f -c npm -n"__fish_npm_using_command $c " -a add -d'Tag the package' 234complete -f -c npm -n"__fish_npm_using_command $c " -a rm -d'Clear a tag from the package' 235complete -f -c npm -n"__fish_npm_using_command $c " -a ls -d'List all dist-tags' 236complete -f -c npm -n"__fish_npm_using_command $c " -s h -l help -d'Display help' 237end 238 239# docs 240complete -f -c npm -n __fish_npm_needs_command -a docs -d'Open docs for a package in a web browser' 241for cin docs home 242complete -x -c npm -n"__fish_npm_using_command $c " -l browser -d'Set browser' 243complete -x -c npm -n"__fish_npm_using_command $c " -l registry -d'Registry base URL' 244complete -f -c npm -n"__fish_npm_using_command $c " -s h -l help -d'Display help' 245end 246 247# doctor 248complete -f -c npm -n __fish_npm_needs_command -a doctor -d'Check your npm environment' 249complete -f -c npm -n'__fish_npm_using_command doctor' -a ping -d'Check npm ping' 250complete -f -c npm -n'__fish_npm_using_command doctor' -a registry -d'Check registry' 251complete -f -c npm -n'__fish_npm_using_command doctor' -a versions -d'Check installed versions' 252complete -f -c npm -n'__fish_npm_using_command doctor' -a environment -d'Check PATH' 253complete -f -c npm -n'__fish_npm_using_command doctor' -a permissions -d'Check file permissions' 254complete -f -c npm -n'__fish_npm_using_command doctor' -a cache -d'Verify cache' 255complete -f -c npm -n'__fish_npm_using_command doctor' -s h -l help -d'Display help' 256 257# edit 258complete -f -c npm -n __fish_npm_needs_command -a edit -d'Edit an installed package' 259complete -f -c npm -n'__fish_npm_using_command edit' -l editor -d'Specify the editor' 260complete -f -c npm -n'__fish_npm_using_command edit' -s h -l help -d'Display help' 261 262# exec 263complete -f -c npm -n __fish_npm_needs_command -a exec -d'Run a command from a local or remote npm package' 264for cin exec x 265complete -x -c npm -n"__fish_npm_using_command $c " -l package -d'The package(s) to install' 266complete -x -c npm -n"__fish_npm_using_command $c " -l call -d'Specify a custom command' 267complete -f -c npm -n"__fish_npm_using_command $c " -s h -l help -d'Display help' 268end 269 270# explain 271for cin explain why 272complete -f -c npm -n __fish_npm_needs_command -a" $c " -d'Explain installed packages' 273complete -f -c npm -n"__fish_npm_using_command $c " -l json -d'Output JSON' 274complete -f -c npm -n"__fish_npm_using_command $c " -s h -l help -d'Display help' 275end 276 277# explore 278complete -f -c npm -n __fish_npm_needs_command -a explore -d'Browse an installed package' 279complete -f -c npm -n'__fish_npm_using_command explore' -a shell -d'The shell to open' 280complete -f -c npm -n'__fish_npm_using_command explore' -s h -l help -d'Display help' 281 282# fund 283complete -f -c npm -n __fish_npm_needs_command -a fund -d'Retrieve funding information' 284complete -f -c npm -n'__fish_npm_using_command fund' -l json -d'Output JSON' 285complete -x -c npm -n'__fish_npm_using_command fund' -l browser -d'Set browser' 286complete -f -c npm -n'__fish_npm_using_command fund' -l no-browser -d'Print to stdout' 287complete -f -c npm -n'__fish_npm_using_command fund' -l unicode -d'Use unicode characters in the output' 288complete -f -c npm -n'__fish_npm_using_command fund' -l no-unicode -d'Use ascii characters over unicode glyphs' 289complete -x -c npm -n'__fish_npm_using_command fund' -l which -d'Which source URL to open (1-indexed)' 290complete -f -c npm -n'__fish_npm_using_command fund' -s h -l help -d'Display help' 291 292# help 293complete -f -c npm -n __fish_npm_needs_command -a help -d'Get help on npm' 294for cin help hlep 295complete -f -c npm -n"__fish_npm_using_command $c " -l viewer -a'browser man' -d'Program to view content' 296complete -f -c npm -n"__fish_npm_using_command $c " -s h -l help -d'Display help' 297complete -f -c npm -n"__fish_npm_using_command $c " -a registry -d'The JavaScript Package Registry' 298complete -f -c npm -n"__fish_npm_using_command $c " -a removal -d'Cleaning the Slate' 299complete -f -c npm -n"__fish_npm_using_command $c " -a logging -d'Why, What & How We Log' 300complete -f -c npm -n"__fish_npm_using_command $c " -a scope -d'How npm handles the "scripts" field' 301complete -f -c npm -n"__fish_npm_using_command $c " -a dependency-selectors -d'Dependency Selector Syntax & Querying' 302complete -f -c npm -n"__fish_npm_using_command $c " -a npm -d'javascript package manager' 303complete -f -c npm -n"__fish_npm_using_command $c " -a npmrc -d'The npm config files' 304complete -f -c npm -n"__fish_npm_using_command $c " -a shrinkwrap -d'A publishable lockfile' 305complete -f -c npm -n"__fish_npm_using_command $c " -a developers -d'Developer Guide' 306complete -f -c npm -n"__fish_npm_using_command $c " -a npx -d'Run a command from a local or remote npm package' 307complete -f -c npm -n"__fish_npm_using_command $c " -a package-json -d"Specifics of npm's package.json handling" 308complete -f -c npm -n"__fish_npm_using_command $c " -a package-lock-json -d'A manifestation of the manifest' 309complete -f -c npm -n"__fish_npm_using_command $c " -a package-spec -d'Package name specifier' 310complete -f -c npm -n"__fish_npm_using_command $c " -a folders -d'Folder Structures Used by npm' 311complete -f -c npm -n"__fish_npm_using_command $c " -a global -d'Folder Structures Used by npm' 312complete -f -c npm -n"__fish_npm_using_command $c " -a workspaces -d'FolderWorking with workspaces' 313complete -f -c npm -n"__fish_npm_using_command $c " -a'run-script run' -d'Run arbitrary package scripts' 314complete -f -c npm -n"__fish_npm_using_command $c " -a access -d'Set access level on published packages' 315complete -f -c npm -n"__fish_npm_using_command $c " -a adduser -d'Add a registry user account' 316complete -f -c npm -n"__fish_npm_using_command $c " -a login -d'Login to a registry user account' 317complete -f -c npm -n"__fish_npm_using_command $c " -a audit -d'Run a security audit' 318complete -f -c npm -n"__fish_npm_using_command $c " -a'bugs issues' -d'Report bugs for a package in a web browser' 319complete -f -c npm -n"__fish_npm_using_command $c " -a cache -d"Manipulates package's cache" 320complete -f -c npm -n"__fish_npm_using_command $c " -a'ci clean-install' -d'Clean install a project' 321complete -f -c npm -n"__fish_npm_using_command $c " -a'install-ci-test cit' -d'Install a project with a clean slate and run tests' 322complete -f -c npm -n"__fish_npm_using_command $c " -a config -d'Manage the npm configuration files' 323complete -f -c npm -n"__fish_npm_using_command $c " -a dedupe -d'Reduce duplication' 324complete -f -c npm -n"__fish_npm_using_command $c " -a find-dupes -d'Find duplication' 325complete -f -c npm -n"__fish_npm_using_command $c " -a deprecate -d'Deprecate a version of a package' 326complete -f -c npm -n"__fish_npm_using_command $c " -a diff -d'The registry diff command' 327complete -f -c npm -n"__fish_npm_using_command $c " -a dist-tag -d'Modify package distribution tags' 328complete -f -c npm -n"__fish_npm_using_command $c " -a docs -d'Open docs for a package in a web browser' 329complete -f -c npm -n"__fish_npm_using_command $c " -a doctor -d'Check your npm environment' 330complete -f -c npm -n"__fish_npm_using_command $c " -a edit -d'Edit an installed package' 331complete -f -c npm -n"__fish_npm_using_command $c " -a exec -d'Run a command from a local or remote npm package' 332complete -f -c npm -n"__fish_npm_using_command $c " -a'explaiin why' -d'Explain installed packages' 333complete -f -c npm -n"__fish_npm_using_command $c " -a explore -d'Browse an installed package' 334complete -f -c npm -n"__fish_npm_using_command $c " -a fund -d'Retrieve funding information' 335complete -f -c npm -n"__fish_npm_using_command $c " -a help -d'Get help on npm' 336complete -f -c npm -n"__fish_npm_using_command $c " -a help-search -d'Search npm help documentation' 337complete -f -c npm -n"__fish_npm_using_command $c " -a hook -d'Manage registry hooks' 338complete -f -c npm -n"__fish_npm_using_command $c " -a'init create' -d'Create a package.json file' 339complete -f -c npm -n"__fish_npm_using_command $c " -a'install add i' -d'Install a package' 340complete -f -c npm -n"__fish_npm_using_command $c " -a'install-test it' -d'Install package(s) and run tests' 341complete -f -c npm -n"__fish_npm_using_command $c " -a logout -d'Log out of the registry' 342complete -f -c npm -n"__fish_npm_using_command $c " -a'ls list' -d'List installed packages' 343complete -f -c npm -n"__fish_npm_using_command $c " -a outdated -d'Check for outdated packages' 344complete -f -c npm -n"__fish_npm_using_command $c " -a org -d'Manage orgs' 345complete -f -c npm -n"__fish_npm_using_command $c " -a'owner author' -d'Manage package owners' 346complete -f -c npm -n"__fish_npm_using_command $c " -a pack -d'Create a tarball from a package' 347complete -f -c npm -n"__fish_npm_using_command $c " -a ping -d'Ping npm registry' 348complete -f -c npm -n"__fish_npm_using_command $c " -a pkg -d'Manages your package.json' 349complete -f -c npm -n"__fish_npm_using_command $c " -a prefix -d'Display npm prefix' 350complete -f -c npm -n"__fish_npm_using_command $c " -a publish -d'Publish a package' 351complete -f -c npm -n"__fish_npm_using_command $c " -a query -d'Dependency selector query' 352complete -f -c npm -n"__fish_npm_using_command $c " -a'uninstall remove un' -d'Remove a package' 353complete -f -c npm -n"__fish_npm_using_command $c " -a repo -d'Open package repository page in the browser' 354complete -f -c npm -n"__fish_npm_using_command $c " -a restart -d'Restart a package' 355complete -f -c npm -n"__fish_npm_using_command $c " -a start -d'Start a package' 356complete -f -c npm -n"__fish_npm_using_command $c " -a stop -d'Stop a package' 357complete -f -c npm -n"__fish_npm_using_command $c " -a test -d'Test a package' 358complete -f -c npm -n"__fish_npm_using_command $c " -a root -d'Display npm root' 359complete -f -c npm -n"__fish_npm_using_command $c " -a'search find' -d'Search for packages' 360complete -f -c npm -n"__fish_npm_using_command $c " -a star -d'Mark your favorite packages' 361complete -f -c npm -n"__fish_npm_using_command $c " -a stars -d'View packages marked as favorites' 362complete -f -c npm -n"__fish_npm_using_command $c " -a'update up upgrade' -d'Update package(s)' 363complete -f -c npm -n"__fish_npm_using_command $c " -a unstar -d'Remove star from a package' 364complete -f -c npm -n"__fish_npm_using_command $c " -a version -d'Bump a package version' 365complete -f -c npm -n"__fish_npm_using_command $c " -a'view info' -d'View registry info' 366complete -f -c npm -n"__fish_npm_using_command $c " -a whoami -d'Display npm username' 367complete -f -c npm -n"__fish_npm_using_command $c " -a'link ln' -d'Symlink a package folder' 368complete -f -c npm -n"__fish_npm_using_command $c " -a profile -d'Change settings on your registry profile' 369complete -f -c npm -n"__fish_npm_using_command $c " -a prune -d'Remove extraneous packages' 370complete -f -c npm -n"__fish_npm_using_command $c " -a rebuild -d'Rebuild a package' 371complete -f -c npm -n"__fish_npm_using_command $c " -a team -d'Manage organization teams and team memberships' 372complete -f -c npm -n"__fish_npm_using_command $c " -a token -d'Manage your authentication tokens' 373complete -f -c npm -n"__fish_npm_using_command $c " -a unpublish -d'Remove a package from the registry' 374complete -f -c npm -n"__fish_npm_using_command $c " -a completion -d'Tab Completion for npm' 375complete -f -c npm -n"__fish_npm_using_command $c " -a shrinkwrap -d'Lock down dependency versions' 376end 377 378# help-search 379complete -f -c npm -n __fish_npm_needs_command -a help-search -d'Search npm help documentation' 380complete -f -c npm -n'__fish_npm_using_command help-search' -s l -l long -d'Show extended information' 381complete -f -c npm -n'__fish_npm_using_command help-search' -s h -l help -d'Display help' 382 383# hook 384set -l hook_commands'add ls update rm' 385complete -f -c npm -n __fish_npm_needs_command -a hook -d'Manage registry hooks' 386complete -f -c npm -n'__fish_npm_using_command hook' -n"not __fish_seen_subcommand_from $hook_commands " -a add -d'Add a hook' 387complete -f -c npm -n'__fish_npm_using_command hook' -n"not __fish_seen_subcommand_from $hook_commands " -a ls -d'List all active hooks' 388complete -f -c npm -n'__fish_npm_using_command hook' -n"not __fish_seen_subcommand_from $hook_commands " -a update -d'Update an existing hook' 389complete -f -c npm -n'__fish_npm_using_command hook' -n"not __fish_seen_subcommand_from $hook_commands " -a rm -d'Remove a hook' 390complete -f -c npm -n'__fish_npm_using_command hook' -n'__fish_seen_subcommand_from add' -l type -d'Hook type' 391complete -x -c npm -n'__fish_npm_using_command hook' -l registry -d'Registry base URL' 392complete -x -c npm -n'__fish_npm_using_command hook' -l otp -d'2FA one-time password' 393complete -f -c npm -n'__fish_npm_using_command hook' -s h -l help -d'Display help' 394 395# init 396complete -c npm -n __fish_npm_needs_command -a'init create' -d'Create a package.json file' 397for cin init create innit 398complete -f -c npm -n"__fish_npm_using_command $c " -s y -l yes -d'Automatically answer "yes" to all prompts' 399complete -f -c npm -n"__fish_npm_using_command $c " -s f -l force -d'Removes various protections' 400complete -x -c npm -n"__fish_npm_using_command $c " -l scope -d'Create a scoped package' 401complete -f -c npm -n"__fish_npm_using_command $c " -s h -l help -d'Display help' 402end 403 404# install 405# install-test 406# link 407complete -c npm -n __fish_npm_needs_command -a'install add i' -d'Install a package' 408complete -f -c npm -n __fish_npm_needs_command -a'install-test it' -d'Install package(s) and run tests' 409complete -f -c npm -n __fish_npm_needs_command -a'link ln' -d'Symlink a package folder' 410# typos are intentional 411for cin install add i in ins inst insta instal isnt isnta isntal isntall install-test it link ln 412complete -f -c npm -n"__fish_npm_using_command $c " -s S -l save -d'Save to dependencies' 413complete -f -c npm -n"__fish_npm_using_command $c " -l no-save -d'Prevents saving to dependencies' 414complete -f -c npm -n"__fish_npm_using_command $c " -s P -l save-prod -d'Save to dependencies' 415complete -f -c npm -n"__fish_npm_using_command $c " -s D -l save-dev -d'Save to devDependencies' 416complete -f -c npm -n"__fish_npm_using_command $c " -s O -l save-optional -d'Save to optionalDependencies' 417complete -f -c npm -n"__fish_npm_using_command $c " -l save-peer -d'Save to peerDependencies' 418complete -f -c npm -n"__fish_npm_using_command $c " -s B -l save-bundle -d'Also save to bundleDependencies' 419complete -f -c npm -n"__fish_npm_using_command $c " -s E -l save-exact -d'Save dependency with exact version' 420complete -f -c npm -n"__fish_npm_using_command $c " -s g -l global -d'Install package globally' 421complete -x -c npm -n"__fish_npm_using_command $c " -l install-strategy -a'hoisted nested shallow linked' -d'Install strategy' 422complete -x -c npm -n"__fish_npm_using_command $c " -l omit -a'dev optional peer' -d'Omit dependency type' 423complete -x -c npm -n"__fish_npm_using_command $c " -l strict-peer-deps -d'Treat conflicting peerDependencies as failure' 424complete -x -c npm -n"__fish_npm_using_command $c " -l no-package-lock -d'Ignore package-lock.json' 425complete -f -c npm -n"__fish_npm_using_command $c " -l ignore-scripts -d"Don't run pre-, post- and life-cycle scripts" 426complete -f -c npm -n"__fish_npm_using_command $c " -l no-audit -d"Don't submit audit reports" 427complete -f -c npm -n"__fish_npm_using_command $c " -l no-bin-links -d"Don't symblink package executables" 428complete -f -c npm -n"__fish_npm_using_command $c " -l no-fund -d"Don't display funding info" 429complete -f -c npm -n"__fish_npm_using_command $c " -l dry-run -d'Do not make any changes' 430complete -f -c npm -n"__fish_npm_using_command $c " -l install-links -d'Install file: protocol deps as regular deps' 431complete -f -c npm -n"__fish_npm_using_command $c " -s h -l help -d'Display help' 432 433if test $c != link-a $c != ln 434complete -f -c npm -n"__fish_npm_using_command $c " -l foreground-scripts -d'Run all build scripts in the foreground' 435complete -f -c npm -n"__fish_npm_using_command $c " -l prefer-dedupe -d'Prefer to deduplicate packages' 436end 437end 438 439# logout 440complete -f -c npm -n __fish_npm_needs_command -a logout -d'Log out of the registry' 441complete -x -c npm -n'__fish_npm_using_command logout' -l registry -d'Registry base URL' 442complete -x -c npm -n'__fish_npm_using_command logout' -l scope -d'Log out of private repository' 443complete -f -c npm -n'__fish_npm_using_command logout' -s h -l help -d'Display help' 444 445# ls 446# ll, la 447complete -f -c npm -n __fish_npm_needs_command -a'ls list ll' -d'List installed packages' 448for cin ls list ll la 449complete -f -c npm -n"__fish_npm_using_command $c " -s a -l all -d'Also show indirect dependencies' 450complete -f -c npm -n"__fish_npm_using_command $c " -l json -d'Output JSON' 451complete -f -c npm -n"__fish_npm_using_command $c " -s l -l long -d'Show extended information' 452complete -f -c npm -n"__fish_npm_using_command $c " -s p -l parseable -d'Output parseable results' 453complete -f -c npm -n"__fish_npm_using_command $c " -s g -l global -d'List global packages' 454complete -x -c npm -n"__fish_npm_using_command $c " -l depth -d'Dependency recursion depth' 455complete -x -c npm -n"__fish_npm_using_command $c " -l omit -a'dev optional peer' -d'Omit dependency type' 456complete -f -c npm -n"__fish_npm_using_command $c " -l linked -d'Only show linked packages' 457complete -f -c npm -n"__fish_npm_using_command $c " -l package-lock-only -d'Only use package-lock.json, ignore node_modules' 458complete -f -c npm -n"__fish_npm_using_command $c " -l unicode -d'Use unicode characters in the output' 459complete -f -c npm -n"__fish_npm_using_command $c " -l no-unicode -d'Use ascii characters over unicode glyphs' 460complete -f -c npm -n"__fish_npm_using_command $c " -l install-links -d'Install file: protocol deps as regular deps' 461complete -f -c npm -n"__fish_npm_using_command $c " -s h -l help -d'Display help' 462end 463 464# outdated 465complete -f -c npm -n __fish_npm_needs_command -a outdated -d'Check for outdated packages' 466complete -f -c npm -n'__fish_npm_using_command outdated' -s a -l all -d'Also show indirect dependencies' 467complete -f -c npm -n'__fish_npm_using_command outdated' -l json -d'Output JSON' 468complete -f -c npm -n'__fish_npm_using_command outdated' -s l -l long -d'Show extended information' 469complete -f -c npm -n'__fish_npm_using_command outdated' -l parseable -d'Output parseable results' 470complete -f -c npm -n'__fish_npm_using_command outdated' -s g -l global -d'Check global packages' 471complete -f -c npm -n'__fish_npm_using_command outdated' -s h -l help -d'Display help' 472 473# org 474complete -f -c npm -n __fish_npm_needs_command -a org -d'Manage orgs' 475for cin org ogr 476complete -f -c npm -n"__fish_npm_using_command $c " -n'__fish_is_nth_token 2' -a set -d'Add a new user' 477complete -f -c npm -n"__fish_npm_using_command $c " -n'__fish_is_nth_token 2' -a rm -d'Remove a user' 478complete -f -c npm -n"__fish_npm_using_command $c " -n'__fish_is_nth_token 2' -a ls -d'List all users' 479 480complete -f -c npm -n"__fish_npm_using_command $c " -n'__fish_is_nth_token 5' -n'__fish_seen_subcommand_from set' -a admin -d'Add admin' 481complete -f -c npm -n"__fish_npm_using_command $c " -n'__fish_is_nth_token 5' -n'__fish_seen_subcommand_from set' -a developer -d'Add developer' 482complete -f -c npm -n"__fish_npm_using_command $c " -n'__fish_is_nth_token 5' -n'__fish_seen_subcommand_from set' -a owner -d'Add owner' 483complete -f -c npm -n"__fish_npm_using_command $c " -s h -l help -d'Display help' 484end 485 486# owner 487for cin owner author 488complete -f -c npm -n __fish_npm_needs_command -a" $c " -d'Manage package owners' 489complete -f -c npm -n"__fish_npm_using_command $c " -a ls -d'List package owners' 490complete -f -c npm -n"__fish_npm_using_command $c " -a add -d'Add a new owner to package' 491complete -f -c npm -n"__fish_npm_using_command $c " -a rm -d'Remove an owner from package' 492complete -x -c npm -n"__fish_npm_using_command $c " -l registry -d'Registry base URL' 493complete -x -c npm -n"__fish_npm_using_command $c " -l otp -d'2FA one-time password' 494complete -f -c npm -n"__fish_npm_using_command $c " -s h -l help -d'Display help' 495end 496 497# pack 498complete -f -c npm -n __fish_npm_needs_command -a pack -d'Create a tarball from a package' 499complete -f -c npm -n'__fish_npm_using_command pack' -l dry-run -d'Do not make any changes' 500complete -f -c npm -n'__fish_npm_using_command pack' -l json -d'Output JSON' 501complete -x -c npm -n'__fish_npm_using_command pack' -l pack-destination -a'(__fish_complete_directories)' -d'Tarball destination directory' 502complete -f -c npm -n'__fish_npm_using_command pack' -s h -l help -d'Display help' 503 504# ping 505complete -f -c npm -n __fish_npm_needs_command -a ping -d'Ping npm registry' 506complete -x -c npm -n'__fish_npm_using_command ping' -l registry -d'Registry base URL' 507complete -f -c npm -n'__fish_npm_using_command ping' -s h -l help -d'Display help' 508 509# pkg 510complete -f -c npm -n __fish_npm_needs_command -a pkg -d'Manages your package.json' 511complete -x -c npm -n'__fish_npm_using_command pkg' -a set -d'Sets a value' 512complete -x -c npm -n'__fish_npm_using_command pkg' -a get -d'Retrieves a value' 513complete -x -c npm -n'__fish_npm_using_command pkg' -a delete -d'Deletes a key' 514complete -f -c npm -n'__fish_npm_using_command pkg' -s f -l force -d'Removes various protections' 515complete -f -c npm -n'__fish_npm_using_command pkg' -l json -d'Parse values with JSON.parse()' 516complete -f -c npm -n'__fish_npm_using_command pkg' -s h -l help -d'Display help' 517 518# prefix 519complete -f -c npm -n __fish_npm_needs_command -a prefix -d'Display npm prefix' 520complete -f -c npm -n'__fish_npm_using_command prefix' -s g -l global -d'Display global prefix' 521complete -f -c npm -n'__fish_npm_using_command prefix' -s h -l help -d'Display help' 522 523# profile 524set -l profile_commands'enable-2fa disable-2fa get set' 525complete -f -c npm -n __fish_npm_needs_command -a profile -d'Change settings on your registry profile' 526complete -x -c npm -n'__fish_npm_using_command profile' -n"not __fish_seen_subcommand_from $profile_commands " -a enable-2fa -d'Enables two-factor authentication' 527complete -x -c npm -n'__fish_npm_using_command profile' -n"not __fish_seen_subcommand_from $profile_commands " -a disable-2fa -d'Disables two-factor authentication' 528complete -x -c npm -n'__fish_npm_using_command profile' -n"not __fish_seen_subcommand_from $profile_commands " -a get -d'Display profile properties' 529complete -x -c npm -n'__fish_npm_using_command profile' -n"not __fish_seen_subcommand_from $profile_commands " -a set -d'Set the value of a profile property' 530complete -x -c npm -n'__fish_npm_using_command profile' -n'__fish_seen_subcommand_from enable-2fa' -a auth-only -d'Require an OTP on profile changes' 531complete -x -c npm -n'__fish_npm_using_command profile' -n'__fish_seen_subcommand_from enable-2fa' -a auth-and-writes -d'Also require an OTP on package changes' 532complete -f -c npm -n'__fish_npm_using_command profile' -s h -l help -d'Display help' 533 534# prune 535complete -f -c npm -n __fish_npm_needs_command -a prune -d'Remove extraneous packages' 536complete -x -c npm -n'__fish_npm_using_command prune' -l omit -a'dev optional peer' -d'Omit dependency type' 537complete -f -c npm -n'__fish_npm_using_command prune' -l dry-run -d'Do not make any changes' 538complete -f -c npm -n'__fish_npm_using_command prune' -l json -d'Output JSON' 539complete -f -c npm -n'__fish_npm_using_command prune' -l foreground-scripts -d'Run all build scripts in the foreground' 540complete -f -c npm -n'__fish_npm_using_command prune' -l ignore-scripts -d"Don't run pre-, post- and life-cycle scripts" 541complete -f -c npm -n'__fish_npm_using_command prune' -l install-links -d'Install file: protocol deps as regular deps' 542complete -f -c npm -n'__fish_npm_using_command prune' -s h -l help -d'Display help' 543 544# publish 545complete -f -c npm -n __fish_npm_needs_command -a publish -d'Publish a package' 546complete -x -c npm -n'__fish_npm_using_command publish' -l tag -d'Upload to tag' 547complete -x -c npm -n'__fish_npm_using_command publish' -l access -d'Restrict access' -a"public\t'Publicly viewable' restricted\t'Restricted access (scoped packages only)'" 548complete -f -c npm -n'__fish_npm_using_command publish' -l dry-run -d'Do not make any changes' 549complete -x -c npm -n'__fish_npm_using_command publish' -l otp -d'2FA one-time password' 550complete -f -c npm -n'__fish_npm_using_command publish' -l provenance -d'Link to build location when publishing from CI/CD' 551complete -f -c npm -n'__fish_npm_using_command publish' -s h -l help -d'Display help' 552 553# query 554complete -f -c npm -n __fish_npm_needs_command -a query -d'Dependency selector query' 555complete -f -c npm -n'__fish_npm_using_command query' -s g -l global -d'Query global packages' 556complete -f -c npm -n'__fish_npm_using_command query' -s h -l help -d'Display help' 557 558# rebuild 559complete -f -c npm -n __fish_npm_needs_command -a rebuild -d'Rebuild a package' 560for cin rebuild rb 561complete -x -c npm -n"__fish_npm_using_command $c " -s g -l global -d'Rebuild global package' 562complete -f -c npm -n"__fish_npm_using_command $c " -l foreground-scripts -d'Run all build scripts in the foreground' 563complete -f -c npm -n"__fish_npm_using_command $c " -l ignore-scripts -d"Don't run pre-, post- and life-cycle scripts" 564complete -f -c npm -n"__fish_npm_using_command $c " -l no-bin-links -d"Don't symblink package executables" 565complete -f -c npm -n"__fish_npm_using_command $c " -l install-links -d'Install file: protocol deps as regular deps' 566complete -f -c npm -n"__fish_npm_using_command $c " -s h -l help -d'Display help' 567end 568 569# repo 570complete -f -c npm -n __fish_npm_needs_command -a repo -d'Open package repository page in the browser' 571complete -f -c npm -n'__fish_npm_using_command repo' -s g -l global -d'Display global root' 572complete -x -c npm -n'__fish_npm_using_command repo' -l browser -d'Set browser' 573complete -x -c npm -n'__fish_npm_using_command repo' -l no-browser -d'Print to stdout' 574complete -x -c npm -n'__fish_npm_using_command repo' -l registry -d'Registry base URL' 575complete -f -c npm -n'__fish_npm_using_command repo' -s h -l help -d'Display help' 576 577# restart 578# start 579# stop 580# test 581complete -f -c npm -n __fish_npm_needs_command -a restart -d'Restart a package' 582complete -f -c npm -n __fish_npm_needs_command -a start -d'Start a package' 583complete -f -c npm -n __fish_npm_needs_command -a stop -d'Stop a package' 584complete -f -c npm -n __fish_npm_needs_command -a test -d'Test a package' 585for cin restart start stop test tst t 586complete -f -c npm -n"__fish_npm_using_command $c " -s ignore-scripts -d"Don't run pre-, post- and life-cycle scripts" 587complete -x -c npm -n"__fish_npm_using_command $c " -s script-shell -d'The shell to use for scripts' 588complete -f -c npm -n"__fish_npm_using_command $c " -s h -l help -d'Display help' 589end 590 591# root 592complete -f -c npm -n __fish_npm_needs_command -a root -d'Display npm root' 593complete -f -c npm -n'__fish_npm_using_command root' -s g -l global -d'Display global root' 594complete -f -c npm -n'__fish_npm_using_command root' -s h -l help -d'Display help' 595 596# search 597complete -f -c npm -n __fish_npm_needs_command -a'search find' -d'Search for packages' 598for cin search find s se 599complete -f -c npm -n"__fish_npm_using_command $c " -s l -l long -d'Show extended information' 600complete -f -c npm -n"__fish_npm_using_command $c " -l json -d'Output JSON data' 601complete -f -c npm -n"__fish_npm_using_command $c " -l color -a always -d'Print color' 602complete -x -c npm -n"__fish_npm_using_command $c " -l color -a always -d'Print color' 603complete -f -c npm -n"__fish_npm_using_command $c " -l no-color -d"Don't print color" 604complete -f -c npm -n"__fish_npm_using_command $c " -s p -l parseable -d'Output parseable results' 605complete -f -c npm -n"__fish_npm_using_command $c " -l no-description -d"Don't show the description" 606complete -x -c npm -n"__fish_npm_using_command $c " -l searchopts -d'Space-separated search options' 607complete -x -c npm -n"__fish_npm_using_command $c " -l searchexclude -d'Space-separated options to exclude from search' 608complete -x -c npm -n"__fish_npm_using_command $c " -l registry -d'Registry base URL' 609complete -f -c npm -n"__fish_npm_using_command $c " -l prefer-online -d'Force staleness checks for cached data' 610complete -f -c npm -n"__fish_npm_using_command $c " -l prefer-offline -d'Bypass staleness checks for cached data' 611complete -f -c npm -n"__fish_npm_using_command $c " -l offline -d'Force offline mode' 612complete -f -c npm -n"__fish_npm_using_command $c " -s h -l help -d'Display help' 613end 614 615# shrinkwrap 616complete -f -c npm -n __fish_npm_needs_command -a shrinkwrap -d'Lock down dependency versions' 617complete -f -c npm -n'__fish_npm_using_command shrinkwrap' -s h -l help -d'Display help' 618 619# star 620complete -f -c npm -n __fish_npm_needs_command -a star -d'Mark your favorite packages' 621complete -x -c npm -n'__fish_npm_using_command star' -l registry -d'Registry base URL' 622complete -f -c npm -n'__fish_npm_using_command star' -l unicode -d'Use unicode characters in the output' 623complete -f -c npm -n'__fish_npm_using_command star' -l no-unicode -d'Use ascii characters over unicode glyphs' 624complete -x -c npm -n'__fish_npm_using_command star' -l otp -d'2FA one-time password' 625complete -f -c npm -n'__fish_npm_using_command star' -s h -l help -d'Display help' 626 627# stars 628complete -f -c npm -n __fish_npm_needs_command -a stars -d'View packages marked as favorites' 629complete -x -c npm -n'__fish_npm_using_command stars' -l registry -d'Registry base URL' 630complete -f -c npm -n'__fish_npm_using_command stars' -s h -l help -d'Display help' 631 632# team 633set -l team_commands'create destroy add rm ls' 634complete -f -c npm -n __fish_npm_needs_command -a team -d'Manage organization teams and team memberships' 635complete -x -c npm -n'__fish_npm_using_command team' -n"not __fish_seen_subcommand_from $team_commands " -a create -d'Create a new team' 636complete -x -c npm -n'__fish_npm_using_command team' -n"not __fish_seen_subcommand_from $team_commands " -a destroy -d'Destroy an existing team' 637complete -x -c npm -n'__fish_npm_using_command team' -n"not __fish_seen_subcommand_from $team_commands " -a add -d'Add a user to an existing team' 638complete -x -c npm -n'__fish_npm_using_command team' -n"not __fish_seen_subcommand_from $team_commands " -a rm -d'Remove users from a team' 639complete -x -c npm -n'__fish_npm_using_command team' -n"not __fish_seen_subcommand_from $team_commands " -a ls -d'List teams or team members' 640complete -x -c npm -n'__fish_npm_using_command team' -n'not __fish_seen_subcommand_from ls' -l otp -d'2FA one-time password' 641complete -x -c npm -n'__fish_npm_using_command team' -l registry -d'Registry base URL' 642complete -f -c npm -n'__fish_npm_using_command team' -s p -l parseable -d'Output parseable results' 643complete -f -c npm -n'__fish_npm_using_command team' -l json -d'Output JSON' 644complete -f -c npm -n'__fish_npm_using_command team' -s h -l help -d'Display help' 645 646# token 647set -l token_commands'create destroy add rm ls' 648complete -f -c npm -n __fish_npm_needs_command -a token -d'Manage your authentication tokens' 649complete -x -c npm -n'__fish_npm_using_command token' -n"not __fish_seen_subcommand_from $token_commands " -a list -d'Shows active authentication tokens' 650complete -x -c npm -n'__fish_npm_using_command token' -n"not __fish_seen_subcommand_from $token_commands " -a revoke -d'Revokes an authentication token' 651complete -x -c npm -n'__fish_npm_using_command token' -n"not __fish_seen_subcommand_from $token_commands " -a create -d'Create a new authentication token' 652complete -f -c npm -n'__fish_npm_using_command token' -n'__fish_seen_subcommand_from create' -l read-only -d'Mark a token as unable to publish' 653complete -x -c npm -n'__fish_npm_using_command token' -n'__fish_seen_subcommand_from create' -l cidr -d'List of CIDR address' 654complete -x -c npm -n'__fish_npm_using_command token' -l registry -d'Registry base URL' 655complete -x -c npm -n'__fish_npm_using_command token' -l otp -d'2FA one-time password' 656complete -f -c npm -n'__fish_npm_using_command token' -s h -l help -d'Display help' 657 658# update 659complete -f -c npm -n __fish_npm_needs_command -a'update up upgrade' -d'Update package(s)' 660for cin update up upgrade udpate 661complete -f -c npm -n"__fish_npm_using_command $c " -s S -l save -d'Save to dependencies' 662complete -x -c npm -n"__fish_npm_using_command $c " -l no-save -d'Do not remove package from your dependencies' 663complete -f -c npm -n"__fish_npm_using_command $c " -s g -l global -d'Update global package(s)' 664complete -x -c npm -n"__fish_npm_using_command $c " -l install-strategy -a'hoisted nested shallow linked' -d'Install strategy' 665complete -x -c npm -n"__fish_npm_using_command $c " -l omit -a'dev optional peer' -d'Omit dependency type' 666complete -x -c npm -n"__fish_npm_using_command $c " -l strict-peer-deps -d'Treat conflicting peerDependencies as failure' 667complete -x -c npm -n"__fish_npm_using_command $c " -l no-package-lock -d'Ignore package-lock.json' 668complete -f -c npm -n"__fish_npm_using_command $c " -l foreground-scripts -d'Run all build scripts in the foreground' 669complete -f -c npm -n"__fish_npm_using_command $c " -l ignore-scripts -d"Don't run pre-, post- and life-cycle scripts" 670complete -f -c npm -n"__fish_npm_using_command $c " -l no-audit -d"Don't submit audit reports" 671complete -f -c npm -n"__fish_npm_using_command $c " -l no-bin-links -d"Don't symblink package executables" 672complete -f -c npm -n"__fish_npm_using_command $c " -l no-fund -d"Don't display funding info" 673complete -f -c npm -n"__fish_npm_using_command $c " -l dry-run -d'Do not make any changes' 674complete -f -c npm -n"__fish_npm_using_command $c " -l install-links -d'Install file: protocol deps as regular deps' 675complete -f -c npm -n"__fish_npm_using_command $c " -s h -l help -d'Display help' 676end 677 678# uninstall 679complete -f -c npm -n __fish_npm_needs_command -a'uninstall remove un' -d'Remove a package' 680for cin uninstall unlink remove rm r un 681complete -x -c npm -n"__fish_npm_using_command $c " -d'Remove package' -a'(__npm_installed_local_packages)' 682complete -x -c npm -n"__fish_npm_using_command $c " -s g -l global -d'Remove global package' -a'(__npm_installed_global_packages)' 683complete -f -c npm -n"__fish_npm_using_command $c " -s S -l save -d'Save to dependencies' 684complete -x -c npm -n"__fish_npm_using_command $c " -l no-save -d'Do not remove package from your dependencies' 685complete -f -c npm -n"__fish_npm_using_command $c " -l install-links -d'Install file: protocol deps as regular deps' 686end 687 688# unpublish 689complete -f -c npm -n __fish_npm_needs_command -a unpublish -d'Remove a package from the registry' 690complete -x -c npm -n'__fish_npm_using_command unpublish' -l dry-run -d'Do not make any changes' 691complete -x -c npm -n'__fish_npm_using_command unpublish' -s f -l force -d'Removes various protections' 692complete -f -c npm -n'__fish_npm_using_command unpublish' -s h -l help -d'Display help' 693 694# unstar 695complete -f -c npm -n __fish_npm_needs_command -a unstar -d'Remove star from a package' 696complete -x -c npm -n'__fish_npm_using_command unstar' -l registry -d'Registry base URL' 697complete -f -c npm -n'__fish_npm_using_command unstar' -l unicode -d'Use unicode characters in the output' 698complete -f -c npm -n'__fish_npm_using_command unstar' -l no-unicode -d'Use ascii characters over unicode glyphs' 699complete -x -c npm -n'__fish_npm_using_command unstar' -l otp -d'2FA one-time password' 700complete -f -c npm -n'__fish_npm_using_command unstar' -s h -l help -d'Display help' 701 702# version 703complete -f -c npm -n __fish_npm_needs_command -a version -d'Bump a package version' 704for cin version verison 705complete -x -c npm -n"__fish_npm_using_command $c " -a'major minor patch premajor preminor prepatch prerelease' 706complete -f -c npm -n"__fish_npm_using_command $c " -l allow-same-version -d'Allow same version' 707complete -f -c npm -n"__fish_npm_using_command $c " -l no-commit-hooks -d"Don't run git commit hooks" 708complete -f -c npm -n"__fish_npm_using_command $c " -l no-git-tag-version -d"Don't tag the commit" 709complete -f -c npm -n"__fish_npm_using_command $c " -l json -d'Output JSON' 710complete -x -c npm -n"__fish_npm_using_command $c " -l preid -d'The prerelease identifier' 711complete -f -c npm -n"__fish_npm_using_command $c " -l sign-git-tag -d'Sign the version tag' 712complete -f -c npm -n"__fish_npm_using_command $c " -s h -l help -d'Display help' 713end 714 715# view 716complete -f -c npm -n __fish_npm_needs_command -a'view info' -d'View registry info' 717for cin view info v show 718complete -f -c npm -n"__fish_npm_using_command $c " -n'__fish_is_nth_token 2' 719complete -f -c npm -n"__fish_npm_using_command $c " -n'__fish_is_nth_token 3' -a'author bin bugs description engines exports homepage keywords license main name repository scripts type types' 720complete -f -c npm -n"__fish_npm_using_command $c " -n'__fish_is_nth_token 3' -a'dependencies devDependencies optionalDependencies peerDependencies' 721complete -f -c npm -n"__fish_npm_using_command $c " -n'__fish_is_nth_token 3' -a'directories dist dist-tags gitHead maintainers readme time users version versions' 722complete -f -c npm -n"__fish_npm_using_command $c " -l json -d'Output JSON' 723complete -f -c npm -n"__fish_npm_using_command $c " -s h -l help -d'Display help' 724end 725 726# whoami 727complete -f -c npm -n __fish_npm_needs_command -a whoami -d'Display npm username' 728complete -f -c npm -n'__fish_npm_using_command whoami' -a registry -d'Check registry' 729complete -f -c npm -n'__fish_npm_using_command whoami' -s h -l help -d'Display help' 730 731# misc 732complete -f -c npm -n'__fish_seen_subcommand_from add i in ins inst insta instal isnt isnta isntal isntall; and not __fish_is_switch' -a"(__npm_filtered_list_packages \" $npm_install \")"