├── .husky ├── .gitignore └── pre-commit ├── .tool-versions ├── .npmrc ├── .prettierignore ├── .github ├── FUNDING.yml ├── CODEOWNERS ├── dependabot.yml ├── workflows │ ├── danger.yml │ ├── lint.yml │ ├── typecheck.yml │ └── verify-cla.yml └── ISSUE_TEMPLATE │ └── config.yml ├── src ├── br.ts ├── hub.ts ├── tns.ts ├── nativescript.ts ├── preset.ts ├── @magnolia │ └── cli.ts ├── sta.ts ├── cl.ts ├── https.ts ├── kubecolor.ts ├── ua.ts ├── az │ ├── 2.53.0 │ │ ├── survey.ts │ │ ├── self-test.ts │ │ ├── feedback.ts │ │ ├── init.ts │ │ ├── version.ts │ │ ├── ai-examples.ts │ │ ├── logout.ts │ │ ├── find.ts │ │ ├── next.ts │ │ ├── upgrade.ts │ │ ├── configure.ts │ │ ├── interactive.ts │ │ ├── term.ts │ │ ├── cli-translator.ts │ │ └── scenario.ts │ └── index.ts ├── sls.ts ├── speedtest.ts ├── cap.ts ├── clion.ts ├── code-insiders.ts ├── ubuntu-advantage.ts ├── goland.ts ├── pip3.ts ├── phpstorm.ts ├── pycharm.ts ├── rubymine.ts ├── webstorm.ts ├── c++.ts ├── rustrover.ts ├── do.ts ├── time.ts ├── dotnet │ ├── dotnet-msbuild.ts │ ├── dotnet-help.ts │ ├── dotnet-build-server.ts │ └── dotnet-remove.ts ├── exec.ts ├── until.ts ├── while.ts ├── elif.ts ├── else.ts ├── export.ts ├── then.ts ├── unix2dos.ts ├── if.ts ├── nano.ts ├── nocorrect.ts ├── noglob.ts ├── repeat.ts ├── -.ts ├── source.ts ├── pushd.ts ├── create-video.ts ├── copyfile.ts ├── dirname.ts ├── copypath.ts ├── dotslash.ts ├── for.ts ├── rmdir.ts ├── figterm.ts ├── pwd.ts ├── create-remix.ts ├── vi.ts ├── lima.ts ├── nu.ts ├── @usermn │ └── sdc │ │ ├── index.ts │ │ └── 0.0.0.ts ├── tail.ts ├── command.ts ├── fly.ts ├── sw_vers.ts ├── pdfunite.ts ├── fig │ └── index.ts ├── w.ts ├── tee.ts ├── banner.ts ├── heroku │ ├── shared.ts │ └── index.ts ├── shopify │ └── index.ts ├── xdg-open.ts ├── g++.ts ├── infracost │ └── index.ts ├── basename.ts ├── task.ts ├── clear.ts ├── hostname.ts ├── mkfifo.ts ├── crontab.ts ├── sl.ts ├── svokit.ts ├── defaultbrowser.ts ├── iex.ts ├── create-completion-spec.ts ├── kdoctor.ts ├── aws │ └── regions.ts ├── unset.ts ├── nr.ts ├── rushx.ts ├── wc.ts ├── create-web3-frontend.ts ├── python │ └── http.server.ts ├── cd.ts ├── readlink.ts ├── electron.ts ├── pathchk.ts ├── build-storybook.ts ├── uname.ts ├── bunx.ts ├── ldd.ts ├── clang++.ts ├── sudo.ts ├── zip.ts ├── zed.ts ├── tac.ts ├── xcode-select.ts ├── dotenv.ts ├── login.ts ├── mailsy.ts ├── head.ts ├── git-profile.ts ├── wifi-password.ts ├── mkdir.ts ├── which.ts ├── mv.ts ├── unzip.ts ├── fold.ts ├── where.ts ├── rm.ts ├── adr.ts ├── bcd.ts ├── chsh.ts ├── echo.ts ├── trap.ts ├── nrm.ts ├── trash.ts ├── base32.ts ├── cal.ts ├── bc.ts ├── publish.ts ├── yank.ts ├── top.ts ├── phpunit-watcher.ts ├── autojump.ts ├── cot.ts ├── create-redwood-app.ts ├── su.ts ├── truncate.ts ├── passwd.ts ├── progressline.ts ├── gron.ts ├── networkQuality.ts ├── btop.ts ├── gibo.ts ├── do-release-upgrade.ts ├── mask.ts ├── hx.ts ├── kubens.ts ├── base64.ts ├── wrk.ts ├── httpy.ts ├── vimr.ts ├── nhost.ts ├── ni.ts ├── paste.ts ├── whence.ts ├── luz.ts ├── gltfjsx.ts ├── seq.ts ├── ln.ts ├── elm-format.ts ├── create-next-app.ts ├── nuxt.ts ├── remix.ts ├── java.ts ├── whereis.ts ├── osascript.ts ├── klist.ts ├── tsx.ts ├── cat.ts ├── mknod.ts ├── more.ts ├── twiggy.ts ├── xed.ts ├── sidekiq.ts ├── mackup.ts ├── tailcall.ts ├── visudo.ts ├── wing.ts ├── touch.ts ├── zipcloak.ts ├── df.ts ├── cut.ts └── env.ts ├── icons ├── q.png ├── aws.png ├── box.png ├── cpu.png ├── git.png ├── npm.png ├── alert.png ├── apple.png ├── azure.png ├── carrot.png ├── commit.png ├── docker.png ├── file.png ├── flag.png ├── folder.png ├── gcloud.png ├── gear.png ├── github.png ├── gitlab.png ├── gradle.png ├── heroku.png ├── invite.png ├── node.png ├── okteto.png ├── option.png ├── slack.png ├── string.png ├── vercel.png ├── yarn.png ├── android.png ├── asterisk.png ├── command.png ├── database.png ├── discord.png ├── firebase.png ├── netlify.png ├── package.png ├── red-flag.png ├── symlink.png ├── template.png ├── twitter.png ├── characters.png ├── commandkey.png ├── kubernetes.png ├── statusbar.png ├── default-file-icon.png ├── default-folder-icon.png ├── file.svg └── folder.svg ├── .eslintrc.cjs ├── .vscode ├── extensions.json └── settings.json ├── .gitignore ├── tsconfig.json ├── .devcontainer ├── Dockerfile └── devcontainer.json ├── LICENSE └── dangerfile-greeting.ts /.husky/.gitignore: -------------------------------------------------------------------------------- 1 | _ 2 | -------------------------------------------------------------------------------- /.tool-versions: -------------------------------------------------------------------------------- 1 | nodejs 20 -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | auto-install-peers=true -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | build/index.d.ts 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: withfig 2 | -------------------------------------------------------------------------------- /src/br.ts: -------------------------------------------------------------------------------- 1 | export { default } from "./broot"; 2 | -------------------------------------------------------------------------------- /src/hub.ts: -------------------------------------------------------------------------------- 1 | export { default } from "./git"; 2 | -------------------------------------------------------------------------------- /src/tns.ts: -------------------------------------------------------------------------------- 1 | export { default } from "./ns"; 2 | -------------------------------------------------------------------------------- /src/nativescript.ts: -------------------------------------------------------------------------------- 1 | export { default } from "./ns"; 2 | -------------------------------------------------------------------------------- /src/preset.ts: -------------------------------------------------------------------------------- 1 | export { default } from "./@preset/cli"; 2 | -------------------------------------------------------------------------------- /src/@magnolia/cli.ts: -------------------------------------------------------------------------------- 1 | export { default } from "../mgnl"; 2 | -------------------------------------------------------------------------------- /src/sta.ts: -------------------------------------------------------------------------------- 1 | export { default } from "./swagger-typescript-api"; 2 | -------------------------------------------------------------------------------- /icons/q.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/q.png -------------------------------------------------------------------------------- /icons/aws.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/aws.png -------------------------------------------------------------------------------- /icons/box.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/box.png -------------------------------------------------------------------------------- /icons/cpu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/cpu.png -------------------------------------------------------------------------------- /icons/git.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/git.png -------------------------------------------------------------------------------- /icons/npm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/npm.png -------------------------------------------------------------------------------- /icons/alert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/alert.png -------------------------------------------------------------------------------- /icons/apple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/apple.png -------------------------------------------------------------------------------- /icons/azure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/azure.png -------------------------------------------------------------------------------- /icons/carrot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/carrot.png -------------------------------------------------------------------------------- /icons/commit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/commit.png -------------------------------------------------------------------------------- /icons/docker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/docker.png -------------------------------------------------------------------------------- /icons/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/file.png -------------------------------------------------------------------------------- /icons/flag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/flag.png -------------------------------------------------------------------------------- /icons/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/folder.png -------------------------------------------------------------------------------- /icons/gcloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/gcloud.png -------------------------------------------------------------------------------- /icons/gear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/gear.png -------------------------------------------------------------------------------- /icons/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/github.png -------------------------------------------------------------------------------- /icons/gitlab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/gitlab.png -------------------------------------------------------------------------------- /icons/gradle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/gradle.png -------------------------------------------------------------------------------- /icons/heroku.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/heroku.png -------------------------------------------------------------------------------- /icons/invite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/invite.png -------------------------------------------------------------------------------- /icons/node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/node.png -------------------------------------------------------------------------------- /icons/okteto.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/okteto.png -------------------------------------------------------------------------------- /icons/option.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/option.png -------------------------------------------------------------------------------- /icons/slack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/slack.png -------------------------------------------------------------------------------- /icons/string.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/string.png -------------------------------------------------------------------------------- /icons/vercel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/vercel.png -------------------------------------------------------------------------------- /icons/yarn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/yarn.png -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npx lint-staged 5 | -------------------------------------------------------------------------------- /icons/android.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/android.png -------------------------------------------------------------------------------- /icons/asterisk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/asterisk.png -------------------------------------------------------------------------------- /icons/command.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/command.png -------------------------------------------------------------------------------- /icons/database.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/database.png -------------------------------------------------------------------------------- /icons/discord.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/discord.png -------------------------------------------------------------------------------- /icons/firebase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/firebase.png -------------------------------------------------------------------------------- /icons/netlify.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/netlify.png -------------------------------------------------------------------------------- /icons/package.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/package.png -------------------------------------------------------------------------------- /icons/red-flag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/red-flag.png -------------------------------------------------------------------------------- /icons/symlink.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/symlink.png -------------------------------------------------------------------------------- /icons/template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/template.png -------------------------------------------------------------------------------- /icons/twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/twitter.png -------------------------------------------------------------------------------- /.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: [ 3 | "@fig/autocomplete" 4 | ], 5 | }; 6 | -------------------------------------------------------------------------------- /icons/characters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/characters.png -------------------------------------------------------------------------------- /icons/commandkey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/commandkey.png -------------------------------------------------------------------------------- /icons/kubernetes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/kubernetes.png -------------------------------------------------------------------------------- /icons/statusbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/statusbar.png -------------------------------------------------------------------------------- /src/cl.ts: -------------------------------------------------------------------------------- 1 | import completionSpec from "./commercelayer"; 2 | export default completionSpec; 3 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"] 3 | } 4 | -------------------------------------------------------------------------------- /icons/default-file-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/default-file-icon.png -------------------------------------------------------------------------------- /icons/default-folder-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withfig/autocomplete/HEAD/icons/default-folder-icon.png -------------------------------------------------------------------------------- /src/https.ts: -------------------------------------------------------------------------------- 1 | import completionSpec from "./http"; 2 | export default { 3 | ...completionSpec, 4 | name: "https", 5 | }; 6 | -------------------------------------------------------------------------------- /src/kubecolor.ts: -------------------------------------------------------------------------------- 1 | // Kubecolor (https://github.com/dty1er/kubecolor) takes identical arguments to kubectl. 2 | export { default } from "./kubectl"; 3 | -------------------------------------------------------------------------------- /src/ua.ts: -------------------------------------------------------------------------------- 1 | import completionSpec from "./pro"; 2 | const Spec: Fig.Spec = { 3 | ...completionSpec, 4 | name: "ua", 5 | }; 6 | 7 | export default Spec; 8 | -------------------------------------------------------------------------------- /src/az/2.53.0/survey.ts: -------------------------------------------------------------------------------- 1 | const completion: Fig.Spec = { 2 | name: "survey", 3 | description: "Take Azure CLI survey", 4 | }; 5 | 6 | export default completion; 7 | -------------------------------------------------------------------------------- /src/sls.ts: -------------------------------------------------------------------------------- 1 | import serverless from "./serverless"; 2 | const completionSpec: Fig.Spec = { 3 | ...serverless, 4 | name: "sls", 5 | }; 6 | export default completionSpec; 7 | -------------------------------------------------------------------------------- /src/speedtest.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "speedtest", 3 | description: "", 4 | loadSpec: "speedtest-cli", 5 | }; 6 | export default completionSpec; 7 | -------------------------------------------------------------------------------- /src/az/2.53.0/self-test.ts: -------------------------------------------------------------------------------- 1 | const completion: Fig.Spec = { 2 | name: "self-test", 3 | description: "Runs a self-test of the CLI", 4 | }; 5 | 6 | export default completion; 7 | -------------------------------------------------------------------------------- /src/cap.ts: -------------------------------------------------------------------------------- 1 | import capacitor from "./capacitor"; 2 | 3 | const completionSpec: Fig.Spec = { 4 | ...capacitor, 5 | name: "cap", 6 | }; 7 | 8 | export default completionSpec; 9 | -------------------------------------------------------------------------------- /src/az/2.53.0/feedback.ts: -------------------------------------------------------------------------------- 1 | const completion: Fig.Spec = { 2 | name: "feedback", 3 | description: "Send feedback to the Azure CLI Team", 4 | }; 5 | 6 | export default completion; 7 | -------------------------------------------------------------------------------- /src/az/2.53.0/init.ts: -------------------------------------------------------------------------------- 1 | const completion: Fig.Spec = { 2 | name: "init", 3 | description: "It's an effortless setting up tool for configs", 4 | }; 5 | 6 | export default completion; 7 | -------------------------------------------------------------------------------- /src/clion.ts: -------------------------------------------------------------------------------- 1 | import { generateInteliJCompletionSpec } from "./idea"; 2 | 3 | const completionSpec = generateInteliJCompletionSpec("clion", "CLion"); 4 | export default completionSpec; 5 | -------------------------------------------------------------------------------- /src/code-insiders.ts: -------------------------------------------------------------------------------- 1 | import code from "./code"; 2 | 3 | const completionSpec: Fig.Spec = { 4 | ...code, 5 | name: "code-insiders", 6 | }; 7 | 8 | export default completionSpec; 9 | -------------------------------------------------------------------------------- /src/ubuntu-advantage.ts: -------------------------------------------------------------------------------- 1 | import completionSpec from "./pro"; 2 | const Spec: Fig.Spec = { 3 | ...completionSpec, 4 | name: "ubuntu-advantage", 5 | }; 6 | 7 | export default Spec; 8 | -------------------------------------------------------------------------------- /src/goland.ts: -------------------------------------------------------------------------------- 1 | import { generateInteliJCompletionSpec } from "./idea"; 2 | 3 | const completionSpec = generateInteliJCompletionSpec("goland", "GoLand"); 4 | export default completionSpec; 5 | -------------------------------------------------------------------------------- /src/pip3.ts: -------------------------------------------------------------------------------- 1 | import pipCompletionSpec from "./pip"; 2 | 3 | const completionSpec: Fig.Spec = { 4 | ...pipCompletionSpec, 5 | name: "pip3", 6 | }; 7 | 8 | export default completionSpec; 9 | -------------------------------------------------------------------------------- /src/phpstorm.ts: -------------------------------------------------------------------------------- 1 | import { generateInteliJCompletionSpec } from "./idea"; 2 | 3 | const completionSpec = generateInteliJCompletionSpec("phpstorm", "PhpStorm"); 4 | export default completionSpec; 5 | -------------------------------------------------------------------------------- /src/pycharm.ts: -------------------------------------------------------------------------------- 1 | import { generateInteliJCompletionSpec } from "./idea"; 2 | 3 | const completionSpec = generateInteliJCompletionSpec("pycharm", "PyCharm"); 4 | export default completionSpec; 5 | -------------------------------------------------------------------------------- /src/rubymine.ts: -------------------------------------------------------------------------------- 1 | import { generateInteliJCompletionSpec } from "./idea"; 2 | 3 | const completionSpec = generateInteliJCompletionSpec("rubymine", "RubyMine"); 4 | export default completionSpec; 5 | -------------------------------------------------------------------------------- /src/webstorm.ts: -------------------------------------------------------------------------------- 1 | import { generateInteliJCompletionSpec } from "./idea"; 2 | 3 | const completionSpec = generateInteliJCompletionSpec("webstorm", "WebStorm"); 4 | export default completionSpec; 5 | -------------------------------------------------------------------------------- /src/c++.ts: -------------------------------------------------------------------------------- 1 | import clangpp from "./clang++"; 2 | const completionSpec: Fig.Spec = { 3 | ...clangpp, 4 | name: "c++", 5 | description: "C++ compiler", 6 | }; 7 | export default completionSpec; 8 | -------------------------------------------------------------------------------- /src/rustrover.ts: -------------------------------------------------------------------------------- 1 | import { generateInteliJCompletionSpec } from "./idea"; 2 | 3 | const completionSpec = generateInteliJCompletionSpec("rustrover", "RustRover"); 4 | export default completionSpec; 5 | -------------------------------------------------------------------------------- /src/do.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "do", 3 | description: "Do the command", 4 | args: { 5 | isCommand: true, 6 | }, 7 | }; 8 | 9 | export default completionSpec; 10 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.defaultFormatter": "esbenp.prettier-vscode", 3 | "editor.codeActionsOnSave": { 4 | "source.fixAll.eslint": "explicit" 5 | }, 6 | "editor.formatOnSave": true 7 | } 8 | -------------------------------------------------------------------------------- /src/time.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "time", 3 | description: "Time how long a command takes!", 4 | args: { 5 | isCommand: true, 6 | }, 7 | }; 8 | 9 | export default completionSpec; 10 | -------------------------------------------------------------------------------- /src/dotnet/dotnet-msbuild.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "msbuild", 3 | description: 4 | "The dotnet msbuild command allows access to a fully functional MSBuild", 5 | }; 6 | 7 | export default completionSpec; 8 | -------------------------------------------------------------------------------- /src/exec.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "exec", 3 | description: "Replace the current shell with a program", 4 | args: { 5 | isCommand: true, 6 | }, 7 | }; 8 | 9 | export default completionSpec; 10 | -------------------------------------------------------------------------------- /src/until.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "until", 3 | description: "Repeat a command until this is true", 4 | args: { 5 | isCommand: true, 6 | }, 7 | }; 8 | 9 | export default completionSpec; 10 | -------------------------------------------------------------------------------- /src/while.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "while", 3 | description: "Repeat a command while this is true", 4 | args: { 5 | isCommand: true, 6 | }, 7 | }; 8 | 9 | export default completionSpec; 10 | -------------------------------------------------------------------------------- /src/elif.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "elif", 3 | description: "Execute if the previous condition returned 0", 4 | args: { 5 | isCommand: true, 6 | }, 7 | }; 8 | 9 | export default completionSpec; 10 | -------------------------------------------------------------------------------- /src/else.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "else", 3 | description: "Execute this command if the test returned 1", 4 | args: { 5 | isCommand: true, 6 | }, 7 | }; 8 | 9 | export default completionSpec; 10 | -------------------------------------------------------------------------------- /src/export.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "export", 3 | description: "Export variables", 4 | hidden: true, 5 | args: { 6 | isVariadic: true, 7 | }, 8 | }; 9 | 10 | export default completionSpec; 11 | -------------------------------------------------------------------------------- /src/then.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "then", 3 | description: "Execute this command if the test returned 0", 4 | args: { 5 | isCommand: true, 6 | }, 7 | }; 8 | 9 | export default completionSpec; 10 | -------------------------------------------------------------------------------- /src/unix2dos.ts: -------------------------------------------------------------------------------- 1 | import dos2unix from "./dos2unix"; 2 | 3 | const completionSpec: Fig.Spec = { 4 | ...dos2unix, 5 | name: "unix2dos", 6 | description: "Unix to DOS text file format convertor", 7 | }; 8 | export default completionSpec; 9 | -------------------------------------------------------------------------------- /src/if.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "if", 3 | description: "Conditionally execute based on the return value of a command", 4 | args: { 5 | isCommand: true, 6 | }, 7 | }; 8 | 9 | export default completionSpec; 10 | -------------------------------------------------------------------------------- /src/nano.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "nano", 3 | description: "Nano's ANOther editor, an enhanced free Pico clone", 4 | args: { 5 | template: "filepaths", 6 | }, 7 | }; 8 | 9 | export default completionSpec; 10 | -------------------------------------------------------------------------------- /src/az/2.53.0/version.ts: -------------------------------------------------------------------------------- 1 | const completion: Fig.Spec = { 2 | name: "version", 3 | description: 4 | "Show the versions of Azure CLI modules and extensions in JSON format by default or format configured by --output", 5 | }; 6 | 7 | export default completion; 8 | -------------------------------------------------------------------------------- /src/nocorrect.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "nocorrect", 3 | description: "ZSH pre-command modifier that disables correction", 4 | hidden: true, 5 | args: { 6 | isCommand: true, 7 | }, 8 | }; 9 | 10 | export default completionSpec; 11 | -------------------------------------------------------------------------------- /src/noglob.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "noglob", 3 | description: "ZSH pre-command modifier that disables glob expansion", 4 | hidden: true, 5 | args: { 6 | isCommand: true, 7 | }, 8 | }; 9 | 10 | export default completionSpec; 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | building_scripts/ 3 | node_modules 4 | dist 5 | build 6 | npm-debug.log 7 | .env 8 | 9 | .idea 10 | .vscode 11 | specs 12 | 13 | # we use pnpm-lock.yaml for dependency management 14 | package-lock.json 15 | yarn.lock 16 | .pnp.* 17 | .yarn/* 18 | -------------------------------------------------------------------------------- /src/repeat.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "repeat", 3 | description: 4 | "Interpret the result as a number and repeat the commands this many times", 5 | args: { 6 | isCommand: true, 7 | }, 8 | }; 9 | 10 | export default completionSpec; 11 | -------------------------------------------------------------------------------- /src/-.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "-", 3 | description: 4 | "ZSH pre-command modifier that prepends a '-' to the argv[0] string", 5 | hidden: true, 6 | args: { 7 | isCommand: true, 8 | }, 9 | }; 10 | 11 | export default completionSpec; 12 | -------------------------------------------------------------------------------- /src/source.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "source", 3 | description: "Source files in shell", 4 | args: { 5 | isVariadic: true, 6 | name: "File to source", 7 | template: "filepaths", 8 | }, 9 | }; 10 | 11 | export default completionSpec; 12 | -------------------------------------------------------------------------------- /src/pushd.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "pushd", 3 | description: 4 | "Change the current directory, and push the old current directory onto the directory stack", 5 | args: { 6 | template: "folders", 7 | }, 8 | }; 9 | 10 | export default completionSpec; 11 | -------------------------------------------------------------------------------- /src/create-video.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "create-video", 3 | description: "CLI used to create remotion video project", 4 | icon: "https://raw.githubusercontent.com/remotion-dev/remotion/main/packages/docs/static/img/logo-small.png", 5 | }; 6 | export default completionSpec; 7 | -------------------------------------------------------------------------------- /src/copyfile.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "copyfile", 3 | description: 4 | "Oh-My-Zsh plugin that copies the contents of a file to the clipboard", 5 | args: { 6 | name: "file", 7 | template: "filepaths", 8 | }, 9 | }; 10 | 11 | export default completionSpec; 12 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Each line is a file pattern followed by one or more owners. 2 | 3 | # These owners will be the default owners for everything in 4 | # the repo. Unless a later match takes precedence, 5 | # @global-owner1 and @global-owner2 will be requested for 6 | # review when someone opens a pull request. 7 | * @chaynabors @mschrage 8 | -------------------------------------------------------------------------------- /src/dirname.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "dirname", 3 | description: "Return directory portion of pathname", 4 | args: { 5 | name: "string", 6 | description: "String to operate on (typically filenames)", 7 | isVariadic: true, 8 | template: "filepaths", 9 | }, 10 | }; 11 | export default completionSpec; 12 | -------------------------------------------------------------------------------- /src/copypath.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "copypath", 3 | description: 4 | "Oh-My-Zsh plugin that copies the path of given directory or file to the clipboard", 5 | args: { 6 | name: "path", 7 | isOptional: true, 8 | template: ["filepaths", "folders"], 9 | }, 10 | }; 11 | 12 | export default completionSpec; 13 | -------------------------------------------------------------------------------- /src/dotslash.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "dotslash", 3 | args: { 4 | // This was previously just "filepaths", however, we added folders so 5 | // users of ohmyzsh could cd into a folder by typing the folder name without `cd` 6 | template: ["filepaths", "folders"], 7 | }, 8 | }; 9 | 10 | export default completionSpec; 11 | -------------------------------------------------------------------------------- /src/az/2.53.0/ai-examples.ts: -------------------------------------------------------------------------------- 1 | const completion: Fig.Spec = { 2 | name: "ai-examples", 3 | description: "Add AI powered examples to help content", 4 | subcommands: [ 5 | { 6 | name: "check-connection", 7 | description: "Check if the client can connect to the AI example service", 8 | }, 9 | ], 10 | }; 11 | 12 | export default completion; 13 | -------------------------------------------------------------------------------- /src/for.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "for", 3 | description: "Perform a set of commands multiple times", 4 | args: [ 5 | { 6 | name: "var", 7 | }, 8 | { 9 | suggestions: ["in"], 10 | }, 11 | { 12 | name: "values", 13 | isVariadic: true, 14 | }, 15 | ], 16 | }; 17 | 18 | export default completionSpec; 19 | -------------------------------------------------------------------------------- /src/dotnet/dotnet-help.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "help", 3 | description: 4 | "The dotnet help command opens up the reference page for more detailed information about the specified command at docs.microsoft.com", 5 | args: { 6 | name: "command", 7 | description: "Name of the .NET CLI command", 8 | }, 9 | }; 10 | 11 | export default completionSpec; 12 | -------------------------------------------------------------------------------- /src/rmdir.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "rmdir", 3 | description: "Remove directories", 4 | args: { 5 | isVariadic: true, 6 | template: "folders", 7 | }, 8 | 9 | options: [ 10 | { 11 | name: "-p", 12 | description: "Remove each directory of path", 13 | isDangerous: true, 14 | }, 15 | ], 16 | }; 17 | 18 | export default completionSpec; 19 | -------------------------------------------------------------------------------- /src/az/2.53.0/logout.ts: -------------------------------------------------------------------------------- 1 | const completion: Fig.Spec = { 2 | name: "logout", 3 | description: "Log out to remove access to Azure subscriptions", 4 | options: [ 5 | { 6 | name: "--username", 7 | description: 8 | "Account user, if missing, logout the current active account", 9 | args: { name: "username" }, 10 | }, 11 | ], 12 | }; 13 | 14 | export default completion; 15 | -------------------------------------------------------------------------------- /src/figterm.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "figterm", 3 | description: "Fig's terminal layer", 4 | options: [ 5 | { 6 | name: ["--help", "-h"], 7 | description: "Print help information", 8 | }, 9 | { 10 | name: ["--version", "-V"], 11 | description: "Print version information", 12 | }, 13 | ], 14 | }; 15 | 16 | export default completionSpec; 17 | -------------------------------------------------------------------------------- /src/pwd.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "pwd", 3 | description: "Return working directory name", 4 | options: [ 5 | { 6 | name: "-L", 7 | description: "Display the logical current working directory", 8 | }, 9 | { 10 | name: "-P", 11 | description: "Display the physical current working directory", 12 | }, 13 | ], 14 | }; 15 | 16 | export default completionSpec; 17 | -------------------------------------------------------------------------------- /src/create-remix.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "create-remix", 3 | icon: "https://remix.run/favicon-light.1.png", 4 | options: [ 5 | { 6 | name: ["-h", "--help"], 7 | description: "Display help for command", 8 | }, 9 | { 10 | name: ["-v", "--version"], 11 | description: "Display version for command", 12 | }, 13 | ], 14 | }; 15 | 16 | export default completionSpec; 17 | -------------------------------------------------------------------------------- /src/vi.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "vi", 3 | description: 4 | "Vi[m] is an one of two powerhouse text editors in the Unix world, the other being EMACS", 5 | args: { 6 | template: "filepaths", 7 | }, 8 | options: [ 9 | { 10 | name: ["-h", "--help"], 11 | description: "Print help message for vi and exit", 12 | }, 13 | ], 14 | }; 15 | 16 | export default completionSpec; 17 | -------------------------------------------------------------------------------- /src/lima.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "lima", 3 | description: 'Lima is an alias for "limactl shell $LIMA_INSTANCE"', 4 | args: { 5 | name: "COMMAND", 6 | isVariadic: true, 7 | isOptional: true, 8 | isCommand: true, 9 | }, 10 | options: [ 11 | { 12 | name: ["-h", "--help"], 13 | description: "Help for lima", 14 | }, 15 | ], 16 | }; 17 | 18 | export default completionSpec; 19 | -------------------------------------------------------------------------------- /src/nu.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "nu", 3 | description: "Use the right package manage - upgrade", 4 | options: [ 5 | { 6 | name: "-i", 7 | description: 8 | "Display the outdated packages before performing any upgrade", 9 | }, 10 | { 11 | name: ["-h", "--help"], 12 | description: "Output usage information", 13 | }, 14 | ], 15 | }; 16 | export default completionSpec; 17 | -------------------------------------------------------------------------------- /src/@usermn/sdc/index.ts: -------------------------------------------------------------------------------- 1 | import { createVersionedSpec } from "@fig/autocomplete-helpers"; 2 | const versionFiles = ["0.0.0"]; 3 | export const getVersionCommand: Fig.GetVersionCommand = async ( 4 | executeShellCommand 5 | ) => { 6 | return ( 7 | await executeShellCommand({ 8 | command: "npx", 9 | args: ["@usermn/sdc", "--version"], 10 | }) 11 | ).stdout; 12 | }; 13 | export default createVersionedSpec("@usermn/sdc", versionFiles); 14 | -------------------------------------------------------------------------------- /src/az/index.ts: -------------------------------------------------------------------------------- 1 | import { createVersionedSpec } from "@fig/autocomplete-helpers"; 2 | const versionFiles = ["2.53.0"]; 3 | export const getVersionCommand: Fig.GetVersionCommand = async ( 4 | executeShellCommand 5 | ) => 6 | JSON.parse( 7 | ( 8 | await executeShellCommand({ 9 | command: "az", 10 | args: ["version", "-o", "json"], 11 | }) 12 | ).stdout 13 | )["azure-cli"]; 14 | export default createVersionedSpec("az", versionFiles); 15 | -------------------------------------------------------------------------------- /src/tail.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "tail", 3 | description: "Display the last part of a file", 4 | args: { 5 | isVariadic: true, 6 | template: "filepaths", 7 | }, 8 | options: [ 9 | { 10 | name: "-f", 11 | description: "Wait for additional data to be appended", 12 | }, 13 | { 14 | name: "-r", 15 | description: "Display in reverse order", 16 | }, 17 | ], 18 | }; 19 | 20 | export default completionSpec; 21 | -------------------------------------------------------------------------------- /src/az/2.53.0/find.ts: -------------------------------------------------------------------------------- 1 | const completion: Fig.Spec = { 2 | name: "find", 3 | description: 4 | "I'm an AI robot, my advice is based on our Azure documentation as well as the usage patterns of Azure CLI and Azure ARM users. Using me improves Azure products and documentation", 5 | 6 | args: { 7 | name: "", 8 | description: "An Azure CLI command or group for which you need an example", 9 | isOptional: true, 10 | }, 11 | }; 12 | 13 | export default completion; 14 | -------------------------------------------------------------------------------- /src/az/2.53.0/next.ts: -------------------------------------------------------------------------------- 1 | const completion: Fig.Spec = { 2 | name: "next", 3 | description: "Recommend the possible next set of commands to take", 4 | options: [ 5 | { 6 | name: ["--command", "-c"], 7 | description: "Specify this parameter will only recommend commands", 8 | }, 9 | { 10 | name: ["--scenario", "-s"], 11 | description: "Specify this parameter will only recommend E2E scenarios", 12 | }, 13 | ], 14 | }; 15 | 16 | export default completion; 17 | -------------------------------------------------------------------------------- /src/az/2.53.0/upgrade.ts: -------------------------------------------------------------------------------- 1 | const completion: Fig.Spec = { 2 | name: "upgrade", 3 | description: "Upgrade Azure CLI and extensions", 4 | options: [ 5 | { 6 | name: "--all", 7 | description: "Enable updating extensions as well", 8 | args: { name: "all", suggestions: ["false", "true"] }, 9 | }, 10 | { 11 | name: ["--yes", "-y"], 12 | description: "Do not prompt for checking release notes", 13 | }, 14 | ], 15 | }; 16 | 17 | export default completion; 18 | -------------------------------------------------------------------------------- /src/command.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "command", 3 | description: "Run an external command", 4 | // There are other options but they're not common between fish/zsh/bash. 5 | // generateSpec doesn't have a `context` object to get the process. 6 | options: [ 7 | { 8 | name: "-v", 9 | description: "Print the location of the command", 10 | }, 11 | ], 12 | args: { 13 | isCommand: true, 14 | }, 15 | }; 16 | 17 | export default completionSpec; 18 | -------------------------------------------------------------------------------- /src/fly.ts: -------------------------------------------------------------------------------- 1 | // Completion spec for fly, alias to the flyctl CLI. 2 | // See completion spec in the ./flyctl.ts file 3 | 4 | // Note: Most installations of flyctl also alias flyctl to fly as a command 5 | // name and this will become the default name in the future. During the 6 | // transition, note that where you see flyctl as a command it can be replaced 7 | // with fly. 8 | 9 | import completionSpec from "./flyctl"; 10 | 11 | export default { 12 | ...completionSpec, 13 | name: "fly", 14 | }; 15 | -------------------------------------------------------------------------------- /src/sw_vers.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "sw_vers", 3 | description: "Print macOS version information", 4 | options: [ 5 | { 6 | name: "-productName", 7 | description: "Print product name", 8 | }, 9 | { 10 | name: "-productVersion", 11 | description: "Print product version", 12 | }, 13 | { 14 | name: "-buildVersion", 15 | description: "Print build version", 16 | }, 17 | ], 18 | }; 19 | 20 | export default completionSpec; 21 | -------------------------------------------------------------------------------- /src/pdfunite.ts: -------------------------------------------------------------------------------- 1 | import { filepaths } from "@fig/autocomplete-generators"; 2 | 3 | const completionSpec: Fig.Spec = { 4 | name: "pdfunite", 5 | description: "Combine multiple pdfs", 6 | options: [ 7 | { name: "-v", description: "Print copyright and version info" }, 8 | { name: ["-h", "--help", "-?"], description: "Print usage information" }, 9 | ], 10 | args: { 11 | generators: filepaths({ extensions: ["pdf"] }), 12 | isVariadic: true, 13 | }, 14 | }; 15 | 16 | export default completionSpec; 17 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "daily" 7 | open-pull-requests-limit: 100 8 | - package-ecosystem: "npm" 9 | directory: "/" 10 | schedule: 11 | interval: "weekly" 12 | open-pull-requests-limit: 100 13 | groups: 14 | typescript-eslint: 15 | patterns: 16 | - "@typescript-eslint/*" 17 | fig: 18 | patterns: 19 | - "@fig/*" 20 | - "@withfig/*" 21 | -------------------------------------------------------------------------------- /src/fig/index.ts: -------------------------------------------------------------------------------- 1 | import { createVersionedSpec } from "@fig/autocomplete-helpers"; 2 | const versionFiles = ["1.0.0", "2.0.0"]; 3 | export const getVersionCommand: Fig.GetVersionCommand = async ( 4 | executeShellCommand 5 | ) => { 6 | const { stdout } = await executeShellCommand({ 7 | command: "fig", 8 | // eslint-disable-next-line @withfig/fig-linter/no-useless-arrays 9 | args: ["--version"], 10 | }); 11 | return stdout.slice(stdout.indexOf(" ") + 1); 12 | }; 13 | export default createVersionedSpec("fig", versionFiles); 14 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "moduleResolution": "node", 4 | "outDir": "./build", 5 | "target": "ES2018", 6 | "module": "ESNext", 7 | "lib": [ 8 | "ES2018", 9 | "DOM" 10 | ], 11 | "noImplicitAny": false, 12 | "allowSyntheticDefaultImports": true, 13 | "baseUrl": "./", 14 | "types": [ 15 | "@withfig/autocomplete-types" 16 | ] 17 | }, 18 | "exclude": [ 19 | "node_modules/" 20 | ], 21 | "include": [ 22 | "./src/**/*", 23 | "dangerfile.ts" 24 | ] 25 | } -------------------------------------------------------------------------------- /src/w.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "w", 3 | description: "Display who is logged in and what they are doing", 4 | parserDirectives: { 5 | optionsMustPrecedeArguments: true, 6 | }, 7 | options: [ 8 | { 9 | name: "-h", 10 | description: "Suppress the heading", 11 | }, 12 | { 13 | name: "-i", 14 | description: "Output is sorted by idle time", 15 | }, 16 | ], 17 | args: { 18 | name: "user", 19 | isVariadic: true, 20 | isOptional: true, 21 | }, 22 | }; 23 | export default completionSpec; 24 | -------------------------------------------------------------------------------- /src/tee.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "tee", 3 | description: "Duplicate standard input", 4 | options: [ 5 | { 6 | name: "-a", 7 | description: 8 | "Append the output to the files rather than overwriting them", 9 | }, 10 | { 11 | name: "-i", 12 | description: "Ignore the SIGINT signal", 13 | }, 14 | ], 15 | args: { 16 | name: "file", 17 | description: "Pathname of an output file", 18 | isVariadic: true, 19 | template: "filepaths", 20 | }, 21 | }; 22 | export default completionSpec; 23 | -------------------------------------------------------------------------------- /src/banner.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "banner", 3 | description: "Prints a large, high quality banner on the standard output", 4 | args: { name: "text" }, 5 | options: [ 6 | { 7 | name: "-t", 8 | description: "Enable trace", 9 | }, 10 | { 11 | name: "-d", 12 | description: "Enable debug", 13 | }, 14 | { 15 | name: "-w", 16 | description: 17 | "Change the output from a width of 132 to width, suitable for a narrow terminal", 18 | }, 19 | ], 20 | }; 21 | 22 | export default completionSpec; 23 | -------------------------------------------------------------------------------- /src/heroku/shared.ts: -------------------------------------------------------------------------------- 1 | export const getAppGenerator: Fig.Generator = { 2 | script: ["heroku", "apps", "--all", "--json"], 3 | cache: { 4 | strategy: "stale-while-revalidate", 5 | }, 6 | scriptTimeout: 15000, 7 | postProcess: function (out) { 8 | try { 9 | return JSON.parse(out).map((app) => { 10 | return { 11 | name: app.name, 12 | description: app.name, 13 | icon: "https://www.herokucdn.com/favicon.ico", 14 | }; 15 | }); 16 | } catch (e) { 17 | return []; 18 | } 19 | }, 20 | }; 21 | 22 | export default {}; 23 | -------------------------------------------------------------------------------- /src/shopify/index.ts: -------------------------------------------------------------------------------- 1 | import { createVersionedSpec } from "@fig/autocomplete-helpers"; 2 | const versionFiles = ["2.0.0", "3.0.0"]; 3 | export const getVersionCommand: Fig.GetVersionCommand = async ( 4 | executeShellCommand 5 | ) => { 6 | const versionRegex = /\d+\.\d+\.\d+/; 7 | const { stdout } = await executeShellCommand({ 8 | command: "shopify", 9 | // eslint-disable-next-line @withfig/fig-linter/no-useless-arrays 10 | args: ["version"], 11 | }); 12 | return stdout.match(versionRegex)?.[0] ?? ""; 13 | }; 14 | export default createVersionedSpec("shopify", versionFiles); 15 | -------------------------------------------------------------------------------- /src/xdg-open.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "xdg-open", 3 | description: "Opens a file or URL in the user's preferred application", 4 | args: { 5 | name: "FILE or URL", 6 | template: "filepaths", 7 | }, 8 | options: [ 9 | { 10 | name: "--help", 11 | description: "Show command synopsis", 12 | }, 13 | { 14 | name: "--manual", 15 | description: "Show manual page", 16 | }, 17 | { 18 | name: "--version", 19 | description: "Show the xdg-utils version information", 20 | }, 21 | ], 22 | }; 23 | export default completionSpec; 24 | -------------------------------------------------------------------------------- /src/g++.ts: -------------------------------------------------------------------------------- 1 | import { gccBase } from "./gcc"; 2 | import { stdCPPSuggestions } from "./clang"; 3 | 4 | const completionSpec: Fig.Spec = { 5 | ...gccBase, 6 | name: "g++", 7 | description: "The default C++ compiler for most linux distributions", 8 | options: [ 9 | ...(gccBase as Fig.Subcommand).options, 10 | { 11 | name: "-std", 12 | description: "Language standard to compile for", 13 | args: { 14 | name: "value", 15 | suggestions: [...stdCPPSuggestions], 16 | }, 17 | requiresSeparator: true, 18 | }, 19 | ], 20 | }; 21 | export default completionSpec; 22 | -------------------------------------------------------------------------------- /src/infracost/index.ts: -------------------------------------------------------------------------------- 1 | import { createVersionedSpec } from "@fig/autocomplete-helpers"; 2 | import { clean } from "semver"; 3 | const versionFiles = ["0.9.0", "0.10.0"]; 4 | 5 | export const getVersionCommand: Fig.GetVersionCommand = async ( 6 | executeShellCommand 7 | ) => { 8 | const { stdout } = await executeShellCommand({ 9 | command: "infracost", 10 | // eslint-disable-next-line @withfig/fig-linter/no-useless-arrays 11 | args: ["--version"], 12 | }); 13 | return clean(stdout.slice(stdout.indexOf(" ") + 1)); 14 | }; 15 | 16 | export default createVersionedSpec("infracost", versionFiles); 17 | -------------------------------------------------------------------------------- /src/basename.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "basename", 3 | description: "Return filename portion of pathname", 4 | options: [ 5 | { 6 | name: "-a", 7 | description: "Treat every argument as a string", 8 | }, 9 | { 10 | name: "-s", 11 | description: "Suffix to remove from string", 12 | args: { 13 | name: "suffix", 14 | }, 15 | }, 16 | ], 17 | args: { 18 | name: "string", 19 | description: "String to operate on (typically filenames)", 20 | isVariadic: true, 21 | template: "filepaths", 22 | }, 23 | }; 24 | export default completionSpec; 25 | -------------------------------------------------------------------------------- /src/task.ts: -------------------------------------------------------------------------------- 1 | import goTask from "./task/go-task"; 2 | import taskWarrior from "./task/taskwarrior"; 3 | 4 | const completionSpec: Fig.Spec = { 5 | name: "task", 6 | // loadSpec doesn't work for root commands (https://github.com/withfig/autocomplete/issues/223) 7 | generateSpec: async (_tokens, executeShellCommand) => { 8 | const { stdout } = await executeShellCommand({ 9 | command: "task", 10 | // eslint-disable-next-line @withfig/fig-linter/no-useless-arrays 11 | args: ["--version"], 12 | }); 13 | return stdout.includes("Task") ? goTask : taskWarrior; 14 | }, 15 | }; 16 | 17 | export default completionSpec; 18 | -------------------------------------------------------------------------------- /src/clear.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "clear", 3 | description: "Clear the terminal screen", 4 | options: [ 5 | { 6 | name: "-T", 7 | description: "Indicates the type of terminal", 8 | args: { 9 | name: "type", 10 | }, 11 | }, 12 | { 13 | name: "-V", 14 | description: "Reports version of ncurses used in this program, and exits", 15 | }, 16 | { 17 | name: "-x", 18 | description: 19 | "Do not attempt to clear terminal's scrollback buffer using the extended E3 capability", 20 | }, 21 | ], 22 | }; 23 | 24 | export default completionSpec; 25 | -------------------------------------------------------------------------------- /src/hostname.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "hostname", 3 | description: "Set or print name of current host system", 4 | options: [ 5 | { 6 | name: "-f", 7 | description: "Include domain information in the printed name", 8 | }, 9 | { 10 | name: "-s", 11 | description: "Trim off any domain information from the printed name", 12 | }, 13 | { 14 | name: "-d", 15 | description: "Only print domain information", 16 | }, 17 | ], 18 | args: { 19 | name: "hostname", 20 | description: "The hostname to use for this machine", 21 | }, 22 | }; 23 | export default completionSpec; 24 | -------------------------------------------------------------------------------- /src/mkfifo.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "mkfifo", 3 | description: "Make FIFOs (first-in, first-out)", 4 | options: [ 5 | { 6 | name: "-m", 7 | description: 8 | "Set the file permission bits of newly-created fifos to mode, without respect to the current umask; the mode is specified as in chmod(1)", 9 | args: { 10 | name: "MODE", 11 | suggestions: ["0666", "0644", "0444"], 12 | default: "0666", 13 | }, 14 | }, 15 | ], 16 | args: { 17 | name: "FIFO", 18 | description: "FIFO(s) to create", 19 | isVariadic: true, 20 | }, 21 | }; 22 | export default completionSpec; 23 | -------------------------------------------------------------------------------- /src/crontab.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "crontab", 3 | description: "Maintain crontab file for individual users", 4 | options: [ 5 | { 6 | name: "-e", 7 | description: "Edit the current crontab", 8 | }, 9 | { 10 | name: "-l", 11 | description: "Display the current crontab", 12 | }, 13 | { 14 | name: "-r", 15 | description: "Remove the current crontab", 16 | isDangerous: true, 17 | }, 18 | { 19 | name: "-u", 20 | description: 21 | "Specify the name of the user whose crontab is to be tweaked", 22 | }, 23 | ], 24 | }; 25 | 26 | export default completionSpec; 27 | -------------------------------------------------------------------------------- /src/sl.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "sl", 3 | description: 4 | "A highly advanced animation program for curing your bad habit of mistyping", 5 | options: [ 6 | { 7 | name: "-a", 8 | description: "An accident is occurring; people cry for help", 9 | }, 10 | { name: "-l", description: "Little version" }, 11 | { 12 | name: "-F", 13 | description: "It flies like the galaxy express 999", 14 | }, 15 | { 16 | name: "-c", 17 | description: "C51 appears instead of D51", 18 | }, 19 | ], 20 | // Only uncomment if sl takes an argument 21 | // args: {} 22 | }; 23 | export default completionSpec; 24 | -------------------------------------------------------------------------------- /src/svokit.ts: -------------------------------------------------------------------------------- 1 | // can be found at https://github.com/mavthedev/svokit.io 2 | /* 3 | Svokit is a library that combines sveltekit with socket.io. 4 | */ 5 | 6 | const completionSpec: Fig.Spec = { 7 | name: "svokit", 8 | description: "Runs built svokit project", 9 | subcommands: [ 10 | { 11 | name: "setup", 12 | description: "Creates svokit config (experimental)", 13 | }, 14 | { 15 | name: "run", 16 | description: "Runs build svokit project", 17 | }, 18 | ], 19 | options: [ 20 | { 21 | name: ["--help", "-h"], 22 | description: "Show help for svokit", 23 | }, 24 | ], 25 | }; 26 | export default completionSpec; 27 | -------------------------------------------------------------------------------- /.github/workflows/danger.yml: -------------------------------------------------------------------------------- 1 | name: Check PR 2 | 3 | on: [pull_request_target] 4 | jobs: 5 | danger: 6 | runs-on: ubuntu-latest 7 | steps: 8 | - uses: actions/checkout@v4 9 | - uses: actions/setup-node@v4 10 | with: 11 | node-version-file: package.json 12 | - name: Install pnpm 13 | uses: pnpm/action-setup@v4.0.0 14 | - run: pnpm install --frozen-lockfile 15 | - run: pnpm danger ci 16 | env: 17 | DANGER_GITHUB_API_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN }} 18 | - run: pnpm danger ci -d ./dangerfile-greeting.ts 19 | env: 20 | DANGER_GITHUB_API_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN }} 21 | -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions 3 | name: Run Linter 4 | 5 | on: [push, pull_request] 6 | jobs: 7 | lint: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/checkout@v4 11 | - uses: actions/setup-node@v4 12 | with: 13 | node-version-file: package.json 14 | - name: Install pnpm 15 | uses: pnpm/action-setup@v4.0.0 16 | - run: pnpm install --frozen-lockfile 17 | - run: pnpm lint 18 | -------------------------------------------------------------------------------- /src/defaultbrowser.ts: -------------------------------------------------------------------------------- 1 | const getInstalledBrowsers: Fig.Generator = { 2 | script: ["defaultbrowser"], 3 | postProcess: function (out) { 4 | return out.split("\n").map((line) => { 5 | /* We ignore the already set browser */ 6 | if (line.startsWith("*")) { 7 | return {}; 8 | } 9 | const browserName = line.trim(); 10 | return { 11 | name: browserName, 12 | }; 13 | }); 14 | }, 15 | }; 16 | 17 | const completionSpec: Fig.Spec = { 18 | name: "defaultbrowser", 19 | description: "Change your default browser from the CLI", 20 | args: { isOptional: true, generators: getInstalledBrowsers }, 21 | }; 22 | 23 | export default completionSpec; 24 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | --- 2 | blank_issues_enabled: true 3 | contact_links: 4 | - about: "My issue does not relate to a specific completion spec - withfig/fig" 5 | name: Other Issue 6 | url: "https://github.com/withfig/fig/issues/new/choose" 7 | - about: "Find detailed guides about common support issues in our forum" 8 | name: "💬 GitHub Discussions" 9 | url: "https://github.com/withfig/fig/discussions" 10 | - about: "Get instant support from the Fig Community Discord" 11 | name: "👋 Discord" 12 | url: "https://fig.io/community" 13 | - about: "Get support from the Fig team at hello@fig.io" 14 | name: "📩 Email" 15 | url: "https://tinyurl.com/y4m9zqlw" 16 | -------------------------------------------------------------------------------- /.github/workflows/typecheck.yml: -------------------------------------------------------------------------------- 1 | # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions 3 | 4 | name: Typecheck Files 5 | 6 | on: [push, pull_request] 7 | jobs: 8 | typecheck: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v4 12 | - uses: actions/setup-node@v4 13 | with: 14 | node-version-file: package.json 15 | - name: Install pnpm 16 | uses: pnpm/action-setup@v4.0.0 17 | - run: pnpm install --frozen-lockfile 18 | - run: pnpm test 19 | -------------------------------------------------------------------------------- /src/iex.ts: -------------------------------------------------------------------------------- 1 | import elixir from "./elixir"; 2 | 3 | const completionSpec: Fig.Spec = { 4 | ...elixir, 5 | name: "iex", 6 | description: "Elixir Interactive Shell", 7 | options: [ 8 | ...elixir.options, 9 | { 10 | name: "--dot-iex", 11 | description: 12 | "Overrides default .iex.exs file and uses path instead; path can be empty, then no file will be loaded", 13 | args: { 14 | name: "PATH", 15 | template: "filepaths", 16 | }, 17 | }, 18 | { 19 | name: "--remsh", 20 | description: "Connects to a node using a remote shell", 21 | args: { 22 | name: "NAME", 23 | }, 24 | }, 25 | ], 26 | }; 27 | 28 | export default completionSpec; 29 | -------------------------------------------------------------------------------- /src/heroku/index.ts: -------------------------------------------------------------------------------- 1 | import { createVersionedSpec } from "@fig/autocomplete-helpers"; 2 | 3 | const versionRegex = /heroku\/([0-9]+\.[0-9]+\.[0.9]+)/; 4 | const versionFiles = ["8.0.0", "8.6.0"]; 5 | 6 | export const getVersionCommand: Fig.GetVersionCommand = async ( 7 | executeShellCommand 8 | ) => { 9 | const { stdout } = await executeShellCommand({ 10 | command: "heroku", 11 | // eslint-disable-next-line @withfig/fig-linter/no-useless-arrays 12 | args: ["--version"], 13 | }); 14 | 15 | const regexResult = versionRegex.exec(stdout); 16 | if (regexResult) { 17 | return regexResult[1]; 18 | } else { 19 | return "8.0.0"; 20 | } 21 | }; 22 | 23 | export default createVersionedSpec("heroku", versionFiles); 24 | -------------------------------------------------------------------------------- /src/create-completion-spec.ts: -------------------------------------------------------------------------------- 1 | // Autogenerated by @fig/complete-commander 2 | const completionSpec: Fig.Spec = { 3 | name: "create-completion-spec", 4 | description: "Setup fig folder and create spec with the given name", 5 | subcommands: [ 6 | { 7 | name: "help", 8 | description: "Display help for command", 9 | priority: 49, 10 | args: { name: "command", isOptional: true }, 11 | }, 12 | ], 13 | options: [ 14 | { 15 | name: "--here", 16 | description: "Set if the spec should be created in the current folder", 17 | }, 18 | { 19 | name: ["-h", "--help"], 20 | description: "Display help for command", 21 | priority: 49, 22 | }, 23 | ], 24 | args: { name: "name" }, 25 | }; 26 | export default completionSpec; 27 | -------------------------------------------------------------------------------- /src/kdoctor.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "kdoctor", 3 | description: 4 | "Tool that helps to set up the environment for Kotlin Multiplatform Mobile app development", 5 | options: [ 6 | { 7 | name: "--version", 8 | description: "Report a version of KDoctor", 9 | }, 10 | { 11 | name: ["--verbose", "-v"], 12 | description: "Report an extended information", 13 | }, 14 | { 15 | name: ["--all", "-a"], 16 | description: "Run extra diagnostics", 17 | }, 18 | { 19 | name: "--team-ids", 20 | description: "Report all available Apple dev team ids", 21 | }, 22 | { 23 | name: ["--help", "-h"], 24 | description: "Usage info", 25 | }, 26 | ], 27 | }; 28 | export default completionSpec; 29 | -------------------------------------------------------------------------------- /src/aws/regions.ts: -------------------------------------------------------------------------------- 1 | const awsRegions: string[] = [ 2 | "af-south-1", 3 | "ap-east-1", 4 | "ap-northeast-1", 5 | "ap-northeast-2", 6 | "ap-northeast-3", 7 | "ap-south-1", 8 | "ap-south-2", 9 | "ap-southeast-1", 10 | "ap-southeast-2", 11 | "ap-southeast-3", 12 | "ap-southeast-4", 13 | "ca-central-1", 14 | "ca-west-1", 15 | "cn-north-1", 16 | "cn-northwest-1", 17 | "eu-central-1", 18 | "eu-central-2", 19 | "eu-north-1", 20 | "eu-south-1", 21 | "eu-south-2", 22 | "eu-west-1", 23 | "eu-west-2", 24 | "eu-west-3", 25 | "il-central-1", 26 | "me-central-1", 27 | "me-south-1", 28 | "sa-east-1", 29 | "us-east-1", 30 | "us-east-2", 31 | "us-gov-east-1", 32 | "us-gov-west-1", 33 | "us-west-1", 34 | "us-west-2", 35 | ]; 36 | 37 | export default awsRegions; 38 | -------------------------------------------------------------------------------- /src/unset.ts: -------------------------------------------------------------------------------- 1 | const environmentVariableGenerator: Fig.Generator = { 2 | script: ["env"], 3 | postProcess: (out) => 4 | out.length === 0 5 | ? [] 6 | : out 7 | .split("\n") 8 | .map((env) => env.split("=")[0]) 9 | .map((suggestion) => ({ 10 | name: `${suggestion}`, 11 | type: "arg", 12 | description: "Environment Variable", 13 | })), 14 | }; 15 | 16 | const completionSpec: Fig.Spec = { 17 | name: "unset", 18 | description: "Named variable shall be undefined", 19 | args: { 20 | name: "string", 21 | generators: environmentVariableGenerator, 22 | }, 23 | options: [ 24 | { 25 | name: "-v", 26 | description: "Variable definition will be unset", 27 | }, 28 | ], 29 | }; 30 | export default completionSpec; 31 | -------------------------------------------------------------------------------- /src/nr.ts: -------------------------------------------------------------------------------- 1 | import { npmScriptsGenerator } from "./npm"; 2 | 3 | const completionSpec: Fig.Spec = { 4 | name: "nr", 5 | description: "Use the right package manager - run", 6 | options: [ 7 | { 8 | name: ["-h", "--help"], 9 | description: "Output usage information", 10 | }, 11 | ], 12 | args: { 13 | name: "script", 14 | description: "The script to run", 15 | filterStrategy: "fuzzy", 16 | generators: npmScriptsGenerator, 17 | }, 18 | additionalSuggestions: [ 19 | { 20 | name: "-", 21 | // Run the suggestion directory on insert 22 | // eslint-disable-next-line @withfig/fig-linter/no-useless-insertvalue 23 | insertValue: "-\n", 24 | description: "Run the last command", 25 | type: "shortcut", 26 | }, 27 | ], 28 | }; 29 | export default completionSpec; 30 | -------------------------------------------------------------------------------- /src/rushx.ts: -------------------------------------------------------------------------------- 1 | import { npmScriptsGenerator } from "./npm"; 2 | import { yarnScriptParserDirectives } from "./yarn"; 3 | 4 | const completionSpec: Fig.Spec = { 5 | name: "rushx", 6 | description: 7 | "Run arbitrary package scripts for rush project. analogous to npm run", 8 | args: { 9 | name: "Scripts", 10 | description: "Script to run from your package.json", 11 | filterStrategy: "fuzzy", 12 | generators: npmScriptsGenerator, 13 | parserDirectives: yarnScriptParserDirectives, 14 | isCommand: true, 15 | }, 16 | options: [ 17 | { 18 | name: ["-h", "--help"], 19 | description: "Show this help message and exit", 20 | }, 21 | { 22 | name: ["-q", "--quiet"], 23 | description: "Hide rushx startup information", 24 | }, 25 | ], 26 | }; 27 | export default completionSpec; 28 | -------------------------------------------------------------------------------- /src/dotnet/dotnet-build-server.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "build-server", 3 | description: "Interacts with servers started by a build", 4 | subcommands: [ 5 | { 6 | name: "shutdown", 7 | description: 8 | "Shuts down build servers that are started from dotnet. By default, all servers are shut down", 9 | options: [ 10 | { 11 | name: "--msbuild", 12 | description: "Shuts down the MSBuild build server", 13 | }, 14 | { 15 | name: "--razor", 16 | description: "Shuts down the Razor build server", 17 | }, 18 | { 19 | name: "--vbcscompiler", 20 | description: "Shuts down the VB/C# compiler build server", 21 | }, 22 | ], 23 | }, 24 | ], 25 | }; 26 | 27 | export default completionSpec; 28 | -------------------------------------------------------------------------------- /src/wc.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "wc", 3 | description: "World, line, character, and byte count", 4 | options: [ 5 | { 6 | name: "-c", 7 | description: "Output the number of bytes to the standard input", 8 | }, 9 | { 10 | name: "-l", 11 | description: "Output the number of lines to the standard input", 12 | }, 13 | { 14 | name: "-m", 15 | description: "Output the number of characters to the standard input", 16 | }, 17 | { 18 | name: "-w", 19 | description: "Output the number of words to the standard input", 20 | }, 21 | ], 22 | args: { 23 | name: "file", 24 | description: "File to count in", 25 | template: "filepaths", 26 | isOptional: true, 27 | isVariadic: true, 28 | }, 29 | }; 30 | 31 | export default completionSpec; 32 | -------------------------------------------------------------------------------- /src/create-web3-frontend.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "create-web3-frontend", 3 | description: 4 | "Quickly create a Next.js project with wagmi and TailwindCSS ready to go", 5 | options: [ 6 | { 7 | name: ["--ts", "--typescript"], 8 | description: "Initialize as a TypeScript project", 9 | }, 10 | { 11 | name: "--use-npm", 12 | description: "Explicitly tell the CLI to bootstrap the app using npm", 13 | }, 14 | { 15 | name: "--use-pnpm", 16 | description: "Explicitly tell the CLI to bootstrap the app using pnpm", 17 | }, 18 | { 19 | name: ["-h", "--help"], 20 | description: "Display help for command", 21 | priority: 49, 22 | }, 23 | ], 24 | args: { name: "project-directory", template: "folders" }, 25 | }; 26 | export default completionSpec; 27 | -------------------------------------------------------------------------------- /src/python/http.server.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "http.server", 3 | description: "", 4 | options: [ 5 | { 6 | name: ["-d", "--directory"], 7 | description: "Choose the directory to initiate the server from", 8 | args: { 9 | template: "folders", 10 | }, 11 | }, 12 | { 13 | name: ["-b", "--bind"], 14 | description: "Bind to a specific IP address", 15 | args: { 16 | name: "IP Address", 17 | description: "E.g. 127.0.0.1", 18 | }, 19 | }, 20 | { 21 | name: "--cgi", 22 | description: "Enable the CGIHTTPRequestHandler", 23 | }, 24 | ], 25 | // Only uncomment if http.server takes an argument 26 | args: { 27 | name: "port", 28 | description: "Port number", 29 | }, 30 | }; 31 | 32 | export default completionSpec; 33 | -------------------------------------------------------------------------------- /src/az/2.53.0/configure.ts: -------------------------------------------------------------------------------- 1 | const completion: Fig.Spec = { 2 | name: "configure", 3 | description: "Manage Azure CLI configuration. This command is interactive", 4 | options: [ 5 | { 6 | name: ["--defaults", "-d"], 7 | description: 8 | "Space-separated 'name=value' pairs for common argument defaults", 9 | args: { name: "defaults" }, 10 | }, 11 | { 12 | name: ["--list-defaults", "-l"], 13 | description: "List all applicable defaults", 14 | args: { name: "list-defaults", suggestions: ["false", "true"] }, 15 | }, 16 | { 17 | name: "--scope", 18 | description: 19 | 'Scope of defaults. Using "local" for settings only effective under current folder', 20 | args: { name: "scope", suggestions: ["global", "local"] }, 21 | }, 22 | ], 23 | }; 24 | 25 | export default completion; 26 | -------------------------------------------------------------------------------- /src/cd.ts: -------------------------------------------------------------------------------- 1 | import { filepaths } from "@fig/autocomplete-generators"; 2 | 3 | const completionSpec: Fig.Spec = { 4 | name: "cd", 5 | description: "Change the shell working directory", 6 | args: { 7 | generators: filepaths({ 8 | showFolders: "only", 9 | // editFolderSuggestions: { 10 | // previewComponent: "cd/folderPreview", 11 | // }, 12 | }), 13 | filterStrategy: "fuzzy", 14 | // Add an additional hidden suggestion so users can execute on it if they want to 15 | suggestions: [ 16 | { 17 | name: "-", 18 | description: "Switch to the last used folder", 19 | hidden: true, 20 | }, 21 | { 22 | name: "~", 23 | description: "Switch to the home directory", 24 | hidden: true, 25 | }, 26 | ], 27 | }, 28 | }; 29 | 30 | export default completionSpec; 31 | -------------------------------------------------------------------------------- /src/readlink.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "readlink", 3 | description: "Display file status", 4 | options: [ 5 | { 6 | name: "-f", 7 | description: 8 | "Display information using the specified format; similar to printf(3) formats in that they start with %, are then followed by a sequence of formatting characters, and end in a character that selects the field of the struct stat which is to be formatted", 9 | args: { 10 | name: "format", 11 | }, 12 | }, 13 | { 14 | name: "-n", 15 | description: 16 | "Do not force a newline to appear at the end of each piece of output", 17 | }, 18 | ], 19 | args: { 20 | name: "file", 21 | description: "File(s) to readlink", 22 | isVariadic: true, 23 | template: "filepaths", 24 | }, 25 | }; 26 | export default completionSpec; 27 | -------------------------------------------------------------------------------- /.devcontainer/Dockerfile: -------------------------------------------------------------------------------- 1 | # [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 18, 16, 14, 18-bullseye, 16-bullseye, 14-bullseye, 18-buster, 16-buster, 14-buster 2 | ARG VARIANT=16-bullseye 3 | FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-${VARIANT} 4 | 5 | # [Optional] Uncomment this section to install additional OS packages. 6 | # RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ 7 | # && apt-get -y install --no-install-recommends 8 | 9 | # [Optional] Uncomment if you want to install an additional version of node using nvm 10 | # ARG EXTRA_NODE_VERSION=10 11 | # RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}" 12 | 13 | # [Optional] Uncomment if you want to install more global node packages 14 | # RUN su node -c "npm install -g " 15 | -------------------------------------------------------------------------------- /src/electron.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "electron", 3 | description: 4 | "Build cross platform desktop apps with JavaScript, HTML and CSS", 5 | args: { 6 | name: "path", 7 | description: "A path to an electron app", 8 | template: ["filepaths", "folders"], 9 | }, 10 | options: [ 11 | { 12 | name: ["-i", "--interactive"], 13 | description: "Open a REPL to the main process", 14 | }, 15 | { 16 | name: ["-r", "--require"], 17 | description: "Module to preload", 18 | args: { 19 | name: "module", 20 | template: "filepaths", 21 | }, 22 | }, 23 | { 24 | name: ["-v", "--version"], 25 | description: "Print the version", 26 | }, 27 | { 28 | name: ["-a", "--abi"], 29 | description: "Print the Node ABI version", 30 | }, 31 | ], 32 | }; 33 | 34 | export default completionSpec; 35 | -------------------------------------------------------------------------------- /src/pathchk.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "pathchk", 3 | description: "Check pathnames for POSIX portability", 4 | options: [ 5 | { 6 | name: "-p", 7 | description: 8 | "Perform portability checks on the specified pathname arguments, writes messages if 1) path is longer than _POSIX_PATH_MAX (255) bytes 2) contains a component longer than _POSIX_NAME_MAX (14) bytes, contains any character not in the portable filename character set", 9 | }, 10 | { 11 | name: "-P", 12 | description: 13 | "In addition to the default or -p checks, write a diagnostic for each argument that 1) is empty 2) contains a component that starts with a hyphen", 14 | }, 15 | ], 16 | args: { 17 | name: "pathname", 18 | description: "Pathname(s) to check", 19 | isVariadic: true, 20 | template: "filepaths", 21 | }, 22 | }; 23 | export default completionSpec; 24 | -------------------------------------------------------------------------------- /src/build-storybook.ts: -------------------------------------------------------------------------------- 1 | import { storybookCommonOptions } from "./start-storybook"; 2 | 3 | const completionSpec: Fig.Spec = { 4 | name: "build-storybook", 5 | description: "Storybook build CLI tools", 6 | options: [ 7 | { 8 | name: ["-o", "--output-dir"], 9 | description: "Directory where to store built files", 10 | args: { 11 | name: "directory", 12 | template: "folders", 13 | }, 14 | }, 15 | { 16 | name: ["-w", "--watch"], 17 | description: "Enables watch mode", 18 | }, 19 | { 20 | name: "--loglevel", 21 | description: "Controls level of logging during build", 22 | args: { 23 | name: "level", 24 | suggestions: ["silly", "verbose", "info", "warn", "error", "silent"], 25 | default: "info", 26 | }, 27 | }, 28 | ...storybookCommonOptions, 29 | ], 30 | }; 31 | 32 | export default completionSpec; 33 | -------------------------------------------------------------------------------- /src/az/2.53.0/interactive.ts: -------------------------------------------------------------------------------- 1 | const completion: Fig.Spec = { 2 | name: "interactive", 3 | description: 4 | "Start interactive mode. Installs the Interactive extension if not installed already", 5 | options: [ 6 | { 7 | name: ["--style", "-s"], 8 | description: "The colors of the shell", 9 | args: { 10 | name: "style", 11 | suggestions: [ 12 | "bg", 13 | "br", 14 | "contrast", 15 | "default", 16 | "grey", 17 | "halloween", 18 | "neon", 19 | "none", 20 | "pastel", 21 | "primary", 22 | "purple", 23 | "quiet", 24 | ], 25 | }, 26 | }, 27 | { 28 | name: "--update", 29 | description: "Update the Interactive extension to the latest available", 30 | args: { name: "update" }, 31 | }, 32 | ], 33 | }; 34 | 35 | export default completion; 36 | -------------------------------------------------------------------------------- /src/uname.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "uname", 3 | description: "Print operating system name", 4 | options: [ 5 | { 6 | name: "-a", 7 | description: "Print all available system information", 8 | }, 9 | { 10 | name: "-m", 11 | description: "Print the machine hardware name", 12 | }, 13 | { 14 | name: "-n", 15 | description: "Print the system hostname", 16 | }, 17 | { 18 | name: "-p", 19 | description: "Print the machine processor architecture name", 20 | }, 21 | { 22 | name: "-r", 23 | description: "Print the operating system release", 24 | }, 25 | { 26 | name: "-s", 27 | description: "Print the operating system name", 28 | }, 29 | { 30 | name: "-v", 31 | description: "Print the operating system version", 32 | }, 33 | ], 34 | }; 35 | 36 | export default completionSpec; 37 | -------------------------------------------------------------------------------- /src/bunx.ts: -------------------------------------------------------------------------------- 1 | import { npxSuggestions } from "./npx"; 2 | 3 | const bunx: Fig.Spec = { 4 | name: "bunx", 5 | args: { 6 | name: "command", 7 | isCommand: true, 8 | generators: { 9 | script: [ 10 | "bash", 11 | "-c", 12 | "until [[ -d node_modules/ ]] || [[ $PWD = '/' ]]; do cd ..; done; ls -1 node_modules/.bin/`", 13 | ], 14 | postProcess: function (out) { 15 | const cli = [...npxSuggestions].reduce( 16 | (acc, { name }) => [...acc, name], 17 | [] 18 | ); 19 | return out 20 | .split("\n") 21 | .filter((name) => !cli.includes(name)) 22 | .map((name) => ({ 23 | name, 24 | icon: "fig://icon?type=command", 25 | loadSpec: name, 26 | })); 27 | }, 28 | }, 29 | description: "The command to run", 30 | suggestions: [...npxSuggestions], 31 | }, 32 | }; 33 | 34 | export default bunx; 35 | -------------------------------------------------------------------------------- /src/ldd.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "ldd", 3 | description: "Print shared library dependencies", 4 | options: [ 5 | { 6 | name: "--help", 7 | description: "Show help for ldd", 8 | }, 9 | { 10 | name: "--version", 11 | description: "Print version information and exit", 12 | }, 13 | { 14 | name: ["-d", "--data-relocs"], 15 | description: "Process data relocations", 16 | }, 17 | { 18 | name: ["-r", "--function-relocs"], 19 | description: "Process data and function relocations", 20 | }, 21 | { 22 | name: ["-u", "--unused"], 23 | description: "Print unused direct dependencies", 24 | }, 25 | { 26 | name: ["-v", "--verbose"], 27 | description: "Print all information", 28 | }, 29 | ], 30 | args: { 31 | name: "exe", 32 | template: "filepaths", 33 | isVariadic: true, 34 | }, 35 | }; 36 | export default completionSpec; 37 | -------------------------------------------------------------------------------- /src/clang++.ts: -------------------------------------------------------------------------------- 1 | import { 2 | clangBase, 3 | stdCPPSuggestions, 4 | stdOpenCLCPPSuggestions, 5 | stdHLSLSuggestions, 6 | } from "./clang"; 7 | 8 | const completionSpec: Fig.Spec = { 9 | ...clangBase, 10 | name: "clang++", 11 | description: "Clang LLVM compiler for C++", 12 | options: [ 13 | ...(clangBase as Fig.Subcommand).options, 14 | { 15 | name: "-std", 16 | description: "Language standard to compile for", 17 | args: { 18 | name: "value", 19 | suggestions: [ 20 | ...stdCPPSuggestions, 21 | ...stdOpenCLCPPSuggestions, 22 | { 23 | name: "cuda", 24 | description: "NVIDIA CUDA(tm)", 25 | }, 26 | { 27 | name: "hip", 28 | description: "HIP", 29 | }, 30 | ...stdHLSLSuggestions, 31 | ], 32 | }, 33 | requiresSeparator: true, 34 | }, 35 | ], 36 | }; 37 | export default completionSpec; 38 | -------------------------------------------------------------------------------- /src/sudo.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "sudo", 3 | description: "Execute a command as the superuser or another user", 4 | options: [ 5 | { 6 | name: ["-g", "--group"], 7 | description: "Run command as the specified group name or ID", 8 | args: { 9 | name: "group", 10 | description: "Group name or ID", 11 | }, 12 | }, 13 | { 14 | name: ["-h", "--help"], 15 | description: "Display help message and exit", 16 | }, 17 | { 18 | name: ["-u", "--user"], 19 | description: "Run command as specified user name or ID", 20 | args: { 21 | name: "user", 22 | description: "User name or ID", 23 | }, 24 | }, 25 | ], 26 | // Only uncomment if sudo takes an argument 27 | args: { 28 | name: "command", 29 | description: "Command to run with elevated permissions", 30 | isCommand: true, 31 | }, 32 | }; 33 | 34 | export default completionSpec; 35 | -------------------------------------------------------------------------------- /src/zip.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "zip", 3 | description: "Package and compress (archive) files into zip file", 4 | args: [ 5 | { 6 | name: "name", 7 | description: "Name of archive", 8 | }, 9 | { 10 | name: "dir", 11 | template: "folders", 12 | }, 13 | ], 14 | options: [ 15 | { 16 | name: "-r", 17 | description: 18 | "Package and compress a directory and its contents, recursively", 19 | }, 20 | { 21 | name: "-e", 22 | }, 23 | { 24 | name: "-s", 25 | args: { 26 | name: "split size", 27 | }, 28 | }, 29 | { 30 | name: "-d", 31 | args: { 32 | name: "file", 33 | template: "filepaths", 34 | }, 35 | }, 36 | { 37 | name: "-9", 38 | description: 39 | "Archive a directory and its contents with the highest level [9] of compression", 40 | }, 41 | ], 42 | }; 43 | 44 | export default completionSpec; 45 | -------------------------------------------------------------------------------- /src/zed.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "zed", 3 | description: "A lightning-fast, collaborative code editor written in Rust", 4 | options: [ 5 | { 6 | name: ["-h", "--help"], 7 | description: "Print help information", 8 | }, 9 | { 10 | name: ["-v", "--version"], 11 | description: "Print Zed's version and the app path", 12 | }, 13 | { 14 | name: ["-w", "--wait"], 15 | description: 16 | "Wait for all of the given paths to be closed before exiting", 17 | }, 18 | { 19 | name: ["-b", "--bundle-path"], 20 | description: "Custom Zed.app path", 21 | args: { 22 | name: "bundle_path", 23 | template: "folders", 24 | }, 25 | }, 26 | ], 27 | args: { 28 | name: "path", 29 | description: "A sequence of space-separated paths that you want to open", 30 | isOptional: true, 31 | isVariadic: true, 32 | template: "filepaths", 33 | }, 34 | }; 35 | export default completionSpec; 36 | -------------------------------------------------------------------------------- /src/tac.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "tac", 3 | description: "Concatenate and print files in reverse", 4 | parserDirectives: { 5 | optionsMustPrecedeArguments: true, 6 | }, 7 | options: [ 8 | { 9 | name: "--help", 10 | description: "Display this help and exit", 11 | }, 12 | { 13 | name: ["--before", "-b"], 14 | description: "Attach the separator before instead of after", 15 | }, 16 | { 17 | name: ["--regex", "-r"], 18 | description: "Interpret the separator as a regular expression", 19 | }, 20 | { 21 | name: ["--separator", "-s"], 22 | description: "Use STRING as the separator instead of newline", 23 | args: { 24 | name: "STRING", 25 | }, 26 | }, 27 | { 28 | name: "--version", 29 | description: "Output version information and exit", 30 | }, 31 | ], 32 | args: { 33 | name: "FILE", 34 | template: "filepaths", 35 | }, 36 | }; 37 | export default completionSpec; 38 | -------------------------------------------------------------------------------- /src/xcode-select.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "xcode-select", 3 | description: "Active developer directory for Xcode tools", 4 | options: [ 5 | { 6 | name: ["-h", "--help"], 7 | description: "Help message", 8 | }, 9 | { 10 | name: ["-p", "--print-path"], 11 | description: "Display path to active developer directory", 12 | }, 13 | { 14 | name: ["-s", "--switch"], 15 | description: "Set path to active developer directory", 16 | insertValue: "-s ", 17 | args: { 18 | name: "path", 19 | template: "folders", 20 | }, 21 | }, 22 | { 23 | name: "--install", 24 | description: "Install Xcode command line tools", 25 | }, 26 | { 27 | name: ["-v", "--version"], 28 | description: "Display version", 29 | }, 30 | { 31 | name: ["-r", "--reset"], 32 | description: "Reset to the default CLT path", 33 | }, 34 | ], 35 | }; 36 | 37 | export default completionSpec; 38 | -------------------------------------------------------------------------------- /.github/workflows/verify-cla.yml: -------------------------------------------------------------------------------- 1 | name: Verify CLA 2 | on: 3 | issue_comment: 4 | types: [created] 5 | pull_request_target: 6 | types: [opened,closed,synchronize] 7 | 8 | jobs: 9 | CLAAssistant: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: "CLA Assistant" 13 | if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target' 14 | uses: contributor-assistant/github-action@v2.6.1 15 | env: 16 | GITHUB_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN }} 17 | PERSONAL_ACCESS_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN }} 18 | with: 19 | path-to-signatures: 'cla/signatures.json' 20 | path-to-document: 'https://github.com/withfig/autocomplete/blob/master/cla/cla.md' 21 | branch: 'master' 22 | allowlist: mschrage,brendanfalk,bot* 23 | create-file-commit-message: 'chore: create `cla/signatures.json`' 24 | -------------------------------------------------------------------------------- /src/dotenv.ts: -------------------------------------------------------------------------------- 1 | // completion spec for dotenv 2 | // https://github.com/bkeepers/dotenv 3 | const completionSpec: Fig.Spec = { 4 | name: "dotenv", 5 | description: "Loads environment variables from .env", 6 | args: { 7 | isCommand: true, 8 | }, 9 | options: [ 10 | { 11 | name: "-f", 12 | exclusiveOn: ["-h", "-v", "-t"], 13 | description: "List of env files to parse", 14 | args: { 15 | template: "filepaths", 16 | }, 17 | }, 18 | { 19 | name: ["-h", "--help"], 20 | exclusiveOn: ["-f", "-v", "-t"], 21 | description: "Display help", 22 | }, 23 | { 24 | name: ["-v", "--version"], 25 | exclusiveOn: ["-f", "-h", "-t"], 26 | description: "Show version", 27 | }, 28 | { 29 | name: ["-t", "--template"], 30 | exclusiveOn: ["-f", "-h", "-v"], 31 | description: "Create a template env file", 32 | args: { 33 | template: "filepaths", 34 | }, 35 | }, 36 | ], 37 | }; 38 | export default completionSpec; 39 | -------------------------------------------------------------------------------- /src/login.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "login", 3 | description: "Begin session on the system", 4 | options: [ 5 | { 6 | name: "-p", 7 | description: "Preserve environment", 8 | }, 9 | { 10 | name: "-r", 11 | description: "Perform autologin protocol for rlogin", 12 | }, 13 | { 14 | name: "-h", 15 | description: "Specify host", 16 | args: { 17 | name: "host", 18 | }, 19 | }, 20 | { 21 | name: "-f", 22 | description: "Don't authenticate user, user is preauthenticated", 23 | }, 24 | ], 25 | args: { 26 | name: "username", 27 | generators: { 28 | script: ["cat", "/etc/passwd"], 29 | postProcess: (out) => { 30 | return out.split("\n").map((line) => { 31 | const [username] = line.split(":"); 32 | return { 33 | name: username, 34 | icon: "👤", 35 | }; 36 | }); 37 | }, 38 | }, 39 | }, 40 | }; 41 | export default completionSpec; 42 | -------------------------------------------------------------------------------- /src/mailsy.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "mailsy", 3 | description: "⚡️ Quickly generate a disposable email straight from terminal", 4 | subcommands: [ 5 | { 6 | name: "g", 7 | description: "Generate a new email", 8 | }, 9 | { 10 | name: "m", 11 | description: "Fetch messages from the inbox", 12 | }, 13 | { 14 | name: "d", 15 | description: "Delete account", 16 | }, 17 | { 18 | name: "me", 19 | description: "Show details of the account", 20 | }, 21 | { 22 | name: "help", 23 | description: "Get help for a command", 24 | args: { name: "command", isOptional: true, template: "help" }, 25 | }, 26 | ], 27 | options: [ 28 | { name: ["-v", "--version"], description: "Output the current version" }, 29 | { 30 | name: ["-h", "--help"], 31 | description: "Display help for command", 32 | priority: 49, 33 | isPersistent: true, 34 | }, 35 | ], 36 | }; 37 | 38 | export default completionSpec; 39 | -------------------------------------------------------------------------------- /src/head.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "head", 3 | description: "Output the first part of files", 4 | args: { 5 | name: "file", 6 | template: "filepaths", 7 | }, 8 | options: [ 9 | { 10 | name: ["-c", "--bytes"], 11 | description: "Print the first [numBytes] bytes of each file", 12 | args: { name: "numBytes" }, 13 | }, 14 | { 15 | name: ["-n", "--lines"], 16 | description: "Print the first [numLines] lines instead of the first 10", 17 | args: { name: "numLines" }, 18 | }, 19 | { 20 | name: ["-q", "--quiet", "--silent"], 21 | description: "Never print headers giving file names", 22 | }, 23 | { 24 | name: ["-v", "--verbose"], 25 | description: "Always print headers giving file names", 26 | }, 27 | { name: "--help", description: "Display this help and exit" }, 28 | { 29 | name: "--version", 30 | description: "Output version information and exit", 31 | }, 32 | ], 33 | }; 34 | 35 | export default completionSpec; 36 | -------------------------------------------------------------------------------- /src/git-profile.ts: -------------------------------------------------------------------------------- 1 | // https://github.com/dotzero/git-profile 2 | const profiles: Fig.Generator = { 3 | script: ["git-profile", "list"], 4 | postProcess: (output) => { 5 | return Array.from(output.matchAll(/^\[(.+?)\]$/gm)).map((result) => ({ 6 | name: result[1], 7 | description: `Use profile "${result[1]}"`, 8 | })); 9 | }, 10 | }; 11 | 12 | const completionSpec: Fig.Spec = { 13 | name: "git-profile", 14 | description: "Switch profiles", 15 | subcommands: [ 16 | { 17 | name: "use", 18 | description: "Use a profile", 19 | args: { 20 | name: "profile", 21 | description: "Profile you want to apply in this repository", 22 | generators: profiles, 23 | }, 24 | }, 25 | ], 26 | options: [ 27 | { 28 | name: ["--help", "-h"], 29 | description: "Help for git-profile script", 30 | }, 31 | { 32 | name: ["--config", "-c"], 33 | description: 'Config file (default "~/.gitprofile")', 34 | }, 35 | ], 36 | }; 37 | 38 | export default completionSpec; 39 | -------------------------------------------------------------------------------- /src/wifi-password.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "wifi-password", 3 | args: { 4 | name: "SSID", 5 | description: "The name for a Wi-Fi network", 6 | generators: { 7 | script: [ 8 | "bash", 9 | "-c", 10 | "networksetup -listallhardwareports | awk '/Wi-Fi/{getline; print $2}' | xargs networksetup -listpreferredwirelessnetworks", 11 | ], 12 | postProcess: (out) => 13 | out 14 | .split("\n") 15 | .slice(1) 16 | .map((line) => ({ name: line.trim() })), 17 | }, 18 | }, 19 | description: 20 | "People ask you for the Wi-Fi password. Answer quickly. macOS only", 21 | options: [ 22 | { 23 | name: ["--help", "-h"], 24 | description: "Show help for wifi-password", 25 | }, 26 | { 27 | name: ["--quiet", "-q"], 28 | description: "Only output the password", 29 | }, 30 | { 31 | name: ["--version", "-V"], 32 | description: "Output version", 33 | }, 34 | ], 35 | }; 36 | 37 | export default completionSpec; 38 | -------------------------------------------------------------------------------- /src/mkdir.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "mkdir", 3 | description: "Make directories", 4 | args: { 5 | name: "directory name", 6 | template: "folders", 7 | suggestCurrentToken: true, 8 | }, 9 | options: [ 10 | { 11 | name: ["-m", "--mode"], 12 | description: "Set file mode (as in chmod), not a=rwx - umask", 13 | args: { name: "mode" }, 14 | }, 15 | { 16 | name: ["-p", "--parents"], 17 | description: "No error if existing, make parent directories as needed", 18 | }, 19 | { 20 | name: ["-v", "--verbose"], 21 | description: "Print a message for each created directory", 22 | }, 23 | { 24 | name: ["-Z", "--context"], 25 | description: "Set the SELinux security context of each created directory", 26 | args: { name: "context" }, 27 | }, 28 | { name: "--help", description: "Display this help and exit" }, 29 | { 30 | name: "--version", 31 | description: "Output version information and exit", 32 | }, 33 | ], 34 | }; 35 | 36 | export default completionSpec; 37 | -------------------------------------------------------------------------------- /src/dotnet/dotnet-remove.ts: -------------------------------------------------------------------------------- 1 | import { filepaths } from "@fig/autocomplete-generators"; 2 | 3 | const projectGenerator = filepaths({ extensions: ["csproj"] }); 4 | 5 | const completionSpec: Fig.Spec = { 6 | name: "remove", 7 | args: { 8 | name: "project", 9 | description: 10 | "Specifies the project file. If not specified, the command searches the current directory for one", 11 | isOptional: true, 12 | generators: projectGenerator, 13 | }, 14 | subcommands: [ 15 | { 16 | name: "package", 17 | description: 18 | "The dotnet remove package command provides a convenient option to remove a NuGet package reference from a project", 19 | args: { 20 | name: "id", 21 | }, 22 | }, 23 | { 24 | name: "reference", 25 | description: 26 | "The dotnet remove reference command provides a convenient option to remove project references from a project", 27 | args: { 28 | name: "ref", 29 | generators: projectGenerator, 30 | }, 31 | }, 32 | ], 33 | }; 34 | 35 | export default completionSpec; 36 | -------------------------------------------------------------------------------- /src/which.ts: -------------------------------------------------------------------------------- 1 | const programGenerator: Fig.Generator = { 2 | script: [ 3 | "bash", 4 | "-c", 5 | `for i in $(echo $PATH | tr ":" "\n"); do find $i -maxdepth 1 -perm -111 -type f; done`, 6 | ], 7 | postProcess: (out) => 8 | out 9 | .split("\n") 10 | .map((path) => path.split("/")[path.split("/").length - 1]) 11 | .map((pr) => ({ name: pr, description: "Executable file", type: "arg" })), 12 | }; 13 | 14 | const completionSpec: Fig.Spec = { 15 | name: "which", 16 | description: "Locate a program in the user's PATH", 17 | args: { 18 | name: "names", 19 | isVariadic: true, 20 | generators: programGenerator, 21 | filterStrategy: "fuzzy", 22 | suggestCurrentToken: true, 23 | }, 24 | options: [ 25 | { 26 | name: "-s", 27 | description: 28 | "No output, return 0 if all the executables are found, 1 if not", 29 | }, 30 | { 31 | name: "-a", 32 | description: 33 | "List all instances of executables found, instead of just the first", 34 | }, 35 | ], 36 | }; 37 | 38 | export default completionSpec; 39 | -------------------------------------------------------------------------------- /src/mv.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "mv", 3 | description: "Move & rename files and folders", 4 | args: [ 5 | { 6 | name: "source", 7 | isVariadic: true, 8 | template: ["filepaths", "folders"], 9 | }, 10 | { 11 | name: "target", 12 | template: ["filepaths", "folders"], 13 | }, 14 | ], 15 | options: [ 16 | { 17 | name: "-f", 18 | description: 19 | "Do not prompt for confirmation before overwriting the destination path", 20 | exclusiveOn: ["-i", "-n"], 21 | }, 22 | { 23 | name: "-i", 24 | description: 25 | "Cause mv to write a prompt to standard error before moving a file that would overwrite an existing file", 26 | exclusiveOn: ["-f", "-n"], 27 | }, 28 | { 29 | name: "-n", 30 | description: "Do not overwrite existing file", 31 | exclusiveOn: ["-f", "-i"], 32 | }, 33 | { 34 | name: "-v", 35 | description: "Cause mv to be verbose, showing files after they are moved", 36 | }, 37 | ], 38 | }; 39 | 40 | export default completionSpec; 41 | -------------------------------------------------------------------------------- /src/unzip.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "unzip", 3 | description: "Extract compressed files in a ZIP archive", 4 | args: { 5 | name: "file", 6 | template: "filepaths", 7 | }, 8 | options: [ 9 | { 10 | name: "-l", 11 | description: "List the contents of a zip file without extracting", 12 | args: { 13 | name: "file", 14 | template: "filepaths", 15 | }, 16 | }, 17 | { 18 | name: "-c", 19 | args: { 20 | name: "file", 21 | template: "filepaths", 22 | }, 23 | }, 24 | { 25 | name: "-0", 26 | description: 27 | "Extract a zip file created in windows, containing files with non-ascii (chinese) filenames", 28 | args: [ 29 | { 30 | name: "gbk", 31 | }, 32 | { 33 | name: "file", 34 | template: "filepaths", 35 | }, 36 | ], 37 | }, 38 | { 39 | name: "-d", 40 | args: { 41 | name: "destination", 42 | template: "folders", 43 | }, 44 | }, 45 | ], 46 | }; 47 | 48 | export default completionSpec; 49 | -------------------------------------------------------------------------------- /src/fold.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "fold", 3 | description: "Fold long lines for finite width output device", 4 | parserDirectives: { 5 | optionsMustPrecedeArguments: true, 6 | }, 7 | options: [ 8 | { 9 | name: "-b", 10 | description: `Count width in bytes rather than column positions`, 11 | }, 12 | { 13 | name: "-s", 14 | description: `Fold line after the last blank character within the first width 15 | column positions (or bytes)`, 16 | }, 17 | { 18 | name: "-w", 19 | description: `Specify a line width to use instead of the default 80 columns. 20 | The width value should be a multiple of 8 if tabs are present, 21 | or the tabs should be expanded using expand(1) before using 22 | fold`, 23 | args: { 24 | name: "width", 25 | suggestions: ["80", "90", "100", "110", "120"], 26 | default: "80", 27 | }, 28 | }, 29 | ], 30 | args: { 31 | name: "file", 32 | description: "File(s) to fold", 33 | isOptional: true, 34 | isVariadic: true, 35 | template: "filepaths", 36 | }, 37 | }; 38 | export default completionSpec; 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Hercules Labs Inc. (Fig) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /dangerfile-greeting.ts: -------------------------------------------------------------------------------- 1 | import { danger, schedule } from "danger"; 2 | 3 | schedule(async () => { 4 | const { owner, repo, number } = danger.github.thisPR; 5 | 6 | const { data: comments } = await danger.github.api.issues.listComments({ 7 | issue_number: number, 8 | repo, 9 | owner, 10 | }); 11 | 12 | const hasGreetingComment = comments.some((comment) => 13 | comment.body.includes("id: greetingComment") 14 | ); 15 | 16 | if (!hasGreetingComment) { 17 | await danger.github.api.issues.createComment({ 18 | repo, 19 | owner, 20 | issue_number: number, 21 | body: ` 22 | Hello @${danger.github.pr.user.login}, 23 | thank you very much for creating a Pull Request! 24 | Here is a small checklist to get this PR merged as quickly as possible: 25 | 26 | - [ ] Do all subcommands / options which take arguments include the \`args\` property (\`args: {}\`)? 27 | - [ ] Are all options modular? E.g. \`-a\` \`-u\` \`-x\` instead of \`-aux\` 28 | - [ ] Have all other checks passed? 29 | 30 | Please add a 👍 as a reaction to this comment to show that you read this.`, 31 | }); 32 | } 33 | }); 34 | -------------------------------------------------------------------------------- /src/where.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "where", 3 | description: "For each name, indicate how it should be interpreted", 4 | args: { 5 | name: "names", 6 | isVariadic: true, 7 | }, 8 | options: [ 9 | { 10 | name: "-w", 11 | description: 12 | "For each name, print 'name: word', where 'word' is the kind of command", 13 | }, 14 | { 15 | name: "-p", 16 | description: 17 | "Do a path search for the name, even if it's an alias/function/builtin", 18 | }, 19 | { 20 | name: "-m", 21 | description: 22 | "The arguments are taken as patterns (pattern characters must be quoted)", 23 | }, 24 | { 25 | name: "-s", 26 | description: 27 | "If the pathname contains symlinks, print the symlink-free name as well", 28 | }, 29 | { 30 | name: "-S", 31 | description: "Print intermediate symlinks and the resolved name", 32 | }, 33 | { 34 | name: "-x", 35 | description: "Expand tabs when outputting shell function", 36 | args: { name: "num" }, 37 | }, 38 | ], 39 | }; 40 | 41 | export default completionSpec; 42 | -------------------------------------------------------------------------------- /src/rm.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "rm", 3 | description: "Remove directory entries", 4 | args: { 5 | isVariadic: true, 6 | template: ["folders", "filepaths"], 7 | }, 8 | 9 | options: [ 10 | { 11 | name: ["-r", "-R"], 12 | description: 13 | "Recursive. Attempt to remove the file hierarchy rooted in each file argument", 14 | isDangerous: true, 15 | }, 16 | { 17 | name: "-P", 18 | description: "Overwrite regular files before deleting them", 19 | isDangerous: true, 20 | }, 21 | { 22 | name: "-d", 23 | description: 24 | "Attempt to remove directories as well as other types of files", 25 | }, 26 | { 27 | name: "-f", 28 | description: 29 | "⚠️ Attempt to remove the files without prompting for confirmation", 30 | isDangerous: true, 31 | }, 32 | { 33 | name: "-i", 34 | description: "Request confirmation before attempting to remove each file", 35 | }, 36 | { 37 | name: "-v", 38 | description: "Be verbose when deleting files", 39 | }, 40 | ], 41 | }; 42 | 43 | export default completionSpec; 44 | -------------------------------------------------------------------------------- /src/adr.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "adr", 3 | description: "Manage Architectural Design Records", 4 | subcommands: [ 5 | { 6 | name: "init", 7 | description: 8 | "Create an ADR directory in the root of your project, example usage: ' adr init doc/architecture/decisions'", 9 | args: { 10 | name: "Location where to create the ADR, example 'adr init doc/architecture/decisions'", 11 | }, 12 | }, 13 | { 14 | name: "new", 15 | description: "Create a new, numbered ADR file", 16 | options: [ 17 | { 18 | name: "-s", 19 | description: 20 | "Create a new ADR that supercedes a previous one (ADR 9, for example), use the -s option", 21 | args: { 22 | name: "number", 23 | description: "Which ADR to supercede", 24 | }, 25 | }, 26 | ], 27 | args: { 28 | name: "ADR name", 29 | description: "Name for the ADR separated with '-'", 30 | }, 31 | }, 32 | { 33 | name: "help", 34 | description: "Built in help", 35 | }, 36 | ], 37 | }; 38 | export default completionSpec; 39 | -------------------------------------------------------------------------------- /src/bcd.ts: -------------------------------------------------------------------------------- 1 | const completion: Fig.Spec = { 2 | name: "bcd", 3 | description: "Bookmark directories and move to them", 4 | options: [ 5 | { 6 | name: ["-s", "--store"], 7 | description: "Store the current directory as a bookmark", 8 | isRepeatable: true, 9 | args: { 10 | name: "store", 11 | isOptional: true, 12 | }, 13 | }, 14 | { 15 | name: ["-r", "--remove"], 16 | description: "Remove a specified bookmark", 17 | isRepeatable: true, 18 | args: { 19 | name: "remove", 20 | isOptional: true, 21 | }, 22 | }, 23 | { 24 | name: ["-i", "--install"], 25 | description: "Setup the shell init script", 26 | }, 27 | { 28 | name: ["-l", "--list"], 29 | description: "List the stored bookmarks", 30 | }, 31 | { 32 | name: ["-V", "--version"], 33 | description: "Print version information", 34 | }, 35 | { 36 | name: ["-h", "--help"], 37 | description: "Print help information", 38 | }, 39 | ], 40 | args: { 41 | name: "bookmark", 42 | isOptional: true, 43 | }, 44 | }; 45 | 46 | export default completion; 47 | -------------------------------------------------------------------------------- /src/chsh.ts: -------------------------------------------------------------------------------- 1 | // TODO: this does not work on macos 2 | const shells: Fig.Generator = { 3 | script: ["chsh", "-l"], 4 | postProcess: (output) => { 5 | if (output.startsWith("fatal:")) { 6 | return []; 7 | } 8 | return output.split("\n").map((shell) => { 9 | return { name: shell.replace("*", "").trim() }; 10 | }); 11 | }, 12 | }; 13 | 14 | const completionSpec: Fig.Spec = { 15 | name: "chsh", 16 | description: "Change your login shell", 17 | options: [ 18 | { 19 | name: ["-s", "--shell"], 20 | description: "Specify login shell", 21 | args: { 22 | name: "shell", 23 | generators: shells, 24 | }, 25 | }, 26 | { 27 | name: ["-l", "--list-shells"], 28 | description: "Print list of shells and exit", 29 | }, 30 | { 31 | name: ["-u", "-h", "--help"], 32 | description: "Print help message and exit", 33 | }, 34 | { 35 | name: ["-v", "--version"], 36 | description: "Print version and exit", 37 | }, 38 | ], 39 | args: { 40 | name: "username", 41 | description: "Target user", 42 | isOptional: true, 43 | }, 44 | }; 45 | export default completionSpec; 46 | -------------------------------------------------------------------------------- /src/echo.ts: -------------------------------------------------------------------------------- 1 | const environmentVariableGenerator: Fig.Generator = { 2 | custom: async (tokens, _, context) => { 3 | if (tokens.length < 3 || tokens[tokens.length - 1].startsWith("$")) { 4 | return Object.keys(context.environmentVariables).map((suggestion) => ({ 5 | name: `$${suggestion}`, 6 | type: "arg", 7 | description: "Environment Variable", 8 | })); 9 | } else { 10 | return []; 11 | } 12 | }, 13 | trigger: "$", 14 | }; 15 | 16 | const completionSpec: Fig.Spec = { 17 | name: "echo", 18 | description: "Write arguments to the standard output", 19 | args: { 20 | name: "string", 21 | isVariadic: true, 22 | optionsCanBreakVariadicArg: false, 23 | suggestCurrentToken: true, 24 | generators: environmentVariableGenerator, 25 | }, 26 | options: [ 27 | { 28 | name: "-n", 29 | description: "Do not print the trailing newline character", 30 | }, 31 | { 32 | name: "-e", 33 | description: "Interpret escape sequences", 34 | }, 35 | { 36 | name: "-E", 37 | description: "Disable escape sequences", 38 | }, 39 | ], 40 | }; 41 | 42 | export default completionSpec; 43 | -------------------------------------------------------------------------------- /src/trap.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Certain shells output signals as "1) SIGHUP 2) SIGINT 3) SIGQUIT" (bash, zsh, ...) 3 | * Other shells output looks like "HUP INT QUIT" (fish, csh, ...) 4 | */ 5 | const re = /(\d+\)\s)?([\w-+]+)/g; 6 | 7 | /* 8 | * Generators 9 | */ 10 | 11 | const availableSignalsGenerator = ( 12 | suggestOptions?: Partial 13 | ): Fig.Generator => ({ 14 | script: ["command", "kill", "-l"], 15 | postProcess: (output) => 16 | [...output.matchAll(re)].map((signal) => ({ 17 | name: signal[2], 18 | })), 19 | }); 20 | 21 | const completionSpec: Fig.Spec = { 22 | name: "trap", 23 | description: 24 | "Automatically execute commands after receiving signals by processes or the operating system", 25 | options: [ 26 | { 27 | name: ["--print", "-p"], 28 | description: "Prints all defined signal handlers", 29 | }, 30 | { 31 | name: ["--help", "-h"], 32 | description: "Displays help about using this command", 33 | }, 34 | ], 35 | args: [ 36 | { name: "function name", isOptional: true }, 37 | { name: "reason", generators: availableSignalsGenerator() }, 38 | ], 39 | }; 40 | export default completionSpec; 41 | -------------------------------------------------------------------------------- /src/nrm.ts: -------------------------------------------------------------------------------- 1 | import { dependenciesGenerator } from "./npm"; 2 | 3 | const completionSpec: Fig.Spec = { 4 | name: "nrm", 5 | description: "Use the right package manage - remove", 6 | options: [ 7 | { 8 | name: "-g", 9 | description: 10 | "Operates in 'global' mode, so that packages are removed from the prefix folder instead of the current working directory", 11 | }, 12 | { 13 | name: "-D", 14 | description: "Package will be removed from your `devDependencies`", 15 | }, 16 | { 17 | name: "-P", 18 | description: "Remove package from your `peerDependencies`", 19 | }, 20 | { 21 | name: "-O", 22 | description: "Remove package from your `optionalDependencies`", 23 | }, 24 | { 25 | name: "--frozen", 26 | description: "Don't generate a lockfile and fail if an update is needed", 27 | }, 28 | { 29 | name: ["-h", "--help"], 30 | description: "Output usage information", 31 | }, 32 | ], 33 | args: { 34 | name: "package", 35 | filterStrategy: "fuzzy", 36 | generators: dependenciesGenerator, 37 | isVariadic: true, 38 | }, 39 | }; 40 | export default completionSpec; 41 | -------------------------------------------------------------------------------- /src/trash.ts: -------------------------------------------------------------------------------- 1 | // page https://hasseg.org/trash/ 2 | // made by yavko® 3 | 4 | const completionSpec: Fig.Spec = { 5 | name: "trash", 6 | description: "Trash, move files/folders to the trash", 7 | args: { 8 | isOptional: true, 9 | isVariadic: true, 10 | template: ["folders", "filepaths"], 11 | }, 12 | 13 | options: [ 14 | { 15 | name: "-v", 16 | description: "Print verbose output while moving items", 17 | }, 18 | { 19 | name: "-F", 20 | description: "Use the Finder API to move items to the trash", 21 | }, 22 | { 23 | name: "-l", 24 | description: "List items in the trash", 25 | }, 26 | { 27 | name: "-e", 28 | description: "Empty the trash", 29 | isDangerous: true, 30 | }, 31 | { 32 | name: "-s", 33 | description: 34 | "Securely empty the trash. trash asks for confirmation executing this action. If this argument is used, no need to be specified", 35 | }, 36 | { 37 | name: "-y", 38 | description: 39 | "Skips the confirmation prompt for -e and -s. CAUTION: permanently instantly", 40 | }, 41 | ], 42 | }; 43 | 44 | export default completionSpec; 45 | -------------------------------------------------------------------------------- /src/base32.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "base32", 3 | description: "Base32 encode/decode data and print to standard output", 4 | parserDirectives: { 5 | optionsMustPrecedeArguments: true, 6 | }, 7 | options: [ 8 | { 9 | name: ["--help", "-h"], 10 | description: "Display this help and exit", 11 | }, 12 | { 13 | name: ["--decode", "-d"], 14 | description: "Decode data", 15 | }, 16 | { 17 | name: ["--ignore-garbage", "-i"], 18 | description: "When decoding, ignore non-alphabet characters", 19 | }, 20 | { 21 | name: ["--wrap", "-w"], 22 | description: 23 | "Wrap encoded lines after COLS character (default 76). Use 0 to disable line wrapping", 24 | args: { 25 | name: "COLS", 26 | suggestions: ["76", "78", "80", "100", "120", "160", "0"], 27 | default: "76", 28 | }, 29 | }, 30 | { 31 | name: "--version", 32 | description: "Output version information and exit", 33 | }, 34 | ], 35 | args: { 36 | name: "FILE", 37 | description: "File to base32 encode/decode", 38 | template: "filepaths", 39 | }, 40 | }; 41 | export default completionSpec; 42 | -------------------------------------------------------------------------------- /src/cal.ts: -------------------------------------------------------------------------------- 1 | import { monthSuggestions } from "./ncal"; 2 | 3 | const completionSpec: Fig.Spec = { 4 | name: "cal", 5 | parserDirectives: { 6 | optionsMustPrecedeArguments: true, 7 | }, 8 | description: "Displays a calendar and the date of Easter", 9 | args: { 10 | name: "year", 11 | description: "Year to print calendar of", 12 | }, 13 | options: [ 14 | { 15 | name: "-h", 16 | description: "Turns off highlighting of today", 17 | }, 18 | { 19 | name: "-j", 20 | description: 21 | "Display Julian days (days one-based, numbered from January 1)", 22 | }, 23 | { 24 | name: "-m", 25 | description: 26 | "Display the specified month. If month is specified as a decimal number, it may be followed by the letter ‘f’ or ‘p’ to indicate the following or preceding month of that number, respectively", 27 | exclusiveOn: ["-y"], 28 | args: { 29 | name: "month", 30 | suggestions: monthSuggestions, 31 | }, 32 | }, 33 | { 34 | name: "-y", 35 | description: "Display a calendar for the specified year", 36 | exclusiveOn: ["-m"], 37 | }, 38 | ], 39 | }; 40 | export default completionSpec; 41 | -------------------------------------------------------------------------------- /src/bc.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "bc", 3 | description: "An arbitrary precision calculator language", 4 | parserDirectives: { 5 | optionsMustPrecedeArguments: true, 6 | }, 7 | options: [ 8 | { 9 | name: ["--help", "-h"], 10 | description: "Print the usage and exit", 11 | }, 12 | { 13 | name: ["--interactive", "-i"], 14 | description: "Force interactive mode", 15 | }, 16 | { 17 | name: ["--mathlib", "-l"], 18 | description: "Define the standard math library", 19 | }, 20 | { 21 | name: ["--warn", "-w"], 22 | description: "Give warnings for extensions to POSIX bc", 23 | }, 24 | { 25 | name: ["--standard", "-s"], 26 | description: "Process exactly the POSIX bc language", 27 | }, 28 | { 29 | name: ["--quiet", "-q"], 30 | description: "Do not print the normal GNU bc welcome", 31 | }, 32 | { 33 | name: ["--version", "-v"], 34 | description: "Print the version number and copyright and quit", 35 | }, 36 | ], 37 | args: { 38 | name: "file", 39 | isOptional: true, 40 | isVariadic: true, 41 | template: "filepaths", 42 | }, 43 | }; 44 | export default completionSpec; 45 | -------------------------------------------------------------------------------- /src/publish.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "publish", 3 | description: "", 4 | subcommands: [ 5 | { 6 | name: "new", 7 | description: "Set up a new website in the current folder", 8 | }, 9 | { 10 | name: "run", 11 | description: 12 | "Generate and run a localhost server on default port 8000 for the website in the current folder", 13 | parserDirectives: { 14 | flagsArePosixNoncompliant: true, 15 | }, 16 | options: [ 17 | { 18 | name: ["-p", "--port"], 19 | description: "Customize the port", 20 | args: { 21 | name: "port", 22 | default: "8000", 23 | }, 24 | }, 25 | ], 26 | }, 27 | { 28 | name: "deploy", 29 | description: "Generate and deploy the website in the current folder", 30 | }, 31 | { 32 | name: "generate", 33 | description: "Generate the website in the current folder", 34 | }, 35 | ], 36 | options: [ 37 | { 38 | name: ["--help", "-h"], 39 | description: "Show help for publish", 40 | }, 41 | ], 42 | // Only uncomment if publish takes an argument 43 | // args: {} 44 | }; 45 | export default completionSpec; 46 | -------------------------------------------------------------------------------- /src/yank.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "yank", 3 | description: "Yank terminal output to clipboard", 4 | options: [ 5 | { 6 | name: "-i", 7 | description: "Ignore case differences between pattern and the input", 8 | }, 9 | { name: "-l", description: "Use the default delimiters except for space" }, 10 | { name: "-x", description: "Use alternate screen" }, 11 | { name: "-v", description: "Print the version" }, 12 | { 13 | name: "-d", 14 | description: 15 | "All input characters not present in delim will be recognized as fields", 16 | args: { 17 | name: "delim", 18 | description: "Custom delimiters", 19 | }, 20 | }, 21 | { 22 | name: "-g", 23 | description: "Use pattern to recognize fields", 24 | args: { 25 | name: "pattern", 26 | description: "Pattern to recognize fields", 27 | }, 28 | }, 29 | { 30 | name: "--", 31 | description: "Use a command as the yank command", 32 | args: { 33 | name: "command", 34 | description: "Command to use as the yank command", 35 | isVariadic: true, 36 | }, 37 | }, 38 | ], 39 | }; 40 | export default completionSpec; 41 | -------------------------------------------------------------------------------- /src/top.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "top", 3 | description: "Display Linux tasks", 4 | options: [ 5 | { 6 | name: ["-h", "-v"], 7 | description: "Show library version and usage prompt", 8 | }, 9 | { 10 | name: "-b", 11 | description: "Starts top in Batch mode", 12 | args: { 13 | name: "operation", 14 | }, 15 | }, 16 | { 17 | name: "-c", 18 | description: "Starts top with last remembered c state reversed", 19 | args: { 20 | name: "toggle", 21 | }, 22 | }, 23 | { 24 | name: "-i", 25 | description: 26 | "Starts top with the last remembered 'i' state reversed. When this toggle is Off, tasks that are idled or zombied will not be displayed", 27 | args: { 28 | name: "toggle", 29 | }, 30 | }, 31 | { 32 | name: "-s", 33 | description: "Starts top with secure mode forced", 34 | args: { 35 | name: "delay", 36 | }, 37 | }, 38 | { 39 | name: "-pid", 40 | description: "Monitor pids", 41 | args: { 42 | name: "process ids", 43 | isVariadic: true, 44 | }, 45 | }, 46 | ], 47 | }; 48 | 49 | export default completionSpec; 50 | -------------------------------------------------------------------------------- /src/phpunit-watcher.ts: -------------------------------------------------------------------------------- 1 | const tests: Fig.Generator = { 2 | script: ["phpunit", "--list-tests"], 3 | postProcess: function (out) { 4 | if (out.startsWith("fatal:")) { 5 | return []; 6 | } 7 | 8 | return out 9 | .split("\n") 10 | .filter((line) => line.indexOf("::") > 0) 11 | .map((line) => { 12 | return { 13 | name: line.substring(line.indexOf("::") + 2, line.length), 14 | icon: "fig://icon?type=php", 15 | description: line.substring(line.indexOf("::") + 2, line.length), 16 | }; 17 | }); 18 | }, 19 | }; 20 | 21 | const completionSpec: Fig.Spec = { 22 | name: "phpunit-watcher", 23 | description: "Automatically rerun PHPUnit tests when source code changes", 24 | subcommands: [ 25 | { 26 | name: "watch", 27 | description: 28 | "This will run the tests and rerun them whenever a file in the app, src or tests directory is modified", 29 | options: [ 30 | { 31 | name: "--filter", 32 | description: "Watch a specific test", 33 | args: { 34 | generators: tests, 35 | name: "filter", 36 | }, 37 | }, 38 | ], 39 | }, 40 | ], 41 | }; 42 | 43 | export default completionSpec; 44 | -------------------------------------------------------------------------------- /src/autojump.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "autojump", 3 | description: "A faster way to navigate your filesystem", 4 | options: [ 5 | { 6 | name: ["-h", "--help"], 7 | description: "Show the help message and exit", 8 | }, 9 | { 10 | name: ["-a", "--add"], 11 | description: "Add path", 12 | args: { name: "directory", template: ["folders"] }, 13 | }, 14 | { 15 | name: ["-i", "--increase"], 16 | description: "Increase current directory weight", 17 | args: { name: "weight", isOptional: true }, 18 | }, 19 | { 20 | name: ["-d", "--decrease"], 21 | description: "Decrease current directory weight", 22 | args: { name: "weight", isOptional: true }, 23 | }, 24 | { 25 | name: "--complete", 26 | description: "Used for tab completion", 27 | }, 28 | { 29 | name: "--purge", 30 | description: "Remove non-existent paths from database", 31 | }, 32 | { 33 | name: ["-s", "--stat"], 34 | description: "Show database entries and their key weights", 35 | }, 36 | { 37 | name: ["-v", "--version"], 38 | description: "Show version information", 39 | }, 40 | ], 41 | }; 42 | 43 | export default completionSpec; 44 | -------------------------------------------------------------------------------- /src/cot.ts: -------------------------------------------------------------------------------- 1 | // Author: Yavko 2 | const completionSpec: Fig.Spec = { 3 | name: "cot", 4 | icon: "https://coteditor.com/favicon@2x.png", 5 | description: "Command-line utility for CotEditor", 6 | args: { 7 | template: "filepaths", 8 | }, 9 | options: [ 10 | { 11 | description: "Show help message and exit", 12 | name: ["-h", "--help"], 13 | }, 14 | { 15 | description: "Show program's version number and exit", 16 | name: ["-v", "--version"], 17 | }, 18 | { 19 | description: "Wait for opened file to be closed", 20 | name: ["-w", "--wait"], 21 | }, 22 | { 23 | description: "Do not bring the application to the foreground", 24 | name: ["-g", "--background"], 25 | }, 26 | { 27 | description: "Create a new blank document", 28 | name: ["-n", "--new"], 29 | }, 30 | { 31 | description: "Jump to specific line in opened document", 32 | name: ["-l", "--line"], 33 | args: { 34 | name: "line", 35 | }, 36 | }, 37 | { 38 | description: "Jump to specific column in opened document", 39 | name: ["-c", "--column"], 40 | args: { 41 | name: "column", 42 | }, 43 | }, 44 | ], 45 | }; 46 | export default completionSpec; 47 | -------------------------------------------------------------------------------- /src/create-redwood-app.ts: -------------------------------------------------------------------------------- 1 | const spec: Fig.Spec = { 2 | name: "create-redwood-app", 3 | icon: "https://avatars.githubusercontent.com/u/45050444?s=48&v=4", 4 | args: { 5 | name: "projectName", 6 | description: "Name of your Redwood project", 7 | }, 8 | options: [ 9 | { name: ["--help", "-h"], description: "Show help" }, 10 | { 11 | name: ["--typescript", "--ts"], 12 | description: "Generate a TypeScript project", 13 | }, 14 | { 15 | name: "--overwrite", 16 | description: "Create even if target directory isn't empty", 17 | }, 18 | { 19 | name: "--telemetry", 20 | description: "Enables sending telemetry events for this create", 21 | }, 22 | { 23 | name: ["--git-init", "--git"], 24 | description: "Initialize a git repository", 25 | }, 26 | { 27 | name: ["--commit-message", "-m"], 28 | description: "Commit message for the initial commit", 29 | }, 30 | { name: ["--yes", "-y"], description: "Skip prompts and use defaults" }, 31 | { name: "--version", description: "Show version number" }, 32 | { 33 | name: "--yarn-install", 34 | description: "Install node modules. Skip via --no-yarn-install", 35 | }, 36 | ], 37 | }; 38 | 39 | export default spec; 40 | -------------------------------------------------------------------------------- /src/su.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "su", 3 | description: "", 4 | options: [ 5 | { 6 | name: "-f", 7 | description: 8 | "If the invoked shell is csh(1), this option prevents it from reading the .cshrc file", 9 | }, 10 | { 11 | name: "-l", 12 | description: 13 | "Simulate a full login. The environment is discarded except for HOME, SHELL, PATH, TERM, and USER. HOME and SHELL are modified as above. USER is set to the target login. PATH is set to ``/bin:/usr/bin''. TERM is imported from your current environment. The invoked shell is the target login's, and su willchange directory to the target login's home directory", 14 | }, 15 | { name: "-", description: "(no letter) The same as -l" }, 16 | { 17 | name: "-m", 18 | description: 19 | "Leave the environment unmodified. The invoked shell is your login shell, and no directory changes are made. As a security precaution, if the target user's shell is a non-standard shell (as defined by getusershell(3)) and the caller's real uid is non-zero, su will fail", 20 | }, 21 | ], 22 | args: [ 23 | { name: "login", isOptional: true }, 24 | { name: "ARGS", isOptional: true }, 25 | ], 26 | }; 27 | 28 | export default completionSpec; 29 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: 2 | // https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/typescript-node 3 | { 4 | "name": "Node.js & TypeScript", 5 | "build": { 6 | "dockerfile": "Dockerfile", 7 | // Update 'VARIANT' to pick a Node version: 18, 16, 14. 8 | // Append -bullseye or -buster to pin to an OS version. 9 | // Use -bullseye variants on local on arm64/Apple Silicon. 10 | "args": { 11 | "VARIANT": "16-bullseye" 12 | } 13 | }, 14 | 15 | // Configure tool-specific properties. 16 | "customizations": { 17 | // Configure properties specific to VS Code. 18 | "vscode": { 19 | // Add the IDs of extensions you want installed when the container is created. 20 | "extensions": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"] 21 | } 22 | }, 23 | 24 | // Use 'forwardPorts' to make a list of ports inside the container available locally. 25 | // "forwardPorts": [], 26 | 27 | // Use 'postCreateCommand' to run commands after the container is created. 28 | "postCreateCommand": "npm install", 29 | 30 | // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. 31 | "remoteUser": "node" 32 | } 33 | -------------------------------------------------------------------------------- /src/truncate.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "truncate", 3 | description: "Shrink or extend the size of a file to the specified size", 4 | options: [ 5 | { 6 | name: ["--no-create", "-c"], 7 | description: "Do not create any files", 8 | }, 9 | { 10 | name: ["--io-blocks", "-o"], 11 | description: "Treat SIZE as number of IO blocks instead of bytes", 12 | }, 13 | { 14 | name: ["--reference", "-r"], 15 | description: "Base size on RFILE", 16 | args: { 17 | name: "RFILE", 18 | }, 19 | }, 20 | { 21 | name: ["--size", "-s"], 22 | description: "Set or adjust the file size by SIZE bytes", 23 | args: { 24 | name: "SIZE", 25 | description: 26 | "The SIZE argument is an integer and optional unit; units are K,M,G,T,P,E,Z,Y (powers of 1024) or KB,MB,... (powers of 1000). Binary prefixes can be used, too: KiB=K, MiB=M, and so on", 27 | }, 28 | }, 29 | { 30 | name: "--help", 31 | description: "Show help for truncate", 32 | }, 33 | { 34 | name: "--version", 35 | description: "Output version information and exit", 36 | }, 37 | ], 38 | args: { 39 | name: "FILE", 40 | isVariadic: true, 41 | template: "filepaths", 42 | }, 43 | }; 44 | export default completionSpec; 45 | -------------------------------------------------------------------------------- /icons/file.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/passwd.ts: -------------------------------------------------------------------------------- 1 | const generateUsers: Fig.Generator = { 2 | script: ["bash", "-c", "dscl . -list /Users | grep -E -v '^_'"], 3 | postProcess: (out) => 4 | out 5 | .trim() 6 | .split("\n") 7 | .map((name) => ({ name, icon: "👤" })), 8 | }; 9 | 10 | const completionSpec: Fig.Spec = { 11 | name: "passwd", 12 | description: "Modify a user's password", 13 | options: [ 14 | { 15 | name: "-i", 16 | description: "Specify where the password update should be applied", 17 | args: { 18 | name: "infosystem", 19 | description: "The directory system", 20 | suggestions: ["PAM", "opendirectory", "file", "nis"], 21 | }, 22 | }, 23 | { 24 | name: "-l", 25 | description: 26 | "Causes the password to be updated in the given location of the chosen directory system", 27 | args: { 28 | name: "location", 29 | description: "The location of the chosen directory system", 30 | template: ["filepaths", "folders"], 31 | }, 32 | }, 33 | { 34 | name: "-u", 35 | description: 36 | "Specify the user name to use when authenticating to the directory node", 37 | args: { 38 | name: "authname", 39 | description: "The user name", 40 | generators: generateUsers, 41 | }, 42 | }, 43 | ], 44 | }; 45 | 46 | export default completionSpec; 47 | -------------------------------------------------------------------------------- /src/progressline.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "progressline", 3 | description: "⏳Track commands progress in a compact one-line format", 4 | 5 | options: [ 6 | { 7 | name: ["--help", "-h"], 8 | description: "Show help for progressline", 9 | }, 10 | { 11 | name: ["--log-all", "-a"], 12 | description: "Log all lines above the progress line", 13 | }, 14 | { 15 | name: ["--static-text", "-t"], 16 | description: 17 | "Set static text to display instead of the latest stdin data", 18 | args: { 19 | name: "text", 20 | }, 21 | }, 22 | { 23 | name: ["--activity-style", "-s"], 24 | args: { 25 | name: "style", 26 | default: "dots", 27 | suggestions: ["dots", "kitt", "snake"], 28 | }, 29 | description: "Set style of the activity indicator", 30 | }, 31 | { 32 | name: ["--original-log-path", "-l"], 33 | description: "Save the original log to a file", 34 | args: { 35 | name: "path", 36 | template: "filepaths", 37 | }, 38 | }, 39 | { 40 | name: ["--log-matches", "-m"], 41 | description: 42 | "Log above progress line lines matching the given regular expressions", 43 | args: { 44 | name: "regex", 45 | }, 46 | }, 47 | ], 48 | }; 49 | export default completionSpec; 50 | -------------------------------------------------------------------------------- /src/@usermn/sdc/0.0.0.ts: -------------------------------------------------------------------------------- 1 | const completion: Fig.Subcommand = { 2 | name: "sdc", 3 | description: '"setup dominic\'s computer" cli tool', 4 | subcommands: [ 5 | { 6 | name: "help", 7 | description: "Display help for command", 8 | priority: 49, 9 | args: { 10 | name: "command", 11 | isOptional: true, 12 | template: "help", 13 | }, 14 | }, 15 | ], 16 | options: [ 17 | { 18 | name: ["-V", "--version"], 19 | description: "Output the version number", 20 | }, 21 | { 22 | name: ["-f", "--force"], 23 | description: "Bypass checks", 24 | }, 25 | { 26 | name: "--no-end-clear", 27 | description: 28 | "Skip clearing the console at the end so that output can be viewed", 29 | }, 30 | { 31 | name: ["-h", "--help"], 32 | description: "Display help for command", 33 | priority: 49, 34 | }, 35 | ], 36 | }; 37 | 38 | const versions: Fig.VersionDiffMap = {}; 39 | 40 | versions["0.0.4"] = {}; 41 | 42 | versions["0.0.7"] = { 43 | options: [ 44 | { 45 | name: "--debug-options", 46 | description: "Print options to console for debugging", 47 | }, 48 | { 49 | name: ["-c", "--confirm-commands"], 50 | description: "Confirm commands before running them", 51 | }, 52 | ], 53 | }; 54 | 55 | export { versions }; 56 | export default completion; 57 | -------------------------------------------------------------------------------- /src/gron.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "gron", 3 | description: 4 | "Gron is a tool to make it easier to understand big blobs of JSON", 5 | options: [ 6 | { 7 | name: ["--help", "-h"], 8 | description: "Show help for gron", 9 | }, 10 | { 11 | name: ["-u", "--ungron"], 12 | description: "Reverse the operation (turn assignments back into JSON)", 13 | }, 14 | { 15 | name: ["-v", "--values"], 16 | description: "Print just the values of provided assignments", 17 | }, 18 | { 19 | name: ["-c", "--colorize"], 20 | description: "Colorize output (default on tty)", 21 | }, 22 | { 23 | name: ["-m", "--monochrome"], 24 | description: "Monochrome (don't colorize output)", 25 | }, 26 | { 27 | name: ["-s", "--stream"], 28 | description: "Treat each line of input as a separate JSON object", 29 | }, 30 | { 31 | name: ["-k", "--insecure"], 32 | description: "Disable certificate validation", 33 | }, 34 | { 35 | name: ["-j", "--json"], 36 | description: "Represent gron data as JSON stream", 37 | }, 38 | { 39 | name: "--no-sort", 40 | description: "Don't sort output (faster)", 41 | }, 42 | { 43 | name: "--version", 44 | description: "Print version information", 45 | }, 46 | ], 47 | }; 48 | 49 | export default completionSpec; 50 | -------------------------------------------------------------------------------- /src/networkQuality.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "networkQuality", 3 | description: "Measure the different aspects of network quality", 4 | options: [ 5 | { 6 | name: "-h", 7 | description: "Show help for networkQuality", 8 | }, 9 | { 10 | name: "-c", 11 | description: "Produce computer readable output", 12 | }, 13 | { 14 | name: "-s", 15 | description: "Run tests sequentially instead of in parallel", 16 | }, 17 | { 18 | name: "-v", 19 | description: "Verbose output", 20 | }, 21 | { 22 | name: "-C", 23 | description: "Use a custom configuration URL", 24 | args: { 25 | name: "URL", 26 | }, 27 | }, 28 | { 29 | name: "-I", 30 | description: "Bind test to interface", 31 | args: { 32 | name: "interface", 33 | generators: { 34 | script: ["networksetup", "-listallhardwareports"], 35 | postProcess: (out) => { 36 | const suggestions: Fig.Suggestion[] = []; 37 | const re = /^Hardware Port: (.*?)\n.*?Device: (.*?)$/gms; 38 | for (const match of out.matchAll(re)) { 39 | suggestions.push({ name: match[2], description: match[1] }); 40 | } 41 | return suggestions; 42 | }, 43 | }, 44 | }, 45 | }, 46 | ], 47 | }; 48 | export default completionSpec; 49 | -------------------------------------------------------------------------------- /src/btop.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "btop", 3 | description: "Beautifuler htop (interactive process viewer)", 4 | options: [ 5 | { 6 | name: ["--help", "-h"], 7 | description: "Shows help for btop", 8 | }, 9 | { 10 | name: ["--low-color", "-lc"], 11 | description: "Disables truecolor, converts 24-bit colors to 256-color", 12 | }, 13 | { 14 | name: ["--tty_on", "-t"], 15 | description: 16 | "Forces ON tty mode, max 16 colors and tty friendly graph symbol", 17 | exclusiveOn: ["--tty_off"], 18 | }, 19 | { 20 | name: ["--tty_off", "+t"], 21 | description: "Forces OFF tty mode", 22 | exclusiveOn: ["--tty_on"], 23 | }, 24 | { 25 | name: ["--preset", "-p"], 26 | description: "Start with preset", 27 | args: { 28 | name: "id", 29 | suggestions: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], 30 | }, 31 | }, 32 | { 33 | name: "--utf-force", 34 | description: "Force start even if no UTF-8 locale was detected", 35 | }, 36 | { 37 | name: "--debug", 38 | description: 39 | "Starts in DEBUG mode: shows microsecond timer for information collect and screen draw functions and sets loglevel to DEBUG", 40 | }, 41 | { 42 | name: ["--version", "-v"], 43 | description: "Shows the version of btop", 44 | }, 45 | ], 46 | }; 47 | export default completionSpec; 48 | -------------------------------------------------------------------------------- /src/gibo.ts: -------------------------------------------------------------------------------- 1 | const boilerplates: Fig.Generator = { 2 | script: ["gibo", "list"], 3 | splitOn: "\n", 4 | }; 5 | 6 | const completionSpec: Fig.Spec = { 7 | name: "gibo", 8 | description: "Easy access to gitignore boilerplates", 9 | subcommands: [ 10 | { 11 | name: "dump", 12 | description: "Dump one or more boilerplates to STDOUT", 13 | args: { 14 | name: "boilerplate", 15 | description: "Name of the boilerplate to dump", 16 | generators: boilerplates, 17 | isVariadic: true, 18 | }, 19 | }, 20 | { 21 | name: "search", 22 | description: "Search for boilerplates", 23 | args: { 24 | name: "search term", 25 | description: "Name of the language or framework to search for", 26 | }, 27 | }, 28 | { 29 | name: "root", 30 | description: "Show the directory where gibo stores its boilerplates", 31 | }, 32 | { name: "help", description: "Show help information" }, 33 | { name: "list", description: "Show the list of available boilerplates" }, 34 | { 35 | name: "update", 36 | description: "Update the list of available boilerplates", 37 | }, 38 | { 39 | name: "version", 40 | description: "Show the current version of gibo installed", 41 | }, 42 | ], 43 | options: [ 44 | { 45 | name: ["--help", "-h"], 46 | description: "Show help for gibo", 47 | }, 48 | ], 49 | }; 50 | export default completionSpec; 51 | -------------------------------------------------------------------------------- /src/do-release-upgrade.ts: -------------------------------------------------------------------------------- 1 | const modeArg: Fig.Arg = { 2 | name: "mode", 3 | suggestions: ["desktop", "server"], 4 | }; 5 | 6 | const frontendArg: Fig.Arg = { 7 | name: "frontend", 8 | }; 9 | 10 | const completionSpec: Fig.Spec = { 11 | name: "do-release-upgrade", 12 | description: "Upgrade Ubuntu to latest release", 13 | options: [ 14 | { 15 | name: ["-h", "--help"], 16 | description: "Show help message and exit", 17 | }, 18 | { 19 | name: ["-d", "--devel-release"], 20 | description: 21 | "If using the latest supported release, upgrade to the development release", 22 | }, 23 | { 24 | name: ["-p", "--proposed"], 25 | description: 26 | "Try upgrading to the latest release using the upgrader from Ubuntu-proposed", 27 | }, 28 | { 29 | name: "-m", 30 | description: "Run in a special upgrade mode", 31 | args: modeArg, 32 | hidden: true, 33 | }, 34 | { 35 | name: "--mode", 36 | description: "Run in a special upgrade mode", 37 | requiresSeparator: true, 38 | args: modeArg, 39 | }, 40 | { 41 | name: "-f", 42 | description: "Run the specified frontend", 43 | args: frontendArg, 44 | hidden: true, 45 | }, 46 | { 47 | name: "--frontend", 48 | description: "Run the specified frontend", 49 | requiresSeparator: true, 50 | args: frontendArg, 51 | }, 52 | ], 53 | }; 54 | export default completionSpec; 55 | -------------------------------------------------------------------------------- /src/mask.ts: -------------------------------------------------------------------------------- 1 | // To learn more about Fig's autocomplete standard visit: https://fig.io/docs/concepts/cli-skeleton 2 | // var executeShellCommand: Fig.ExecuteShellCommandFunction; 3 | 4 | // The below is a dummy example for git. Make sure to change the file name! 5 | const completionSpec: Fig.Spec = { 6 | name: "mask", 7 | generateSpec: async (tokens, executeShellCommand) => { 8 | // See if use specified a maskfile location 9 | 10 | var maskfileLocationIdx = tokens.indexOf("--maskfile"); 11 | 12 | var out: string; 13 | // mask --maskfile path/tp/thing build 14 | if (maskfileLocationIdx < 0 || maskfileLocationIdx + 3 > tokens.length) { 15 | const { stdout } = await executeShellCommand({ 16 | command: "cat", 17 | // eslint-disable-next-line @withfig/fig-linter/no-useless-arrays 18 | args: ["maskfile.md"], 19 | }); 20 | out = stdout; 21 | } else { 22 | const { stdout } = await executeShellCommand({ 23 | command: "cat", 24 | // eslint-disable-next-line @withfig/fig-linter/no-useless-arrays 25 | args: [tokens[maskfileLocationIdx + 1]], 26 | }); 27 | out = stdout; 28 | } 29 | 30 | if (out === "") return { name: "null" }; 31 | 32 | return { 33 | name: "mask", 34 | subcommands: out.match(/##.*/g).map((elm) => { 35 | return { 36 | name: elm.slice(3), 37 | }; 38 | }), 39 | }; 40 | }, 41 | }; 42 | 43 | export default completionSpec; 44 | -------------------------------------------------------------------------------- /src/hx.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "hx", 3 | description: "A post-modern text editor", 4 | parserDirectives: { 5 | // Technically the flags _are_ posix compliant, but `-g` cannot be used 6 | // as -gfetch or -gbuild, so this has to be enabled. 7 | flagsArePosixNoncompliant: true, 8 | }, 9 | args: { 10 | name: "files", 11 | template: ["filepaths", "folders"], 12 | isVariadic: true, 13 | }, 14 | options: [ 15 | { 16 | name: ["-h", "--help"], 17 | description: "Show help", 18 | }, 19 | { 20 | name: "--tutor", 21 | description: "Open the tutorial", 22 | }, 23 | { 24 | name: "--health", 25 | description: "Check for errors in editor setup", 26 | args: { 27 | name: "language", 28 | isOptional: true, 29 | }, 30 | }, 31 | { 32 | name: "-v", 33 | description: "Increases logging verbosity", 34 | isRepeatable: true, 35 | }, 36 | { 37 | name: ["-g", "--grammar"], 38 | description: "Fetch or build tree-sitter grammars", 39 | args: { 40 | name: "action", 41 | suggestions: [ 42 | { name: "fetch", icon: "fig://icon?type=command" }, 43 | { name: "build", icon: "fig://icon?type=command" }, 44 | ], 45 | }, 46 | }, 47 | { 48 | name: ["-V", "--version"], 49 | description: "Print version information", 50 | }, 51 | ], 52 | }; 53 | 54 | export default completionSpec; 55 | -------------------------------------------------------------------------------- /src/kubens.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "kubens", 3 | description: "Switch between Kubernetes-namespaces", 4 | additionalSuggestions: [ 5 | { 6 | name: "-", 7 | priority: 85, 8 | description: "Switch to previous namespace within the current context", 9 | icon: "fig://icon?type=asterisk", 10 | }, 11 | ], 12 | parserDirectives: { 13 | flagsArePosixNoncompliant: true, 14 | }, 15 | options: [ 16 | { 17 | name: ["--help", "-h"], 18 | description: "Show help for kubens", 19 | }, 20 | { 21 | name: ["--current", "-c"], 22 | description: "Show current namespace", 23 | }, 24 | ], 25 | args: { 26 | name: "namespace", 27 | generators: [ 28 | { 29 | script: ["bash", "-c", "kubens | grep -v $(kubens -c)"], 30 | postProcess: (out) => 31 | out.split("\n").map((item) => ({ 32 | name: item, 33 | priority: 90, 34 | icon: "fig://icon?type=kubernetes", 35 | })) as Fig.Suggestion[], 36 | }, 37 | { 38 | script: ["kubens", "-c"], 39 | postProcess: (out) => { 40 | return !out 41 | ? [] 42 | : [ 43 | { 44 | name: out, 45 | priority: 100, 46 | icon: "⭐️", 47 | }, 48 | ]; 49 | }, 50 | }, 51 | ], 52 | isOptional: true, 53 | }, 54 | }; 55 | export default completionSpec; 56 | -------------------------------------------------------------------------------- /icons/folder.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/base64.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "base64", 3 | description: "Encode and decode using Base64 representation", 4 | parserDirectives: { 5 | optionsMustPrecedeArguments: true, 6 | }, 7 | options: [ 8 | { 9 | name: ["--help", "-h"], 10 | description: "Display this help and exit", 11 | }, 12 | { 13 | name: ["--break", "-b"], 14 | description: 15 | "Insert line breaks every count characters. Default is 0, which generates an unbroken stream", 16 | args: { 17 | name: "count", 18 | suggestions: ["0"], 19 | default: "0", 20 | }, 21 | }, 22 | { 23 | name: ["--decode", "-d", "-D"], 24 | description: "Decode incoming Base64 stream into binary data", 25 | }, 26 | { 27 | name: ["--input", "-i"], 28 | description: 29 | "Read input from input_file. Default is stdin; passing - also represents stdin", 30 | args: { 31 | name: "input_file", 32 | suggestions: ["stdin", "-"], 33 | default: "stdin", 34 | template: "filepaths", 35 | }, 36 | }, 37 | { 38 | name: ["--output", "-o"], 39 | description: 40 | "Write output to output_file. Default is stdout; passing - also represents stdout", 41 | args: { 42 | name: "output_file", 43 | suggestions: ["stdout", "-"], 44 | default: "stdout", 45 | template: "filepaths", 46 | }, 47 | }, 48 | ], 49 | }; 50 | export default completionSpec; 51 | -------------------------------------------------------------------------------- /src/wrk.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "wrk", 3 | description: "Wrk - a HTTP benchmarking tool", 4 | args: { 5 | name: "Url", 6 | }, 7 | options: [ 8 | { 9 | name: ["-c", "--c"], 10 | description: "Connections to keep open", 11 | args: { 12 | name: "Number", 13 | }, 14 | }, 15 | { 16 | name: ["-d", "--duration"], 17 | description: "Duration of test", 18 | args: { 19 | name: "Time", 20 | }, 21 | }, 22 | { 23 | name: ["-t", "--threads"], 24 | description: "Number of threads", 25 | args: { 26 | name: "Number", 27 | }, 28 | }, 29 | { 30 | name: ["-s", "--script"], 31 | description: "Load Lua script file", 32 | args: { 33 | name: "Script", 34 | }, 35 | }, 36 | { 37 | name: ["-H", "--header"], 38 | description: "Add header to request", 39 | args: { 40 | name: "Header", 41 | }, 42 | }, 43 | { 44 | name: "--latency", 45 | description: "Print latency statistics", 46 | }, 47 | { 48 | name: "--timeout", 49 | description: "Socket/request timeout", 50 | args: { 51 | name: "Time", 52 | }, 53 | }, 54 | { 55 | name: ["-v", "--version"], 56 | description: "Print version details", 57 | }, 58 | { 59 | name: ["-h", "--help"], 60 | description: "Output usage information", 61 | }, 62 | ], 63 | }; 64 | 65 | export default completionSpec; 66 | -------------------------------------------------------------------------------- /src/httpy.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "httpy", 3 | description: "Programmable command-line HTTP client for the API", 4 | args: [ 5 | { 6 | name: "URL", 7 | description: 8 | "The scheme defaults to 'http://' if the URL does not include one", 9 | }, 10 | { 11 | name: "METHOD", 12 | isOptional: true, 13 | suggestions: ["GET", "POST", "PUT", "DELETE"], 14 | default: "GET", 15 | description: 16 | "The HTTP method to be used for the request (GET, POST, PUT, DELETE, ...)", 17 | }, 18 | ], 19 | options: [ 20 | { 21 | name: ["--exec", "-x"], 22 | description: "Execute httpy command", 23 | }, 24 | { 25 | name: ["--status", "-S"], 26 | description: "Print only the response status", 27 | }, 28 | { 29 | name: ["--header", "-H"], 30 | description: "Print only the response headers", 31 | }, 32 | { 33 | name: ["--body", "-B"], 34 | description: "Print only the response body", 35 | }, 36 | { 37 | name: ["--allow-redirect", "-r"], 38 | description: "Allow requests to be redirected", 39 | }, 40 | { 41 | name: ["--verbose", "-V"], 42 | description: "Show request and response in verbose", 43 | }, 44 | { 45 | name: ["--help", "-h"], 46 | description: "Show help for httpy", 47 | }, 48 | { 49 | name: ["--version", "-v"], 50 | description: "Show version for httpy", 51 | }, 52 | ], 53 | }; 54 | export default completionSpec; 55 | -------------------------------------------------------------------------------- /src/vimr.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "vimr", 3 | description: "VimR — Neovim GUI for macOS in Swift", 4 | args: { 5 | template: ["filepaths", "folders"], 6 | }, 7 | options: [ 8 | { 9 | name: ["-h", "--help"], 10 | description: "Show help", 11 | }, 12 | { 13 | name: "--dry-run", 14 | description: "Just print the 'open' command", 15 | }, 16 | { 17 | name: "--cwd", 18 | description: "Set the working directory", 19 | args: { 20 | name: "CWD", 21 | }, 22 | }, 23 | { 24 | name: "--line", 25 | description: "Go to line", 26 | args: { 27 | name: "LINE", 28 | }, 29 | }, 30 | { 31 | name: "--wait", 32 | description: 33 | "This command line tool will exit when the corresponding UI window is closed", 34 | }, 35 | { 36 | name: "--nvim", 37 | description: 38 | "All arguments except --cur-env, --line, --dry-run and --wait will be passed over to the (new) nvim instance in a new UI window", 39 | }, 40 | { 41 | name: "--cur-env", 42 | description: 43 | "Use the current environment variables when launching the background neovim process. All files will be opened in a new window", 44 | }, 45 | { 46 | name: "-n", 47 | description: "Open files in tabs in a new window", 48 | }, 49 | { 50 | name: "-s", 51 | description: "Open files in separate windows", 52 | }, 53 | ], 54 | }; 55 | 56 | export default completionSpec; 57 | -------------------------------------------------------------------------------- /src/nhost.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "nhost", 3 | description: "Nhost's command-line", 4 | subcommands: [ 5 | { 6 | name: "deploy", 7 | description: 8 | "Deploy local migrations and metadata changes to Nhost production", 9 | }, 10 | { 11 | name: "dev", 12 | description: "Start Nhost project for local development", 13 | }, 14 | { 15 | name: "down", 16 | description: "Stop and remove local Nhost backend started by `nhost dev`", 17 | }, 18 | { 19 | name: ["env", "env:ls"], 20 | description: "List environment variables", 21 | }, 22 | { 23 | name: "env:pull", 24 | description: 25 | "Sync remote environment variables to your local environment", 26 | }, 27 | { 28 | name: "help", 29 | description: "Display help for nhost", 30 | }, 31 | { 32 | name: "init", 33 | description: "Initialize current working directory as a Nhost project", 34 | }, 35 | { 36 | name: "link", 37 | description: "Link Nhost Project", 38 | }, 39 | { 40 | name: "login", 41 | description: "Login to your Nhost account", 42 | options: [ 43 | { 44 | name: ["--email", "-e"], 45 | description: "Email address", 46 | args: { 47 | name: "email", 48 | }, 49 | }, 50 | ], 51 | }, 52 | { 53 | name: "logout", 54 | description: "Logout from your Nhost account", 55 | }, 56 | ], 57 | }; 58 | 59 | export default completionSpec; 60 | -------------------------------------------------------------------------------- /src/ni.ts: -------------------------------------------------------------------------------- 1 | import { npmSearchGenerator } from "./npm"; 2 | 3 | const completionSpec: Fig.Spec = { 4 | name: "ni", 5 | description: "Use the right package manager - install", 6 | options: [ 7 | { 8 | name: "-g", 9 | description: 10 | "Operates in 'global' mode, so that packages are installed into the prefix folder instead of the current working directory", 11 | }, 12 | { 13 | name: "-D", 14 | description: "Package will appear in your `devDependencies`", 15 | }, 16 | { 17 | name: "-P", 18 | description: "Save package to your `peerDependencies`", 19 | }, 20 | { 21 | name: "-O", 22 | description: "Save package to your `optionalDependencies`", 23 | }, 24 | { 25 | name: "--frozen", 26 | description: "Don't generate a lockfile and fail if an update is needed", 27 | }, 28 | { 29 | name: "-C", 30 | description: "Change directory", 31 | args: [ 32 | { 33 | name: "directory", 34 | description: "The directory to move", 35 | template: "folders", 36 | }, 37 | { 38 | name: "target", 39 | description: "The target directory", 40 | template: "folders", 41 | }, 42 | ], 43 | }, 44 | { 45 | name: ["-h", "--help"], 46 | description: "Output usage information", 47 | }, 48 | ], 49 | args: { 50 | name: "package", 51 | generators: npmSearchGenerator, 52 | debounce: true, 53 | isVariadic: true, 54 | }, 55 | }; 56 | export default completionSpec; 57 | -------------------------------------------------------------------------------- /src/paste.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "paste", 3 | description: 4 | "The paste utility concatenates the corresponding lines of the given input files, replacing all but the last file's newline characters with a single tab character, and writes the resulting lines to standard output. If end-of-file is reached on an input file while other input files still contain data, the file is treated as if it were an endless source of empty lines", 5 | options: [ 6 | { 7 | name: "-d", 8 | description: 9 | "Use one or more of the provided characters to replace the newline characters instead of the default tab. The characters in list are used circularly, i.e., when list is exhausted the first character from list is reused. This continues until a line from the last input file (in default operation) or the last line in each file (using the -s option) is displayed, at which time paste begins selecting characters from the beginning of list again", 10 | args: { 11 | name: "list", 12 | suggestions: ["\\t\\n", "\\t", "\\n", "\\\\", "\\0"], 13 | default: "\\n", 14 | }, 15 | }, 16 | { 17 | name: "-s", 18 | description: 19 | "Concatenate all of the lines of each separate input file in command line order. The newline character of every line except the last line in each input file is replaced with the tab character, unless otherwise specified by the -d option", 20 | }, 21 | ], 22 | args: { 23 | name: "file", 24 | template: "filepaths", 25 | }, 26 | }; 27 | export default completionSpec; 28 | -------------------------------------------------------------------------------- /src/whence.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "whence", 3 | description: "For each name, indicate how it should be interpreted", 4 | args: { 5 | name: "names", 6 | isVariadic: true, 7 | }, 8 | options: [ 9 | { 10 | name: "-v", 11 | description: "Produce verbose output", 12 | }, 13 | { 14 | name: "-c", 15 | description: "Print results in a csh-like format", 16 | }, 17 | { 18 | name: "-w", 19 | description: 20 | "For each name, print 'name: word', where 'word' is the kind of command", 21 | }, 22 | { 23 | name: "-f", 24 | description: "Display contents of shell functions", 25 | }, 26 | { 27 | name: "-p", 28 | description: 29 | "Do a path search for the name, even if it's an alias/function/builtin", 30 | }, 31 | { 32 | name: "-a", 33 | description: "Don't stop at the first match on the path", 34 | }, 35 | { 36 | name: "-m", 37 | description: 38 | "The arguments are taken as patterns (pattern characters must be quoted)", 39 | }, 40 | { 41 | name: "-s", 42 | description: 43 | "If the pathname contains symlinks, print the symlink-free name as well", 44 | }, 45 | { 46 | name: "-S", 47 | description: "Print intermediate symlinks and the resolved name", 48 | }, 49 | { 50 | name: "-x", 51 | description: "Expand tabs when outputting shell function", 52 | args: { name: "num" }, 53 | }, 54 | ], 55 | }; 56 | 57 | export default completionSpec; 58 | -------------------------------------------------------------------------------- /src/luz.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "luz", 3 | description: "A next-generation build system for Apple Darwin-based systems", 4 | subcommands: [ 5 | { 6 | name: "build", 7 | description: "Build the target in the current directory", 8 | options: [ 9 | { 10 | name: ["--help", "-h"], 11 | description: "Show help for the build command", 12 | }, 13 | { 14 | name: ["--clean", "-c"], 15 | description: "Clean the build directory before building", 16 | }, 17 | ], 18 | }, 19 | { 20 | name: "gen", 21 | description: "Generate a new project", 22 | options: [ 23 | { 24 | name: ["--help", "-h"], 25 | description: "Show help for the gen command", 26 | }, 27 | { 28 | name: ["--type", "-t"], 29 | description: "The type of project to generate", 30 | args: { 31 | name: "type", 32 | suggestions: [ 33 | { 34 | name: "tool", 35 | description: "A command-line tool", 36 | icon: "💻", 37 | }, 38 | { 39 | name: "tweak", 40 | description: "A tweak", 41 | icon: "🛠", 42 | }, 43 | ], 44 | }, 45 | }, 46 | ], 47 | }, 48 | ], 49 | options: [ 50 | { 51 | name: ["--help", "-h"], 52 | description: "Show help for Luz", 53 | }, 54 | ], 55 | }; 56 | export default completionSpec; 57 | -------------------------------------------------------------------------------- /src/gltfjsx.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "gltfjsx", 3 | description: "GLTF to JSX converter", 4 | args: { 5 | name: "file", 6 | template: "filepaths", 7 | }, 8 | options: [ 9 | { 10 | name: ["-t", "--types"], 11 | description: "Add Typescript definitions", 12 | }, 13 | { 14 | name: ["-v", "--verbose"], 15 | description: "Verbose output w/ names and empty groups", 16 | }, 17 | { 18 | name: ["-m", "--meta"], 19 | description: "Include metadata (as userData)", 20 | }, 21 | { 22 | name: ["-s", "--shadows"], 23 | description: "Let meshes cast and receive shadows", 24 | }, 25 | { 26 | name: ["-w", "--printwidth"], 27 | description: "Prettier printWidth (default: 120)", 28 | args: { 29 | name: "width", 30 | }, 31 | }, 32 | { 33 | name: ["-p", "--precision"], 34 | description: "Number of fractional digits (default: 2)", 35 | args: { 36 | name: "digits", 37 | }, 38 | }, 39 | { 40 | name: ["-d", "--draco"], 41 | description: "Draco binary path", 42 | args: { 43 | name: "path", 44 | template: "filepaths", 45 | }, 46 | }, 47 | { 48 | name: ["-r", "--root"], 49 | description: "Sets directory from which .gltf file is served", 50 | args: { 51 | name: "root", 52 | template: "folders", 53 | }, 54 | }, 55 | { 56 | name: ["-D", "--debug"], 57 | description: "Debug output", 58 | }, 59 | ], 60 | }; 61 | 62 | export default completionSpec; 63 | -------------------------------------------------------------------------------- /src/seq.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "seq", 3 | description: "Print sequences of numbers. (Defaults to increments of 1)", 4 | args: [ 5 | { 6 | name: "first", 7 | description: "Starting number in sequence", 8 | }, 9 | { 10 | name: "step", 11 | description: "Increment interval", 12 | isOptional: true, 13 | }, 14 | { 15 | name: "last", 16 | description: "Last number in sequence", 17 | isOptional: true, 18 | }, 19 | ], 20 | options: [ 21 | { 22 | name: ["-w", "--fixed-width"], 23 | description: 24 | "Equalize the widths of all numbers by padding with zeros as necessary", 25 | }, 26 | { 27 | name: ["-s", "--separator"], 28 | description: "String separator between numbers. Default is newline", 29 | insertValue: `-s "{cursor}"`, 30 | args: { 31 | name: "string", 32 | description: "Separator", 33 | }, 34 | }, 35 | { 36 | name: ["-f", "--format"], 37 | description: "Use a printf(3) style format to print each number", 38 | insertValue: `-f %{cursor}`, 39 | args: { 40 | name: "format", 41 | description: "Print all numbers using format", 42 | }, 43 | }, 44 | { 45 | // TODO(platform): macos only option 46 | name: ["-t", "--terminator"], 47 | description: "Use string to terminate sequence of numbers", 48 | insertValue: `-t "{cursor}"`, 49 | args: { 50 | name: "string", 51 | description: "Terminator", 52 | }, 53 | }, 54 | ], 55 | }; 56 | export default completionSpec; 57 | -------------------------------------------------------------------------------- /src/ln.ts: -------------------------------------------------------------------------------- 1 | const sourceDestArgs: Fig.Arg[] = [ 2 | { 3 | name: "source_file", 4 | template: ["filepaths", "folders"], 5 | // isVariadic: true, 6 | // source_file is variadic but usability wise having it is less useful 7 | // because it keeps recommending "source_file" repeatedly and not "link_name or link_dirname" 8 | // and since most people won't need multiple files and those who do can look it up 9 | }, 10 | { 11 | name: "link_name or link_dirname", 12 | isOptional: true, 13 | }, 14 | ]; 15 | 16 | const completionSpec: Fig.Spec = { 17 | name: "ln", 18 | description: "Create (default hard) symbolic links to files", 19 | args: sourceDestArgs, 20 | options: [ 21 | { 22 | name: "-s", 23 | description: "Create a symbolic link", 24 | args: sourceDestArgs, 25 | }, 26 | { 27 | name: "-v", 28 | description: "Verbose", 29 | }, 30 | { 31 | name: "-F", 32 | description: "If link name already exists replace it", 33 | args: sourceDestArgs, 34 | }, 35 | { 36 | name: "-h", 37 | description: "Don't follow symbolic links", 38 | }, 39 | { 40 | name: "-f", 41 | description: 42 | "If link name already exists unlink the old one before creating the new one", 43 | args: sourceDestArgs, 44 | }, 45 | { 46 | name: "-i", 47 | description: "Prompt if proposed link already exists", 48 | args: sourceDestArgs, 49 | }, 50 | { 51 | name: "-n", 52 | description: "Same as -h don't follow symbolic links", 53 | }, 54 | ], 55 | }; 56 | 57 | export default completionSpec; 58 | -------------------------------------------------------------------------------- /src/elm-format.ts: -------------------------------------------------------------------------------- 1 | const supportedElmVersions = [ 2 | { 3 | name: "0.19", 4 | }, 5 | { 6 | name: "0.18", 7 | }, 8 | ]; 9 | 10 | /** 11 | * Based on [elm-format](https://github.com/avh4/elm-format), version 0.8.5. A cli tool for formatting Elm code. 12 | */ 13 | const completionSpec: Fig.Spec = { 14 | name: "elm-format", 15 | description: "Format your code in the Elm idiomatic way", 16 | options: [ 17 | { 18 | name: ["--help", "-h"], 19 | description: "Show help for elm-format", 20 | }, 21 | { 22 | name: "--output", 23 | description: 24 | "Write output to FILE instead of overwriting the given source file", 25 | args: { 26 | name: "FILE", 27 | description: "Name and location of output file", 28 | template: "filepaths", 29 | }, 30 | }, 31 | { 32 | name: "--yes", 33 | description: "Reply 'yes' to all automated prompts", 34 | }, 35 | { 36 | name: "--validate", 37 | description: "Check if files are formatted without changing them", 38 | }, 39 | { 40 | name: "--stdin", 41 | description: "Read from stdin, output to stdout", 42 | }, 43 | { 44 | name: "--elm-version", 45 | description: "The Elm version of the source files being formatted", 46 | args: { 47 | name: "VERSION", 48 | description: "Valid values: 0.18, 0.19. Default: auto", 49 | suggestions: supportedElmVersions, 50 | isOptional: true, 51 | }, 52 | }, 53 | ], 54 | args: { 55 | name: "INPUT", 56 | template: "filepaths", 57 | }, 58 | }; 59 | export default completionSpec; 60 | -------------------------------------------------------------------------------- /src/create-next-app.ts: -------------------------------------------------------------------------------- 1 | // Autogenerated by https://github.com/fedeci/commander-to-fig 2 | 3 | const completionSpec: Fig.Spec = { 4 | name: "create-next-app", 5 | icon: "https://nextjs.org/static/favicon/favicon-16x16.png", 6 | options: [ 7 | { 8 | name: ["-V", "--version"], 9 | description: "Output the version number", 10 | }, 11 | { 12 | name: ["--ts", "--typescript"], 13 | description: "Initialize as a TypeScript project", 14 | }, 15 | { 16 | name: "--use-npm", 17 | description: "Explicitly tell the CLI to bootstrap the app using npm", 18 | }, 19 | { 20 | name: "--use-pnpm", 21 | description: "Explicitly tell the CLI to bootstrap the app using pnpm", 22 | }, 23 | { 24 | name: ["-e", "--example"], 25 | description: 26 | "An example to bootstrap the app with. You can use an example name from the official Next.js repo or a GitHub URL. The URL can use any branch and/or subdirectory", 27 | args: { name: "name|github-url" }, 28 | }, 29 | { 30 | name: "--example-path", 31 | description: 32 | "In a rare case, your GitHub URL might contain a branch name with a slash (e.g. bug/fix-1) and the path to the example (e.g. foo/bar). In this case, you must specify the path to the example separately: --example-path foo/bar", 33 | args: { name: "path-to-example" }, 34 | }, 35 | { 36 | name: ["-h", "--help"], 37 | description: "Display help for command", 38 | priority: 49, 39 | }, 40 | ], 41 | args: { name: "project-directory", template: "folders" }, 42 | }; 43 | 44 | export default completionSpec; 45 | -------------------------------------------------------------------------------- /src/nuxt.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "nuxt", 3 | description: "", 4 | subcommands: [ 5 | { name: "dev", description: "Launch the development server" }, 6 | { 7 | name: "start", 8 | description: 9 | "Start the production server (after running nuxt build). Use it for Node.js hosting like Heroku, Digital Ocean, etc", 10 | }, 11 | { 12 | name: "generate", 13 | description: 14 | "Build the application (if needed), generate every route as a HTML file and statically export to dist/ directory (used for static hosting)", 15 | }, 16 | { 17 | name: "build", 18 | description: 19 | "Build and optimize your application with webpack for production", 20 | }, 21 | { 22 | name: "webpack", 23 | description: "Inspect the webpack config", 24 | subcommands: [{ name: "subcommands coming soon" }], 25 | options: [ 26 | { 27 | name: "--name", 28 | description: "Bundle name to inspect. (client, server, modern)", 29 | }, 30 | { name: "--dev", description: "Inspect webpack config for dev mode" }, 31 | { 32 | name: "--depth", 33 | description: 34 | "Inspection depth. Defaults to 2 to prevent verbose output", 35 | }, 36 | { 37 | name: "--no-colors", 38 | description: 39 | "Disable ANSI colors (disabled by default when TTY is not available or when piping to a file)", 40 | }, 41 | ], 42 | }, 43 | ], 44 | 45 | // Only uncomment if nuxt takes an argument 46 | // args: {} 47 | }; 48 | 49 | export default completionSpec; 50 | -------------------------------------------------------------------------------- /src/remix.ts: -------------------------------------------------------------------------------- 1 | const icon = "https://remix.run/favicon-dark.1.png"; 2 | 3 | const dirArgument: Fig.Arg = { 4 | name: "dir", 5 | description: "Represent the directory of the Remix application", 6 | template: "folders", 7 | isOptional: true, 8 | }; 9 | 10 | const completionSpec: Fig.Spec = { 11 | name: "remix", 12 | description: "Remix CLI to start, build and export your application", 13 | options: [ 14 | { 15 | name: "--help", 16 | description: "Output usage information", 17 | }, 18 | { 19 | name: ["-v", "--version"], 20 | description: "Output the version number", 21 | }, 22 | ], 23 | subcommands: [ 24 | { 25 | name: "build", 26 | description: "Create an optimized production build of your application", 27 | icon, 28 | args: dirArgument, 29 | options: [ 30 | { 31 | name: "--sourcemap", 32 | description: "Enables production sourcemap", 33 | }, 34 | ], 35 | }, 36 | { 37 | name: "dev", 38 | description: "Start the application in development mode", 39 | icon, 40 | args: dirArgument, 41 | }, 42 | { 43 | name: "setup", 44 | description: 45 | "Prepare node_modules/remix folder (after installation of packages)", 46 | icon, 47 | args: dirArgument, 48 | }, 49 | { 50 | name: "routes", 51 | description: "Generate the route config of the application", 52 | icon, 53 | args: dirArgument, 54 | options: [ 55 | { name: "--json", description: "Print the route config as JSON" }, 56 | ], 57 | }, 58 | ], 59 | }; 60 | 61 | export default completionSpec; 62 | -------------------------------------------------------------------------------- /src/java.ts: -------------------------------------------------------------------------------- 1 | import { filepaths } from "@fig/autocomplete-generators"; 2 | const completionSpec: Fig.Spec = { 3 | name: "java", 4 | description: "Launch a Java application", 5 | parserDirectives: { 6 | flagsArePosixNoncompliant: true, 7 | }, 8 | args: { 9 | name: "mainclass", 10 | description: "To launch a class file", 11 | generators: filepaths({ extensions: ["java", "class"] }), 12 | }, 13 | options: [ 14 | { 15 | name: "-jar", 16 | priority: 99, 17 | description: "To launch the main class in a JAR file", 18 | args: { 19 | name: "JAR file", 20 | generators: filepaths({ extensions: ["jar"] }), 21 | }, 22 | }, 23 | { 24 | name: "-D", 25 | priority: 98, 26 | description: "Set a system property, -D=", 27 | }, 28 | { 29 | name: ["--help", "-h", "-?"], 30 | description: "Show help for java", 31 | }, 32 | { 33 | name: ["--version", "-version"], 34 | description: "Print product version to the error stream and exit", 35 | }, 36 | { 37 | name: ["-showversion", "--show-version"], 38 | description: "Print product version to the output stream and continue", 39 | }, 40 | { 41 | name: "--dry-run", 42 | description: 43 | "Create VM and load main class but do not execute main method", 44 | }, 45 | // classpath 46 | { 47 | name: ["--classpath", "-cp"], 48 | description: "Class search path of directories and zip/jar files", 49 | args: { 50 | name: "search files", 51 | template: "filepaths", 52 | }, 53 | }, 54 | ], 55 | }; 56 | export default completionSpec; 57 | -------------------------------------------------------------------------------- /src/whereis.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "whereis", 3 | description: "Locate the binary, source, and manual page files for a command", 4 | options: [ 5 | { 6 | name: "-b", 7 | description: "Search only for binaries", 8 | }, 9 | { 10 | name: "-m", 11 | description: "Search only for manual sections", 12 | }, 13 | { 14 | name: "-s", 15 | description: "Search only for sources", 16 | }, 17 | { 18 | name: "-u", 19 | description: "Search for unusual entries", 20 | }, 21 | { 22 | name: "-B", 23 | description: "Search for binaries only in the specified directory", 24 | args: { 25 | name: "directory", 26 | description: "The directory to search in", 27 | template: "folders", 28 | }, 29 | }, 30 | { 31 | name: "-M", 32 | description: "Search for manual pages only in the specified directory", 33 | args: { 34 | name: "directory", 35 | description: "The directory to search in", 36 | template: "folders", 37 | }, 38 | }, 39 | { 40 | name: "-S", 41 | description: "Search for sources only in the specified directory", 42 | args: { 43 | name: "directory", 44 | description: "The directory to search in", 45 | template: "folders", 46 | }, 47 | }, 48 | { 49 | name: "-f", 50 | description: "Terminate the -B, -M, and -S options", 51 | }, 52 | ], 53 | // Only uncomment if whereis takes an argument 54 | args: { 55 | name: "Filename", 56 | description: "The file to search for", 57 | }, 58 | }; 59 | export default completionSpec; 60 | -------------------------------------------------------------------------------- /src/osascript.ts: -------------------------------------------------------------------------------- 1 | import { filepaths } from "@fig/autocomplete-generators"; 2 | 3 | const completionSpec: Fig.Spec = { 4 | name: "osascript", 5 | description: "Execute OSA scripts (AppleScript, JavaScript, etc.)", 6 | options: [ 7 | { 8 | name: "-e", 9 | description: "Enter one line of a script", 10 | args: { 11 | name: "statement", 12 | }, 13 | }, 14 | { 15 | name: "-i", 16 | description: "Interactive mode", 17 | }, 18 | { 19 | name: "-l", 20 | description: "Override the language for any plain text files", 21 | args: { 22 | name: "language", 23 | }, 24 | }, 25 | { 26 | name: "-s", 27 | description: "Modify the output style", 28 | args: { 29 | name: "flags", 30 | isVariadic: true, 31 | suggestions: [ 32 | { 33 | name: "h", 34 | description: "Print values in human-readable form (default)", 35 | }, 36 | { 37 | name: "s", 38 | description: "Print values in recompilable source form", 39 | }, 40 | { 41 | name: "e", 42 | description: "Print script errors to stderr (default)", 43 | }, 44 | { 45 | name: "o", 46 | description: "Print script errors to stdout", 47 | }, 48 | ], 49 | }, 50 | }, 51 | ], 52 | args: { 53 | name: "script", 54 | isScript: true, 55 | isOptional: true, 56 | generators: filepaths({ 57 | extensions: ["scpt", "scptd"], 58 | editFileSuggestions: { priority: 76 }, 59 | }), 60 | }, 61 | }; 62 | 63 | export default completionSpec; 64 | -------------------------------------------------------------------------------- /src/klist.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "klist", 3 | description: 4 | "Reads and displays the current tickets in the credential cache (also known as the ticket file)", 5 | options: [ 6 | { 7 | name: "-c", 8 | description: "Credential cache to list", 9 | args: { 10 | name: "cache", 11 | }, 12 | }, 13 | { 14 | name: "--cache", 15 | description: "Credential cache to list", 16 | requiresSeparator: true, 17 | args: { 18 | name: "cache", 19 | }, 20 | }, 21 | { 22 | name: ["-s", "-t", "--test"], 23 | description: 24 | "Test for there being an active and valid TGT for the local realm of the user in the credential cache", 25 | }, 26 | { 27 | name: ["-T", "--tokens"], 28 | description: "Display AFS tokens", 29 | }, 30 | { 31 | name: ["-5", "--v5"], 32 | description: "Display v5 cred cache (this is the default)", 33 | }, 34 | { 35 | name: "-f", 36 | description: 37 | "Include ticket flags in short form, each character stands for a specific flag", 38 | }, 39 | { 40 | name: ["-v", "--verbose"], 41 | description: "Verbose output. Include all possible information", 42 | }, 43 | { 44 | name: ["-l", "--list-all"], 45 | description: 46 | "List the credential caches for the current users, not all cache types supports listing multiple caches", 47 | }, 48 | { 49 | name: "--json", 50 | description: "JSON formatted output", 51 | }, 52 | { 53 | name: "--hidden", 54 | description: "Verbose output", 55 | }, 56 | ], 57 | }; 58 | export default completionSpec; 59 | -------------------------------------------------------------------------------- /src/tsx.ts: -------------------------------------------------------------------------------- 1 | import { filepaths } from "@fig/autocomplete-generators"; 2 | 3 | const scriptPathArgs: Fig.Arg = { 4 | name: "script path", 5 | isScript: true, 6 | generators: filepaths({ 7 | extensions: ["ts"], 8 | editFileSuggestions: { priority: 76 }, 9 | editFolderSuggestions: { priority: 70 }, 10 | }), 11 | }; 12 | 13 | const completionSpec: Fig.Spec = { 14 | name: "tsx", 15 | description: "Run TypeScript file using tsx", 16 | subcommands: [ 17 | { 18 | name: "watch", 19 | description: "Run the script and watch for changes", 20 | args: scriptPathArgs, 21 | }, 22 | ], 23 | options: [ 24 | { 25 | name: ["--help", "-h"], 26 | description: "Show help for tsx", 27 | isPersistent: true, 28 | }, 29 | { 30 | name: "--no-cache", 31 | description: "Disable caching", 32 | isPersistent: true, 33 | }, 34 | 35 | { 36 | name: "--clear-screen", 37 | description: "Disable clearing the screen on rerun", 38 | isPersistent: true, 39 | insertValue: "--clear-screen=false", 40 | dependsOn: ["watch"], 41 | args: scriptPathArgs, 42 | }, 43 | 44 | { 45 | name: ["-v", "--version"], 46 | description: "Show version", 47 | }, 48 | { 49 | name: "--tsconfig", 50 | description: "Custom tsconfig.json path", 51 | args: { 52 | name: "tsconfig.json path", 53 | generators: filepaths({ 54 | extensions: ["json"], 55 | editFileSuggestions: { priority: 76 }, 56 | editFolderSuggestions: { priority: 70 }, 57 | }), 58 | }, 59 | }, 60 | ], 61 | 62 | args: scriptPathArgs, 63 | }; 64 | export default completionSpec; 65 | -------------------------------------------------------------------------------- /src/cat.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "cat", 3 | description: "Concatenate and print files", 4 | args: { 5 | isVariadic: true, 6 | template: "filepaths", 7 | }, 8 | options: [ 9 | { 10 | name: "-b", 11 | description: "Number the non-blank output lines, starting at 1", 12 | }, 13 | 14 | { 15 | name: "-e", 16 | description: 17 | "Display non-printing characters (see the -v option), and display a dollar sign (‘$’) at the end of each line", 18 | }, 19 | 20 | { 21 | name: "-l", 22 | description: 23 | "Set an exclusive advisory lock on the standard output file descriptor. This lock is set using fcntl(2) with the F_SETLKW command. If the output file is already locked, cat will block until the lock is acquired", 24 | }, 25 | 26 | { name: "-n", description: "Number the output lines, starting at 1" }, 27 | 28 | { 29 | name: "-s", 30 | description: 31 | "Squeeze multiple adjacent empty lines, causing the output to be single spaced", 32 | }, 33 | 34 | { 35 | name: "-t", 36 | description: 37 | "Display non-printing characters (see the -v option), and display tab characters as ‘^I’", 38 | }, 39 | 40 | { name: "-u", description: "Disable output buffering" }, 41 | 42 | { 43 | name: "-v", 44 | description: 45 | "Display non-printing characters so they are visible. Control characters print as ‘^X’ for control-X; the delete character (octal 0177) prints as ‘^?’. Non-ASCII characters (with the high bit set) are printed as ‘M-’ (for meta) followed by the character for the low 7 bits", 46 | }, 47 | ], 48 | }; 49 | 50 | export default completionSpec; 51 | -------------------------------------------------------------------------------- /src/mknod.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "mknod", 3 | description: "Create device special file", 4 | subcommands: [ 5 | { 6 | name: "c", 7 | description: "Create (c)haracter device", 8 | }, 9 | { 10 | name: "b", 11 | description: "Create (b)lock device", 12 | }, 13 | ], 14 | options: [ 15 | { 16 | name: "-F", 17 | description: "Format", 18 | args: { 19 | name: "FORMAT", 20 | suggestions: [ 21 | "native", 22 | "386bsd", 23 | "4bsd", 24 | "bsdos", 25 | "freebsd", 26 | "hpux", 27 | "isc", 28 | "linux", 29 | "netbsd", 30 | "npux", 31 | "isc", 32 | "linux", 33 | "netbsd", 34 | "osf1", 35 | "sco", 36 | "solaris", 37 | "sunos", 38 | "svr3", 39 | "svr4", 40 | "ultrix", 41 | ], 42 | default: "native", 43 | }, 44 | }, 45 | ], 46 | args: [ 47 | { 48 | name: "FILE", 49 | description: "File to create", 50 | }, 51 | { 52 | name: "major", 53 | description: 54 | "The major device number is an integer number which tells the kernel which device driver entry point to use", 55 | }, 56 | { 57 | name: "minor | unit subunit", 58 | description: 59 | "The minor device number tells the kernel which one of several similar devices the node corresponds to; the unit and subunit numbers select a subset of a device; for example, the unit may specify a particular SCSI disk, and the subunit a partition on that disk", 60 | }, 61 | ], 62 | }; 63 | export default completionSpec; 64 | -------------------------------------------------------------------------------- /src/more.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "more", 3 | description: "Opposite of less", 4 | options: [ 5 | { 6 | name: ["-d", "--silent"], 7 | description: 8 | "Prompt with '[Press space to continue, 'q' to quit.]', and display '[Press 'h' for instructions.]' instead of ringing the bell when an illegal key is pressed", 9 | }, 10 | { 11 | name: ["-l", "--logical"], 12 | description: "Do not pause after any line containing a ^L (form feed)", 13 | }, 14 | { 15 | name: ["-f", "--no-pause"], 16 | description: "Count logical lines, rather than screen lines", 17 | }, 18 | { 19 | name: ["-p", "--print-over"], 20 | description: "Instead, clear the whole screen and then display the text", 21 | }, 22 | { 23 | name: ["-c", "--clean-print"], 24 | description: 25 | "Instead, paint each screen from the top, clearing the remainder of each line as it is displayed", 26 | }, 27 | { 28 | name: ["-s", "--squeeze"], 29 | description: "Squeeze multiple blank lines into one", 30 | }, 31 | { 32 | name: ["-u", "--plain"], 33 | description: "Silently ignored as backwards compatibility", 34 | }, 35 | { 36 | name: ["-n", "--lines"], 37 | description: "Specify the number of lines per screenful", 38 | args: { name: "n" }, 39 | }, 40 | { 41 | name: "--help", 42 | description: "Display help text", 43 | }, 44 | { 45 | name: ["-V", "--version"], 46 | description: "Display version information", 47 | }, 48 | ], 49 | args: { 50 | isVariadic: true, 51 | template: "filepaths", 52 | }, 53 | }; 54 | 55 | export default completionSpec; 56 | -------------------------------------------------------------------------------- /src/twiggy.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "twiggy", 3 | description: "A code-size profiler for WebAssembly", 4 | icon: "🌱", 5 | subcommands: [ 6 | { 7 | name: "diff", 8 | description: 9 | "Diff the old and new versions of a binary to see what sizes changed", 10 | }, 11 | { 12 | name: "dominators", 13 | icon: "🌲", 14 | description: 15 | "Compute and display the dominator tree for a binary's call graph", 16 | }, 17 | { 18 | name: "garbage", 19 | icon: "🗑️", 20 | description: 21 | "Find and display code and data that is not transitively referenced by any exports or public functions", 22 | }, 23 | { 24 | name: "help", 25 | description: "Prints this message or the help of the given subcommand(s)", 26 | args: { 27 | name: "subcommand", 28 | template: "help", 29 | }, 30 | }, 31 | { 32 | name: "monos", 33 | icon: "📈", 34 | description: 35 | "List the generic function monomorphizations that are contributing to code bloat", 36 | }, 37 | { 38 | name: "paths", 39 | icon: "📁", 40 | description: 41 | "Find and display the call paths to a function in the given binary's call graph", 42 | }, 43 | { 44 | name: "top", 45 | icon: "📈", 46 | description: "List the top code size offenders in a binary", 47 | }, 48 | ], 49 | options: [ 50 | { 51 | name: ["--help", "-h"], 52 | description: "Prints help information", 53 | }, 54 | { 55 | name: ["--version", "-v"], 56 | description: "Prints version information", 57 | }, 58 | ], 59 | }; 60 | 61 | export default completionSpec; 62 | -------------------------------------------------------------------------------- /src/xed.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "xed", 3 | description: "Xcode text editor invocation tool", 4 | options: [ 5 | { 6 | name: ["--launch", "-x"], 7 | description: "Launches Xcode, opening a new empty unsaved file", 8 | }, 9 | { 10 | name: ["--create", "-c"], 11 | description: 12 | "Creates any non-existent files in the file list. If used without --launch, standard input will be read and piped to the last file created", 13 | }, 14 | { 15 | name: ["--wait", "-w"], 16 | description: 17 | "Wait for the files to be closed before exiting. xed will idle and will only terminate when all files are closed", 18 | }, 19 | { 20 | name: ["--line", "-l"], 21 | description: "Selects the given line in the last file opened", 22 | args: { 23 | name: "number", 24 | description: "The line number to select", 25 | }, 26 | }, 27 | { 28 | name: ["--background", "-b"], 29 | description: 30 | "Opens Xcode without activating it; the process that invoked xed remains in front", 31 | }, 32 | { 33 | name: ["--help", "-h"], 34 | description: "Show help for xed", 35 | exclusiveOn: ["-x", "-c", "-w", "-l", "-b", "-v"], 36 | }, 37 | { 38 | name: ["--version", "-v"], 39 | description: "Prints the version number of xed", 40 | }, 41 | ], 42 | args: { 43 | name: "file", 44 | description: 45 | "A list of file paths. If no files are passed, then standard input will \ 46 | be read and piped into a new untitled document", 47 | isVariadic: true, 48 | isOptional: true, 49 | template: "filepaths", 50 | }, 51 | }; 52 | export default completionSpec; 53 | -------------------------------------------------------------------------------- /src/sidekiq.ts: -------------------------------------------------------------------------------- 1 | import { filepaths } from "@fig/autocomplete-generators"; 2 | 3 | const completionSpec: Fig.Spec = { 4 | name: "sidekiq", 5 | description: "Background job framework for Ruby", 6 | options: [ 7 | { 8 | name: ["--concurrency", "-c"], 9 | description: "Processor threads to use", 10 | args: { name: "INT" }, 11 | }, 12 | { 13 | name: ["--environment", "-e"], 14 | description: "Application environment", 15 | args: { name: "ENV" }, 16 | }, 17 | { 18 | name: ["--tag", "-g"], 19 | description: "Process tag for procline", 20 | args: { name: "TAG" }, 21 | }, 22 | { 23 | name: ["--queue", "-q"], 24 | description: "Queues to process with optional weights", 25 | args: [{ name: "QUEUE" }, { name: "WEIGHT", isOptional: true }], 26 | }, 27 | { 28 | name: ["--require", "-r"], 29 | description: "Location of Rails application with jobs or file to require", 30 | args: { name: "PATH|DIR", template: ["folders", "filepaths"] }, 31 | }, 32 | { 33 | name: ["--timeout", "-t"], 34 | description: "Shutdown timeout", 35 | args: { name: "NUM" }, 36 | }, 37 | { 38 | name: ["--verbose", "-v"], 39 | description: "Print more verbose output", 40 | }, 41 | { 42 | name: ["--config", "-C"], 43 | description: "Path to YAML config file", 44 | args: { name: "PATH", generators: filepaths({ extensions: ["yaml"] }) }, 45 | }, 46 | { 47 | name: ["--help", "-h"], 48 | description: "Show help for sidekiq run", 49 | }, 50 | { 51 | name: ["--version", "-V"], 52 | description: "Print version and exit", 53 | }, 54 | ], 55 | }; 56 | export default completionSpec; 57 | -------------------------------------------------------------------------------- /src/az/2.53.0/term.ts: -------------------------------------------------------------------------------- 1 | const completion: Fig.Spec = { 2 | name: "term", 3 | description: "Manage marketplace agreement with marketplaceordering", 4 | subcommands: [ 5 | { 6 | name: "accept", 7 | description: "Accept marketplace terms", 8 | options: [ 9 | { 10 | name: "--plan", 11 | description: "Plan identifier string of image being deployed", 12 | args: { name: "plan" }, 13 | isRequired: true, 14 | }, 15 | { 16 | name: "--product", 17 | description: "Offer identifier string of image being deployed", 18 | args: { name: "product" }, 19 | isRequired: true, 20 | }, 21 | { 22 | name: "--publisher", 23 | description: "Publisher identifier string of image being deployed", 24 | args: { name: "publisher" }, 25 | isRequired: true, 26 | }, 27 | ], 28 | }, 29 | { 30 | name: "show", 31 | description: "Get marketplace terms", 32 | options: [ 33 | { 34 | name: "--plan", 35 | description: "Plan identifier string of image being deployed", 36 | args: { name: "plan" }, 37 | isRequired: true, 38 | }, 39 | { 40 | name: "--product", 41 | description: "Offeridentifier string of image being deployed", 42 | args: { name: "product" }, 43 | isRequired: true, 44 | }, 45 | { 46 | name: "--publisher", 47 | description: "Publisher identifier string of image being deployed", 48 | args: { name: "publisher" }, 49 | isRequired: true, 50 | }, 51 | ], 52 | }, 53 | ], 54 | }; 55 | 56 | export default completion; 57 | -------------------------------------------------------------------------------- /src/mackup.ts: -------------------------------------------------------------------------------- 1 | const applicationGenerator: Fig.Generator = { 2 | script: ["mackup", "list"], 3 | postProcess: (output) => { 4 | return output 5 | .split("\n") 6 | .filter((line) => line.includes("-")) 7 | .map((name) => ({ name: name.substring(3) })); 8 | }, 9 | }; 10 | 11 | const completionSpec: Fig.Spec = { 12 | name: "mackup", 13 | description: "Mackup", 14 | options: [ 15 | { 16 | name: ["--help", "-h"], 17 | description: "Show help", 18 | }, 19 | { 20 | name: ["--force", "-f"], 21 | description: "Force every question asked to be answered with 'Yes'", 22 | }, 23 | { 24 | name: ["--root", "-r"], 25 | description: "Allow mackup to be run as superuser", 26 | }, 27 | { 28 | name: ["--dry-run", "-n"], 29 | description: "Show steps without executing", 30 | }, 31 | { 32 | name: "--version", 33 | description: "Show version", 34 | }, 35 | ], 36 | subcommands: [ 37 | { 38 | name: "list", 39 | description: "List all the supported mackup applications", 40 | }, 41 | { 42 | name: "backup", 43 | description: "Sync your conf files to your synced storage", 44 | }, 45 | { 46 | name: "restore", 47 | description: 48 | "Link the conf files already in your synced storage on your system", 49 | }, 50 | { 51 | name: "show", 52 | description: "Show the current configuration", 53 | args: { 54 | name: "application", 55 | generators: applicationGenerator, 56 | }, 57 | }, 58 | { 59 | name: "uninstall", 60 | description: "Reset everything as it was before using Mackup", 61 | }, 62 | ], 63 | }; 64 | 65 | export default completionSpec; 66 | -------------------------------------------------------------------------------- /src/tailcall.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "tailcall", 3 | description: 4 | "TailCall CLI for managing and optimizing GraphQL configurations", 5 | subcommands: [ 6 | { 7 | name: "check", 8 | description: "Validate a composition spec", 9 | args: { 10 | name: "FILE_PATHS", 11 | template: "filepaths", 12 | isVariadic: true, 13 | }, 14 | options: [ 15 | { 16 | name: "--n-plus-one-queries", 17 | description: "Detect N+1 issues", 18 | isPersistent: true, 19 | }, 20 | { 21 | name: "--schema", 22 | description: "Display the schema of the composition spec", 23 | isPersistent: true, 24 | }, 25 | { 26 | name: "--format", 27 | description: "Change the format of the input file", 28 | args: { 29 | suggestions: ["gql", "graphql", "yml", "yaml", "json"], 30 | }, 31 | }, 32 | ], 33 | }, 34 | { 35 | name: "start", 36 | description: "Launch the GraphQL Server for the specific configuration", 37 | args: { 38 | name: "PATHS", 39 | template: ["filepaths", "folders"], 40 | isVariadic: true, 41 | }, 42 | }, 43 | { 44 | name: "init", 45 | description: "Bootstrap a new TailCall project", 46 | args: { 47 | name: "FILE_PATH", 48 | template: "folders", 49 | }, 50 | }, 51 | { 52 | name: "gen", 53 | description: "Generate GraphQL configurations from various sources", 54 | args: { 55 | name: "CONFIG_FILE", 56 | template: "filepaths", 57 | }, 58 | }, 59 | ], 60 | }; 61 | 62 | export default completionSpec; 63 | -------------------------------------------------------------------------------- /src/visudo.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "visudo", 3 | description: 4 | "Visudo edits the sudoers file, which defines the users and groups with administrator rights", 5 | options: [ 6 | { 7 | name: ["--check", "-c"], 8 | description: "Checking existing sudoers file for syntax errors", 9 | }, 10 | { 11 | name: ["--file", "-f"], 12 | description: "Set an alternative sudoers file location", 13 | args: { 14 | name: "New sudoers location", 15 | description: "Specify the alternate sudoers file location", 16 | template: "filepaths", 17 | }, 18 | }, 19 | { 20 | name: ["--help", "-h"], 21 | description: "Display a short help message", 22 | }, 23 | { 24 | name: ["--quiet", "-q"], 25 | description: "Enable quiet mode (syntax error not printed)", 26 | }, 27 | { 28 | name: ["--strict", "-s"], 29 | description: "Enable strict checking of the sudoers file", 30 | }, 31 | { 32 | name: ["--version", "-V"], 33 | description: "Display version and exit", 34 | }, 35 | { 36 | name: ["--export", "-x"], 37 | description: "Export JSON and write it to output_file", 38 | args: { 39 | name: "Output file name", 40 | template: "filepaths", 41 | suggestCurrentToken: true, 42 | }, 43 | }, 44 | { 45 | name: ["--perms", "-P"], 46 | description: "Enforce default mode for the sudoers file", 47 | }, 48 | { 49 | name: ["--owner", "-O"], 50 | description: "Enforce the default ownership for the sudoers file", 51 | }, 52 | ], 53 | // Only uncomment if visudo takes an argument 54 | // args: {} 55 | }; 56 | export default completionSpec; 57 | -------------------------------------------------------------------------------- /src/az/2.53.0/cli-translator.ts: -------------------------------------------------------------------------------- 1 | const completion: Fig.Spec = { 2 | name: "cli-translator", 3 | description: "Translate ARM template or REST API to CLI scripts", 4 | subcommands: [ 5 | { 6 | name: "arm", 7 | description: 8 | "Translate ARM template to CLI scripts(Currently only support Compute, Network and Storage)", 9 | subcommands: [ 10 | { 11 | name: "translate", 12 | description: 13 | "Translate ARM template to CLI scripts(Currently only support Compute, Network and Storage)", 14 | options: [ 15 | { 16 | name: "--parameters", 17 | description: "The local path or url of parameters.json file", 18 | args: { name: "parameters" }, 19 | isRequired: true, 20 | }, 21 | { 22 | name: ["--resource-group", "-g"], 23 | description: 24 | "Name of resource group. You can configure the default group using az configure --defaults group=", 25 | args: { name: "resource-group" }, 26 | isRequired: true, 27 | }, 28 | { 29 | name: "--template", 30 | description: "The local path or url of template.json file", 31 | args: { name: "template" }, 32 | isRequired: true, 33 | }, 34 | { 35 | name: "--target-subscription", 36 | description: 37 | "The target subscription id. If omit, the current subscription id will be used", 38 | args: { name: "target-subscription" }, 39 | }, 40 | ], 41 | }, 42 | ], 43 | }, 44 | ], 45 | }; 46 | 47 | export default completion; 48 | -------------------------------------------------------------------------------- /src/wing.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "wing", 3 | subcommands: [ 4 | { 5 | name: "run", 6 | description: "Runs a Wing executable in the Wing Console", 7 | options: [ 8 | { 9 | name: ["-h", "--help"], 10 | description: "Display help for command", 11 | priority: 49, 12 | }, 13 | ], 14 | args: { name: "executable", description: "Executable .wx file" }, 15 | }, 16 | { 17 | name: "compile", 18 | description: "Compiles a Wing program", 19 | options: [ 20 | { 21 | name: ["-o", "--out-dir"], 22 | description: "Output directory", 23 | args: { 24 | name: "out-dir", 25 | }, 26 | }, 27 | { 28 | name: ["-t", "--target"], 29 | description: "Target platform (options: 'tf-aws', 'sim')", 30 | args: { name: "target", default: "tf-aws" }, 31 | }, 32 | { 33 | name: ["-h", "--help"], 34 | description: "Display help for command", 35 | priority: 49, 36 | }, 37 | ], 38 | args: { name: "entrypoint", description: "Program .w entrypoint" }, 39 | }, 40 | { 41 | name: "upgrade", 42 | description: "Upgrades the Wing toolchain to the latest version", 43 | options: [ 44 | { 45 | name: ["-h", "--help"], 46 | description: "Display help for command", 47 | priority: 49, 48 | }, 49 | ], 50 | }, 51 | { 52 | name: "help", 53 | description: "Display help for command", 54 | priority: 49, 55 | args: { name: "command", isOptional: true, template: "help" }, 56 | }, 57 | ], 58 | }; 59 | 60 | export default completionSpec; 61 | -------------------------------------------------------------------------------- /src/az/2.53.0/scenario.ts: -------------------------------------------------------------------------------- 1 | const completion: Fig.Spec = { 2 | name: "scenario", 3 | description: "E2E Scenario Usage Guidance", 4 | subcommands: [ 5 | { 6 | name: "guide", 7 | description: 8 | "Fuzzy search E2E scenario examples and execute them with walk-through", 9 | options: [ 10 | { 11 | name: "--match-rule", 12 | description: 13 | 'The matching rules for multi-keywords: "and" is to search scenarios that match all keywords, "or" is to search scenarios that match any keyword, "all" is to search scenarios that match all keywords first, if the number is not enough then search any keyword', 14 | args: { name: "match-rule", suggestions: ["all", "and", "or"] }, 15 | }, 16 | { 17 | name: "--scope", 18 | description: 19 | 'The scope of search: "scenario" is to search whether the title and description in E2E scenario data contain keywords, "command" is to search whether the commands in E2E scenario data contain keywords, "all" is to search all contents', 20 | args: { name: "scope", suggestions: ["all", "command", "scenario"] }, 21 | }, 22 | { 23 | name: "--top", 24 | description: 25 | "Specify the number of results to return. The maximum value is limited to 20", 26 | args: { name: "top" }, 27 | }, 28 | ], 29 | args: { 30 | name: "", 31 | description: 32 | "Keywords for search. If there are multiple keywords, please separate them with spaces. Fuzzy search is supported, and the returned results are sorted by keyword matching degree", 33 | isOptional: true, 34 | }, 35 | }, 36 | ], 37 | }; 38 | 39 | export default completion; 40 | -------------------------------------------------------------------------------- /src/touch.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "touch", 3 | description: "Change file access and modification times", 4 | args: { 5 | name: "file", 6 | isVariadic: true, 7 | template: "folders", 8 | suggestCurrentToken: true, 9 | }, 10 | options: [ 11 | { 12 | name: "-A", 13 | description: 14 | "Adjust the access and modification time stamps for the file by the specified value", 15 | args: { 16 | name: "time", 17 | description: "[-][[hh]mm]SS", 18 | }, 19 | }, 20 | { name: "-a", description: "Change the access time of the file" }, 21 | { 22 | name: "-c", 23 | description: "Do not create the file if it does not exist", 24 | }, 25 | { 26 | name: "-f", 27 | description: 28 | "Attempt to force the update, even if the file permissions do not currently permit it", 29 | }, 30 | { 31 | name: "-h", 32 | description: 33 | "If the file is a symbolic link, change the times of the link itself rather than the file that the link points to", 34 | }, 35 | { 36 | name: "-m", 37 | description: "Change the modification time of the file", 38 | }, 39 | { 40 | name: "-r", 41 | description: 42 | "Use the access and modifications times from the specified file instead of the current time of day", 43 | args: { 44 | name: "file", 45 | }, 46 | }, 47 | { 48 | name: "-t", 49 | description: 50 | "Change the access and modification times to the specified time instead of the current time of day", 51 | args: { 52 | name: "timestamp", 53 | description: "[[CC]YY]MMDDhhmm[.SS]", 54 | }, 55 | }, 56 | ], 57 | }; 58 | 59 | export default completionSpec; 60 | -------------------------------------------------------------------------------- /src/zipcloak.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "zipcloak", 3 | description: "Encrypt entries in a zipfile", 4 | args: { 5 | name: "zipfile", 6 | description: "Zipped file to encrypt entries into", 7 | template: ["filepaths"], 8 | suggestCurrentToken: true, 9 | }, 10 | options: [ 11 | { 12 | name: ["--help", "-h"], 13 | description: "Show a short help for zipcloak", 14 | }, 15 | { 16 | name: ["--decrypt", "-d"], 17 | description: "Decrypt encrypted entries (copy if given wrong password)", 18 | args: { 19 | name: "zipfile", 20 | description: "Zipped file to decrypt entries of", 21 | template: ["filepaths"], 22 | }, 23 | }, 24 | { 25 | name: ["--license", "-L"], 26 | description: "Show software license", 27 | }, 28 | { 29 | name: ["--version", "-v"], 30 | description: "Show version information", 31 | }, 32 | { 33 | name: ["--quiet", "-q"], 34 | description: "Quiet operation. Suppresses some informational messages", 35 | }, 36 | { 37 | name: ["--output-file", "-O"], 38 | description: 39 | "Write output to new archive zipfile, leaving original archive as is", 40 | args: { 41 | name: "zipfile", 42 | description: "New zipfile that will be written to", 43 | template: ["filepaths"], 44 | suggestCurrentToken: true, 45 | }, 46 | }, 47 | { 48 | name: ["--temp-path", "-b"], 49 | description: "Use the directory given by path for the temporary zip file", 50 | args: { 51 | name: "directory", 52 | description: "Directory for the temporary zip file", 53 | template: ["filepaths"], 54 | }, 55 | }, 56 | ], 57 | }; 58 | export default completionSpec; 59 | -------------------------------------------------------------------------------- /src/df.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "df", 3 | description: "Display free disk space", 4 | args: { 5 | name: "file or filesystem", 6 | }, 7 | options: [ 8 | { 9 | name: "-a", 10 | description: "Show all mount points", 11 | }, 12 | { 13 | name: ["-b", "-P"], 14 | description: "Use 512-byte blocks (default)", 15 | exclusiveOn: ["-g", "-k", "-m"], 16 | }, 17 | { 18 | name: "-g", 19 | description: "Use 1073741824-byte (1-Gbyte) blocks", 20 | exclusiveOn: ["-b", "-P", "-m", "-k"], 21 | }, 22 | { 23 | name: "-m", 24 | description: "Use 1048576-byte (1-Mbyte) blocks", 25 | exclusiveOn: ["-b", "-P", "-g", "-k"], 26 | }, 27 | { 28 | name: "-k", 29 | description: "Use 1024-byte (1-Kbyte) blocks", 30 | exclusiveOn: ["-b", "-P", "-g", "-m"], 31 | }, 32 | { 33 | name: "-H", 34 | description: '"Human-readable" output, uses base 10 unit suffixes', 35 | exclusiveOn: ["-h"], 36 | }, 37 | { 38 | name: "-h", 39 | description: '"Human-readable" output, uses base 2 unit suffixes', 40 | exclusiveOn: ["-H"], 41 | }, 42 | { 43 | name: "-i", 44 | description: "Include the number of free inodes", 45 | }, 46 | { 47 | name: "-l", 48 | description: "Only display information about locally-mounted filesystems", 49 | }, 50 | { 51 | name: "-n", 52 | description: "Print out the previously obtained statistics", 53 | }, 54 | { 55 | name: "-T", 56 | description: 57 | "Only print out statistics for filesystems of the specified types (comma separated)", 58 | args: { 59 | name: "filesystem", 60 | }, 61 | }, 62 | ], 63 | }; 64 | 65 | export default completionSpec; 66 | -------------------------------------------------------------------------------- /src/cut.ts: -------------------------------------------------------------------------------- 1 | const completionSpec: Fig.Spec = { 2 | name: "cut", 3 | description: "Cut out selected portions of each line of a file", 4 | args: { 5 | template: "filepaths", 6 | isOptional: true, 7 | isVariadic: true, 8 | }, 9 | options: [ 10 | { 11 | name: "-b", 12 | description: "Byte positions as a comma or - separated list of numbers", 13 | args: { 14 | name: "list", 15 | description: "Specifies byte positions", 16 | }, 17 | }, 18 | { 19 | name: "-c", 20 | description: "Column positions as a comma or - separated list of numbers", 21 | args: { 22 | name: "list", 23 | description: "Specifies column positions", 24 | }, 25 | }, 26 | { 27 | name: "-f", 28 | description: "Field positions as a comma or - separated list of numbers", 29 | args: { 30 | name: "list", 31 | description: "Specifies column positions", 32 | }, 33 | }, 34 | { 35 | name: "-n", 36 | description: "Do not split multi-byte characters", 37 | }, 38 | { 39 | name: "-d", 40 | description: 41 | "Use delim as the field delimiter character instead of the tab character", 42 | args: { 43 | name: "delim", 44 | description: "Field deliminator to use instead of the tab character", 45 | isOptional: true, 46 | }, 47 | }, 48 | { 49 | name: "-s", 50 | description: 51 | "Suppress lines with no field delimiter characters. unless specified, lines with no delimiters are passed through unmodified", 52 | }, 53 | { 54 | name: "-w", 55 | description: 56 | "Use whitespace (spaces and tabs) as the delimiter. Consecutive spaces and tabs count as one single field separator", 57 | }, 58 | ], 59 | }; 60 | 61 | export default completionSpec; 62 | -------------------------------------------------------------------------------- /src/env.ts: -------------------------------------------------------------------------------- 1 | const enviromentVariables: Fig.Generator = { 2 | custom: async (_tokens, _executeCommand, generatorContext) => { 3 | return Object.values(generatorContext.environmentVariables).map( 4 | (envVar) => ({ 5 | name: envVar, 6 | description: "Environment variable", 7 | icon: "🌎", 8 | }) 9 | ); 10 | }, 11 | }; 12 | 13 | const completionSpec: Fig.Spec = { 14 | name: "env", 15 | description: "Set environment and execute command, or print environment", 16 | options: [ 17 | { 18 | name: "-0", 19 | description: "End each output line with NUL, not newline", 20 | }, 21 | { 22 | name: ["-i", "-"], 23 | description: "Start with an empty environment", 24 | }, 25 | { 26 | name: "-v", 27 | description: "Print verbose logs", 28 | }, 29 | { 30 | name: "-u", 31 | description: "Remove variable from the environment", 32 | args: { 33 | name: "name", 34 | generators: enviromentVariables, 35 | }, 36 | }, 37 | { 38 | name: "-P", 39 | description: 40 | "Search the given directories for the utility, rather than the PATH", 41 | args: { 42 | name: "altpath", 43 | template: "folders", 44 | }, 45 | }, 46 | { 47 | name: "-S", 48 | description: "Split the given string into separate arguments", 49 | args: { 50 | name: "string", 51 | }, 52 | }, 53 | ], 54 | // Only uncomment if env takes an argument 55 | args: [ 56 | { 57 | name: "name=value ...", 58 | description: "Set environment variables", 59 | isOptional: true, 60 | }, 61 | { 62 | name: "utility", 63 | description: "Utility to run", 64 | isOptional: true, 65 | isCommand: true, 66 | }, 67 | ], 68 | }; 69 | export default completionSpec; 70 | --------------------------------------------------------------------------------