Home
Wiki
Review
Docs
PR #240128
1Type System Updates for Generator Return Values
1 file+2β2
index.d.tsextensions/terminal-suggest/src/completions
Read explanation
The Fig spec format includes generators that dynamically produce suggestions by running shell commands. Some generators may fail (command not found, empty output, parse errors) and need to return undefined rather than an empty array.
Updated two type definitions to allow undefined returns:
index.d.ts:1160
typescript
// Generator script functionscript?: | string[]- | Function<string[], string[]>+ | Function<string[], string[] | undefined>
index.d.ts:1177
typescript
// Generator postProcess functionpostProcess?: ( out: string, tokens: string[]-) => (Suggestion | null)[]+) => (Suggestion | null)[] | undefined
This enables patterns like yarn.ts:352-363:
typescript
script: function (context) { if (context[context.length - 1] === "") return undefined; // Early exit // ... generate suggestions}
2Runtime Safety for Undefined Generator Results
1 file+3
terminalSuggestMain.tsextensions/terminal-suggest/src
Read explanation
With generators now able to return undefined, added a guard before iterating over results to prevent runtime errors.
terminalSuggestMain.ts:263-265
typescript
const generatedItems = generator.postProcess( output, command.tokens.map(e => e.text));+if (!generatedItems) {+ continue; // Skip this generator+}for (const generatedItem of generatedItems) { // ... process suggestions}
Without this check, attempting to iterate over undefined would throw a TypeError.
3New Completion Specifications
34 files+12313
apt.tsextensions/terminal-suggest/src/completions/upstream
brew.tsextensions/terminal-suggest/src/completions/upstream
cat.tsextensions/terminal-suggest/src/completions/upstream
chmod.tsextensions/terminal-suggest/src/completions/upstream
chown.tsextensions/terminal-suggest/src/completions/upstream
+29 more files
Read explanation
Added 34 completion specs defining command structure, options, and argument completion for common CLI tools. Each spec follows the Fig format with:
- Subcommands: Nested command hierarchies (e.g.,
npm install,git commit)- Options: Flags with descriptions and argument types
- Generators: Dynamic suggestion providers that run shell commands
- Args: Positional arguments with templates (filepaths, folders) or custom generators
Package Managers
npmnpm.ts:1-1608: Includes package search via npms.io API, workspace support, and script running with custom generators for installed dependencies.
yarnyarn.ts:1-1674: Features workspace management, script parser directives for aliasing, and dynamic spec generation for node CLI tools.
pnpmpnpm.ts:1-1027: Supports monorepo filtering, recursive operations, and workspace-aware package management.
brewbrew.ts:1-1675: Comprehensive Homebrew support with formulae/cask generators, service management, and tap operations.
aptapt.ts:1-359: Debian package management with generators for installed, upgradable, and available packages.
npxnpx.ts:1-317: Curated suggestions for popular create-* CLIs and project scaffolding tools.
File Operations
cpcp.ts:1-79: Copy with symlink handling options (-H, -L, -P) and recursive mode.
mvmv.ts:1-40: Move/rename with interactive and force modes.
catcat.ts:1-50: File concatenation with line numbering and special character display options.
chmodchmod.ts:1-88: Permission changes with common mode suggestions (744, u+x, 777).
chownchown.ts:1-117: Ownership changes with dynamic user/group generators using dscl on macOS.
Text Viewing & Editing
lessless.ts:1-676: Comprehensive pager options including search, color, and navigation settings.
moremore.ts:1-55: Basic pager with display and formatting options.
headhead.ts:1-35: Display first N lines or bytes of files.
tailtail.ts:1-20: Display last part of files with follow mode (-f).
vimvim.ts:1-244: Editor modes, session management, and startup options.
nanonano.ts:1-9: Basic editor spec with filepath completion.
System Utilities
psps.ts:1-153: Process listing with selection by PID, user, TTY, and formatting options.
killkill.ts:1-63: Process termination with signal name generator and PID completion showing process names.
killallkillall.ts:1-153: Kill by process name with all POSIX signals and user filtering.
toptop.ts:1-49: Interactive process viewer with batch mode and PID monitoring.
dfdf.ts:1-65: Disk space reporting with human-readable output and block size options.
dudu.ts:1-93: Disk usage with depth control and size unit options.
pwdpwd.ts:1-16: Print working directory with logical vs physical path options.
unameuname.ts:1-36: System information display.
Network Tools
curlcurl.ts:1-914: Extensive HTTP client with request methods, headers, authentication, and proxy options.
wgetwget.ts:1-604: Network retriever with recursive download, authentication, and retry options.
sshssh.ts:1-447: Remote login with host generators from ~/.ssh/known_hosts and ~/.ssh/config.
scpscp.ts:1-241: Secure copy with shared SSH host generators.
Search & Find
grepgrep.ts:1-344: Pattern matching with regex modes, context options, and recursive search.
findfind.ts:1-71: File hierarchy traversal with symlink handling and depth control.
Runtime & Version Managers
nodenode.ts:1-505: Node.js interpreter with eval, watch mode, and inspector options.
pythonpython.ts:1-168: Python interpreter with module loading and optimization flags. Includes Django detection via generateSpec.
nvmnvm.ts:1-318: Node version management with LTS support and version switching.
4Register New Specs in Constants
1 file+37β2
constants.tsextensions/terminal-suggest/src
Read explanation
All new completion specs must be registered in the upstreamSpecs array to be loaded by the terminal suggest feature.
constants.ts:6-48
typescript
export const upstreamSpecs = [ 'ls', 'echo', 'mkdir', 'rm', 'rmdir', 'touch',+ 'pwd',+ 'brew',+ 'cp',+ 'mv',+ 'cat',+ 'less',+ 'more',+ 'head',+ 'tail',+ 'nano',+ 'vim',+ 'chmod',+ 'chown',+ 'uname',+ 'top',+ 'df',+ 'du',+ 'ps',+ 'kill',+ 'killall',+ 'curl',+ 'wget',+ 'ssh',+ 'scp',+ 'apt',+ 'grep',+ 'find',+ 'git',+ 'npm',+ 'yarn',+ 'python',+ 'pnpm',+ 'node',+ 'nvm',+ 'npx',];
The array is reordered to group related commands together (file ops, system utils, network tools, package managers, runtimes).
Merged
Add more fig specs
39 files
+12355β4
DescriptionDiscussion1Commits3
Devin's AI analysis
This PR adds intelligent autocompletion support for ~35 common CLI tools to VS Code's integrated terminal. When users type commands like npm install, git commit, or brew upgrade, they'll now see context-aware suggestions for subcommands, options, and arguments.
What Changed
New completion specifications for commands across several categories:
- Package managers:
npm,yarn,pnpm,brew,apt - File operations:
cp,mv,cat,less,chmod,chown - System utilities:
ps,kill,top,df,du,pwd - Network tools:
curl,wget,ssh,scp - Development tools:
node,python,nvm,npx - Text processing:
grep,find,vim,nano
Each spec defines the command's structure using the Fig format cat.ts:1-50. For example, the cat spec includes file path completion and options like -n for line numbering.
Type system updates allow generators to return undefined when they fail or have no results index.d.ts:1160, with corresponding runtime safety checks terminalSuggestMain.ts:263-265.
Registration of all new specs happens in the upstreamSpecs array constants.ts:6-48.
Fixes #239515
Adds most from above
Filter
No discussion yet
12,359 lines left
1Type System Updates for Generator Return Values
0 / 1
index.d.tsextensions/terminal-suggest/src/completions
+2β2
Mark as viewed
1
/* eslint-disable @typescript-eslint/ban-types */
1
/* eslint-disable @typescript-eslint/ban-types */
2
declare namespace Fig {
2
declare namespace Fig {
5 linesAll 1109 lines5 lines
5 linesAll 1109 lines5 lines
1112
/**
1112
/**
1113
* The generator object is used to generate suggestions for an arg object. To do this, it runs a defined shell command on the user's device, gets the output, and returns a list of Suggestion objects.
1113
1114
*
1114
*
1115
*/
1115
*/
1116
interface Generator {
1116
interface Generator {
5 linesAll 40 lines5 lines
5 linesAll 40 lines5 lines
1157
*/
1157
*/
1158
script?:
1158
script?:
1159
| string[]
1159
| string[]
1160
| Function<string[], string[]>
1160
| Function<string[], string[] | undefined> // <-- VS Code edit to make results correct
1161
| ExecuteCommandInput
1161
| ExecuteCommandInput
1162
| Function<string[], ExecuteCommandInput>;
1162
| Function<string[], ExecuteCommandInput>;
All 5 lines
All 5 lines
1168
/**
1168
/**
1169
*
1169
*
1170
* Process the string output from the `script` prop and return a list of suggestions
1170
* Process the string output from the `script` prop and return a list of suggestions
1171
*
1171
*
1172
* @param out - The output of the script that was executed on the user's device
1172
* @param out - The output of the script that was executed on the user's device
1173
* @param tokens - a tokenized array of what the user has typed
1173
* @param tokens - a tokenized array of what the user has typed
1174
* @returns An array of `Suggestion` objects.
1174
* @returns An array of `Suggestion` objects.
1175
*
1175
*
1176
*/
1176
*/
1177
postProcess?: (out: string, tokens: string[]) => (Suggestion | null)[]; // <-- VS Code edit to make results correct
1177
postProcess?: (out: string, tokens: string[]) => (Suggestion | null)[] | undefined; // <-- VS Code edit to make results correct
5 linesAll 121 lines5 lines
5 linesAll 121 lines5 lines
1299
}
1299
}
1300
}
1300
}
2Runtime Safety for Undefined Generator Results
0 / 1
terminalSuggestMain.tsextensions/terminal-suggest/src
+3
Mark as viewed
5 linesAll 233 lines5 lines
5 linesAll 233 lines5 lines
234
export async function collectCompletionItemResult(command: Command, parsedArguments: ArgumentParserResult, prefix: string, terminalContext: any, items: vscode.TerminalCompletionItem[]): Promise<{ filesRequested: boolean; foldersRequested: boolean } | undefined> {
234
235
let filesRequested = false;
235
let filesRequested = false;
236
let foldersRequested = false;
236
let foldersRequested = false;
237
237
238
const addSuggestions = async (specArgs: SpecArg[] | Record<string, SpecArg> | undefined, kind: vscode.TerminalCompletionItemKind, parsedArguments?: ArgumentParserResult) => {
238
239
if (kind === vscode.TerminalCompletionItemKind.Argument && parsedArguments?.currentArg?.generators) {
239
if (kind === vscode.TerminalCompletionItemKind.Argument && parsedArguments?.currentArg?.generators) {
240
const generators = parsedArguments.currentArg.generators;
240
const generators = parsedArguments.currentArg.generators;
241
for (const generator of generators) {
241
for (const generator of generators) {
242
if (generator.template) {
242
if (generator.template) {
All 8 lines
All 8 lines
251
} else {
251
} else {
1
InvestigateR252-285
1
InvestigateR252-261
252
if (generator.script && Array.isArray(generator.script) && generator.postProcess) {
252
if (generator.script && Array.isArray(generator.script) && generator.postProcess) {
All 6 lines
All 6 lines
259
if (!output) {
259
if (!output) {
260
continue;
260
continue;
261
}
261
}
262
const generatedItems = generator.postProcess(output, command.tokens.map(e => e.text));
262
const generatedItems = generator.postProcess(output, command.tokens.map(e => e.text));
263
if (!generatedItems) {
264
continue;
265
}
263
for (const generatedItem of generatedItems) {
266
for (const generatedItem of generatedItems) {
5 linesAll 17 lines5 lines
5 linesAll 17 lines5 lines
281
}
284
}
282
}
285
}
283
}
286
}
284
}
287
}
285
}
288
}
5 linesAll 37 lines5 lines
5 linesAll 37 lines5 lines
323
};
326
};
5 linesAll 12 lines5 lines
5 linesAll 12 lines5 lines
336
}
339
}
5 linesAll 134 lines5 lines
5 linesAll 134 lines5 lines
3New Completion Specifications
0 / 34
apt.tsextensions/terminal-suggest/src/completions/upstream
+359
AddedMark as viewed
1
// import { filepaths } from "@fig/autocomplete-generators";
2
3
const packages: Fig.Generator = {
4
// only trigger when the token length transitions to or from 0
5
trigger: (current, previous) =>
6
current.length === 0 || (previous.length === 0 && current.length > 0),
7
8
// have to use `custom` to skip running the script when length is 0
9
custom: async (tokens, executeShellCommand) => {
10
const finalToken = tokens[tokens.length - 1];
11
if (finalToken.length === 0) {
12
return [];
13
}
14
const { stdout } = await executeShellCommand({
15
command: "apt",
16
// eslint-disable-next-line @withfig/fig-linter/no-useless-arrays
17
args: ["list"],
18
});
19
20
// Only lines matching the first character, delete characters after '/'
21
return stdout
22
.trim()
23
.split("\n")
24
.filter((name) => name.startsWith(finalToken))
25
.map((name) => name.replace(/\/.*/, ""))
26
.map((name) => ({
27
name,
28
description: "Package",
29
icon: "π¦",
30
// make the suggestions... actually show up
31
// see https://github.com/withfig/autocomplete/pull/1429#discussion_r950688126
32
priority: 50,
33
}));
34
},
35
};
36
37
const installedPackages: Fig.Generator = {
38
script: ["apt", "list", "--installed"],
1
Potential BugR39-66
39
postProcess: function (a) {
40
return a
41
.trim()
42
.split("\n")
43
.map((b) => {
44
return {
45
name: b.substring(0, b.indexOf("/")),
46
description: "Package",
47
icon: "π¦",
48
};
49
});
50
},
51
};
52
53
const upgradablePackages: Fig.Generator = {
54
script: ["apt", "list", "--upgradable"],
55
postProcess: function (a) {
56
return a
57
.trim()
58
.split("\n")
59
.map((b) => {
60
return {
61
name: b.substring(0, b.indexOf("/")),
62
description: "Package",
63
icon: "π¦",
64
};
65
});
66
},
67
};
68
69
const yesNoOptions: Fig.Option[] = [
70 {
71 name: "-y",
72 description: "Assume yes to all prompts",
73 exclusiveOn: ["--assume-no"],
74 },
75 {
76 name: "--assume-no",
77 description: "Assume no to all prompts",
78 exclusiveOn: ["-y"],
79 },
80];
81
82
const installationOptions: Fig.Option[] = [
83 {
84 name: ["-d", "--download-only"],
85 description:
86 "For any operation that would download packages, download them, but do nothing else",
87 },
88 {
89 name: "--no-download",
90 description:
91 "Do not download packages, attempt to use already downloaded packages",
92 },
93];
94
95
const simulate: Fig.Option[] = [
96 {
97 name: ["-s", "--simulate"],
98 description:
99 "Simulate running this command and show it's output, without actually changing anything",
100 },
101];
102
103
const completionSpec: Fig.Spec = {
104
name: "apt",
105
description: "Package manager for Debian-based Linux distributions",
106
subcommands: [
107 {
108 name: "update",
109 description: "Update the package database",
110 options: [...yesNoOptions],
111 },
112 {
113 name: "upgrade",
114 description: "Install all available upgrades",
115 args: {
116 name: "package",
117 description: "Package(s) to upgrade",
118 isVariadic: true,
119 isOptional: true,
120 generators: upgradablePackages,
121 },
122 options: [...installationOptions, ...yesNoOptions, ...simulate],
123 },
124 {
125 name: "full-upgrade",
126 description:
127 "Install available upgrades, removing currently installed packages if needed to upgrade the system as a whole",
128 options: [...installationOptions, ...yesNoOptions, ...simulate],
129 },
130 {
131 name: "install",
132 description: "Install package(s)",
133 args: {
134 name: "package",
135 description: "The package you want to install",
136 isVariadic: true,
137 template: 'filepaths',
138 generators: [
139 packages,
140 // filepaths({ extensions: ["deb"] })
141 ],
142 },
143 options: [
144 ...installationOptions,
145 ...yesNoOptions,
146 ...simulate,
147 {
148 name: "--reinstall",
149 description: "Reinstall the package if it is already installed",
150 },
151 {
152 name: ["-f", "--fix-broken"],
153 description: "Attempt to fix broken packages",
154 },
155 ],
156 },
157 {
158 name: "reinstall",
159 description: "Reinstall package(s)",
160 args: {
161 name: "package",
162 description: "The package you want to reinstall",
163 isVariadic: true,
164 generators: installedPackages,
165 },
166 options: [...yesNoOptions, ...simulate],
167 },
168 {
169 name: "remove",
170 description: "Remove package(s)",
171 args: {
172 name: "package",
173 description: "The package you want to remove",
174 isVariadic: true,
175 generators: installedPackages,
176 },
177 options: [
178 ...yesNoOptions,
179 ...simulate,
180 {
181 name: ["-f", "--fix-broken"],
182 description: "Attempt to fix broken packages",
183 },
184 ],
185 },
186 {
187 name: "purge",
188 description: "Remove package(s) and their configuration files",
189 args: {
190 name: "package",
191 description: "The package you want to purge",
192 isVariadic: true,
193 generators: installedPackages,
194 },
195 options: [...yesNoOptions, ...simulate],
196 },
197 {
198 name: ["autoremove", "auto-remove"],
199 description: "Remove unused packages",
200 options: [...yesNoOptions, ...simulate],
201 },
202 {
203 name: "list",
204 description: "List packages",
205 options: [
206 {
207 name: "--installed",
208 description: "List installed packages",
209 },
210 {
211 name: "--upgradable",
212 description: "List upgradable packages",
213 },
214 ],
215 },
216 {
217 name: "search",
218 description: "Search for packages",
219 args: {
220 name: "query",
221 description: "The query to search for",
222 },
223 options: [...yesNoOptions],
224 },
225 {
226 name: "show",
227 description: "Show package details",
228 args: {
229 name: "package",
230 description: "The package you want to show",
231 generators: packages,
232 },
233 },
234 {
235 name: "satisfy",
236 description: "Satisfy package dependencies",
237 args: {
238 name: "package",
239 description: "The package you want to satisfy",
240 isVariadic: true,
241 generators: packages,
242 },
243 options: [...installationOptions, ...yesNoOptions, ...simulate],
244 },
245 {
246 name: "clean",
247 description: "Remove downloaded package files",
248 options: [...yesNoOptions, ...simulate],
249 },
250 {
251 name: "edit-sources",
252 description: "Edit the list of package sources",
253 options: [...yesNoOptions],
254 },
255 {
256 // docs for this weren't the greatest, some descriptions might be slightly (or very) wrong.
257 name: "source",
258 description: "Fetch package source files",
259 args: {
260 name: "package",
261 description: "The package you want to get source files for",
262 isVariadic: true,
263 generators: packages,
264 },
265 options: [
266 ...installationOptions,
267 ...yesNoOptions,
268 ...simulate,
269 {
270 name: "--compile",
271 description:
272 "Compile the package to a binary using dpkg-buildpackage",
273 },
274 {
275 name: "--only-source",
276 // no idea how this works
277 },
278 {
279 name: "--host-architecture",
280 description: "The architecture to build for",
281 args: {
282 name: "architecture",
283 description: "The architecture to build for",
284 },
285 },
286 ],
287 },
288 {
289 // I don't understand this either
290 name: "build-dep",
291 description:
292 "Install/remove packages in an attempt to satisfy the build dependencies for a source package",
293 args: {
294 name: "package",
295 description: "The package you want to build dependencies for",
296 generators: packages,
297 },
298 options: [
299 ...installationOptions,
300 ...yesNoOptions,
301 ...simulate,
302 {
303 name: "--host-architecture",
304 description: "The architecture to build for",
305 args: {
306 name: "architecture",
307 description: "The architecture to build for",
308 },
309 },
310 {
311 name: "--only-source",
312 },
313 ],
314 },
315 {
316 name: "download",
317 description: "Download package binary into the current directory",
318 args: {
319 name: "package",
320 description: "The package you want to download",
321 generators: packages,
322 },
323 options: [...installationOptions, ...yesNoOptions],
324 },
325 {
326 name: ["autoclean", "auto-clean"],
327 description:
328 "Like clean, but only removes package files that can no longer be downloaded",
329 options: [...installationOptions, ...yesNoOptions, ...simulate],
330 },
331 {
332 name: "changelog",
333 description: "Show the changelog for a package",
334 args: {
335 name: "package",
336 description: "The package you want to show the changelog for",
337 generators: packages,
338 isVariadic: true,
339 },
340 options: [...installationOptions, ...yesNoOptions],
341 },
342 ],
343
options: [
344 {
345 name: ["-h", "--help"],
346 description: "Print help message and exit",
347 isPersistent: true,
348 priority: 40,
349 },
350 {
351 name: ["-v", "--version"],
352 description: "Print version information and exit",
353 isPersistent: true,
354 priority: 40,
355 },
356 ],
357
};
358
359
export default completionSpec;
brew.tsextensions/terminal-suggest/src/completions/upstream
+1675
AddedMark as viewed
1
const servicesGenerator = (action: string): Fig.Generator => ({
2
script: ["bash", "-c", "brew services list | sed -e 's/ .*//' | tail -n +2"],
3
postProcess: function (out) {
4
return out
5
.split("\n")
6
.filter((line) => !line.includes("unbound"))
7
.map((line) => ({
8
name: line,
9
icon: "fig://icon?type=package",
10
description: `${action} ${line}`,
11
}));
12
},
13
});
14
15
const repositoriesGenerator = (): Fig.Generator => ({
16
script: ["brew", "tap"],
17
postProcess: (out) => {
18
return out.split("\n").map((line) => ({ name: line }));
19
},
20
});
21
22
const formulaeGenerator: Fig.Generator = {
23
script: ["brew", "list", "-1"],
24
postProcess: function (out) {
25
return out
26
.split("\n")
27
.filter((line) => !line.includes("="))
28
.map((formula) => ({
29
name: formula,
30
icon: "πΊ",
31
description: "Installed formula",
32
}));
33
},
34
};
35
36
const outdatedformulaeGenerator: Fig.Generator = {
37
script: ["brew", "outdated", "-q"],
38
postProcess: function (out) {
39
return out.split("\n").map((formula) => ({
40
name: formula,
41
icon: "πΊ",
42
description: "Outdated formula",
43
}));
44
},
45
};
46
47
const generateAllFormulae: Fig.Generator = {
48
script: ["brew", "formulae"],
49
postProcess: function (out) {
50
return out.split("\n").map((formula) => ({
51
name: formula,
52
icon: "πΊ",
53
description: "Formula",
54
priority: 51,
55
}));
56
},
57
};
58
59
const generateAllCasks: Fig.Generator = {
60
script: ["brew", "casks"],
61
postProcess: function (out) {
62
return out.split("\n").map((cask) => ({
63
name: cask,
64
icon: "πΊ",
65
description: "Cask",
66
priority: 52,
67
}));
68
},
69
};
70
const generateAliases: Fig.Generator = {
71
script: [
72 "bash",
73 "-c",
74 'find ~/.brew-aliases/ -type f ! -name "*.*" -d 1 | sed "s/.*\\///"',
75 ],
76
postProcess: function (out) {
77
return out
78
.split("\n")
79
.filter((line) => line && line.trim() !== "")
80
.map((line) => ({
81
name: line,
82
icon: "fig://icon?type=command",
83
description: `Execute alias ${line}`,
84
}));
85
},
86
};
87
88
const commonOptions: Fig.Option[] = [
89 {
90 name: ["-d", "--debug"],
91 description: "Display any debugging information",
92 },
93 {
94 name: ["-q", "--quiet"],
95 description: "Make some output more quiet",
96 },
97 {
98 name: ["-v", "--verbose"],
99 description: "Make some output more verbose",
100 },
101 { name: ["-h", "--help"], description: "Show help message" },
102];
103
104
const completionSpec: Fig.Spec = {
105
name: "brew",
106
description: "Package manager for macOS",
107
subcommands: [
108 {
109 name: "list",
110 description: "List all installed formulae",
111 options: [
112 ...commonOptions,
113 {
114 name: ["--formula", "--formulae"],
115 description:
116 "List only formulae, or treat all named arguments as formulae",
117 },
118 {
119 name: ["--cask", "--casks"],
120 description: "List only casks, or treat all named arguments as casks",
121 },
122 {
123 name: "--unbrewed",
124 description:
125 "List files in Homebrew's prefix not installed by Homebrew. (disabled; replaced by brew --prefix --unbrewed)",
126 },
127 {
128 name: "--full-name",
129 description:
130 "Print formulae with fully-qualified names. Unless --full-name, --versions or",
131 },
132 {
1
Potential BugR133-150
133 name: "--pinned",
134 description:
135 "List only pinned formulae, or only the specified (pinned) formulae if formula are provided",
136 },
137 {
138 name: "--versions",
139 description:
140 "Show the version number for installed formulae, or only the specified formulae if formula are provided",
141 },
142 {
143 name: "--multiple",
144 description: "Only show formulae with multiple versions installed",
145 },
146 {
147 name: "--pinned",
148 description:
149 "List only pinned formulae, or only the specified (pinned) formulae if formula are provided. See also pin, unpin",
150 },
151 {
152 name: "-1",
153 description:
154 "Force output to be one entry per line. This is the default when output is not to a terminal",
155 },
156 {
157 name: "-l",
158 description:
159 "List formulae and/or casks in long format. Has no effect when a formula or cask name is passed as an argument",
160 },
161 {
162 name: "-r",
163 description:
164 "Reverse the order of the formulae and/or casks sort to list the oldest entries first. Has no effect when a formula or cask name is passed as an argument",
165 },
166 {
167 name: "-t",
168 description:
169 "Sort formulae and/or casks by time modified, listing most recently modified first. Has no effect when a formula or cask name is passed as an argument",
170 },
171 ],
172 args: {
173 isOptional: true,
174 isVariadic: true,
175 name: "formula",
176 generators: formulaeGenerator,
177 },
178 },
179 {
180 name: "ls",
181 description: "List all installed formulae",
182 options: [
183 ...commonOptions,
184 {
185 name: "--formula",
186 description:
187 "List only formulae, or treat all named arguments as formulae",
188 },
189 {
190 name: "--cask",
191 description: "List only casks, or treat all named arguments as casks",
192 },
193 {
194 name: "--unbrewed",
195 description:
196 "List files in Homebrew's prefix not installed by Homebrew. (disabled; replaced by brew --prefix --unbrewed)",
197 },
198 {
199 name: "--full-name",
200 description:
201 "Print formulae with fully-qualified names. Unless --full-name, --versions or",
202 },
203 {
204 name: "--pinned",
205 description:
206 "List only pinned formulae, or only the specified (pinned) formulae if formula are provided",
207 },
208 {
209 name: "--versions",
210 description:
211 "Show the version number for installed formulae, or only the specified formulae if formula are provided",
212 },
213 {
214 name: "--multiple",
215 description: "Only show formulae with multiple versions installed",
216 },
217 {
218 name: "--pinned",
219 description:
220 "List only pinned formulae, or only the specified (pinned) formulae if formula are provided",
221 },
222 {
223 name: "-1",
224 description:
225 "Force output to be one entry per line. This is the default when output is not to a terminal",
226 },
227 {
228 name: "-l",
229 description:
230 "List formulae and/or casks in long format. Has no effect when a formula or cask name is passed as an argument",
231 },
232 {
233 name: "-r",
234 description:
235 "Reverse the order of the formulae and/or casks sort to list the oldest entries first. Has no effect when a formula or cask name is passed as an argument",
236 },
237 {
238 name: "-t",
239 description:
240 "Sort formulae and/or casks by time modified, listing most recently modified first. Has no effect when a formula or cask name is passed as an argument",
241 },
242 ],
243 args: {
244 isOptional: true,
245 isVariadic: true,
246 name: "formula",
247 generators: formulaeGenerator,
248 },
249 },
250 {
251 name: "leaves",
252 description:
253 "List installed formulae that are not dependencies of another installed formula",
254 options: [
255 {
256 name: ["-r", "--installed-on-request"],
257 description: "Show manually installed formula",
258 },
259 {
260 name: ["-p", "--installed-as-dependency"],
261 description: "Show installed formula as dependencies",
262 },
263 ],
264 },
265 {
266 name: "doctor",
267 description: "Check your system for potential problems",
268 options: [
269 ...commonOptions,
270 {
271 name: "--list-checks",
272 description: "List all audit methods",
273 },
274 {
275 name: ["-D", "--audit-debug"],
276 description: "Enable debugging and profiling of audit methods",
277 },
278 ],
279 },
280 {
281 name: ["abv", "info"],
282 description: "Display brief statistics for your Homebrew installation",
283 args: {
284 isVariadic: true,
285 isOptional: true,
286 name: "formula",
287 description: "Formula or cask to summarize",
288 generators: [generateAllFormulae, generateAllCasks],
289 },
290 options: [
291 {
292 name: ["--cask", "--casks"],
293 description: "List only casks, or treat all named arguments as casks",
294 },
295 {
296 name: "--analytics",
297 description:
298 "List global Homebrew analytics data or, if specified, installation and build error data for formula",
299 },
300 {
301 name: "--days",
302 description: "How many days of analytics data to retrieve",
303 exclusiveOn: ["--analytics"],
304 args: {
305 name: "days",
306 description: "Number of days of data to retrieve",
307 suggestions: ["30", "90", "365"],
308 },
309 },
310 {
311 name: "--category",
312 description: "Which type of analytics data to retrieve",
313 exclusiveOn: ["--analytics"],
314 args: {
315 generators: {
316 custom: async (ctx) => {
317 // if anything provided after the subcommand does not begin with '-'
318 // then a formula has been provided and we should provide info on it
319 if (
320 ctx.slice(2, ctx.length - 1).some((token) => token[0] !== "-")
321 ) {
322 return ["install", "install-on-request", "build-error"].map(
323 (sugg) => ({
324 name: sugg,
325 })
326 );
327 }
328
329 // if no formulas are specified, then we should provide system info
330 return ["cask-install", "os-version"].map((sugg) => ({
331 name: sugg,
332 }));
333 },
334 },
335 },
336 },
337 {
338 name: "--github",
339 description: "Open the GitHub source page for formula in a browser",
340 },
341 {
342 name: "--json",
343 description: "Print a JSON representation",
344 },
345 {
346 name: "--installed",
347 exclusiveOn: ["--json"],
348 description: "Print JSON of formulae that are currently installed",
349 },
350 {
351 name: "--all",
352 exclusiveOn: ["--json"],
353 description: "Print JSON of all available formulae",
354 },
355 {
356 name: ["-v", "--verbose"],
357 description: "Show more verbose analytics data for formulae",
358 },
359 {
1
Potential BugR360-366
360 name: "--formula",
361 description: "Treat all named arguments as formulae",
362 },
363 {
364 name: "--cash",
365 description: "Treat all named arguments as casks",
366 },
367 {
368 name: ["-d", "--debug"],
369 description: "Display any debugging information",
370 },
371 {
372 name: ["-q", "--quiet"],
373 description: "List only the names of outdated kegs",
374 },
375 {
376 name: ["-h", "--help"],
377 description: "Get help with services command",
378 },
379 ],
380 },
381 {
382 name: "update",
383 description: "Fetch the newest version of Homebrew and all formulae",
384 options: [
385 {
386 name: ["-f", "--force"],
387 description: "Always do a slower, full update check",
388 },
389 {
390 name: ["-v", "--verbose"],
391 description:
392 "Print the directories checked and git operations performed",
393 },
394 {
395 name: ["-d", "--debug"],
396 description:
397 "Display a trace of all shell commands as they are executed",
398 },
399 { name: ["-h", "--help"], description: "Show help message" },
400 {
401 name: "--merge",
402 description:
403 "Use git merge to apply updates (rather than git rebase)",
404 },
405 {
406 name: "--preinstall",
407 description:
408 "Run on auto-updates (e.g. before brew install). Skips some slower steps",
409 },
410 ],
411 },
412 {
413 name: "outdated",
414 description:
415 "List installed casks and formulae that have an updated version available",
416 options: [
417 {
418 name: ["-d", "--debug"],
419 description: "Display any debugging information",
420 },
421 {
422 name: ["-q", "--quiet"],
423 description: "List only the names of outdated kegs",
424 },
425 {
426 name: ["-v", "--verbose"],
427 description: "Include detailed version information",
428 },
429 {
430 name: ["-h", "--help"],
431 description: "Show help message for the outdated command",
432 },
433 { name: "--cask", description: "List only outdated casks" },
434 {
435 name: "--fetch-HEAD",
436 description:
437 "Fetch the upstream repository to detect if the HEAD installation of the formula is outdated",
438 },
439 { name: "--formula", description: "List only outdated formulae" },
440 {
441 name: "--greedy",
442 description:
443 "Print outdated casks with auto_updates or version :latest",
444 },
445 {
446 name: "--greedy-latest",
447 description:
448 "Print outdated casks including those with version :latest",
449 },
450 {
451 name: "--greedy-auto-updates",
452 description:
453 "Print outdated casks including those with auto_updates true",
454 },
455 { name: "--json", description: "Print output in JSON format" },
456 ],
457 },
458 {
459 name: "pin",
460 description: "Pin formula, preventing them from being upgraded",
461 options: commonOptions,
462 args: {
463 isVariadic: true,
464 name: "formula",
465 generators: formulaeGenerator,
466 },
467 },
468 {
469 name: "unpin",
470 description: "Unpin formula, allowing them to be upgraded",
471 options: commonOptions,
472 args: {
473 isVariadic: true,
474 name: "formula",
475 generators: formulaeGenerator,
476 },
477 },
478 {
479 name: "upgrade",
480 description:
481 "Upgrade outdated casks and outdated, unpinned formulae using the same options they were originally installed with, plus any appended brew formula options",
482 options: [
483 {
484 name: ["-d", "--debug"],
485 description:
486 "If brewing fails, open an interactive debugging session with access to IRB or a shell inside the temporary build directory",
487 },
488 {
489 name: ["-f", "--force"],
490 description:
491 "Install formulae without checking for previously installed keg-only or non-migrated versions. When installing casks, overwrite existing files (binaries and symlinks are excluded, unless originally from the same cask)",
492 },
493 {
494 name: ["-v", "--verbose"],
495 description: "Print the verification and postinstall steps",
496 },
497 {
498 name: ["-n", "--dry-run"],
499 description:
500 "Show what would be upgraded, but do not actually upgrade anything",
501 },
502 {
503 name: ["-s", "--build-from-source"],
504 description:
505 "Compile formula from source even if a bottle is provided. Dependencies will still be installed from bottles if they are available",
506 },
507 {
508 name: ["-i", "--interactive"],
509 description: "Download and patch formula, then open a shell",
510 },
511 { name: ["-g", "--git"], description: "Create a Git repository" },
512 {
513 name: ["-q", "--quiet"],
514 description: "Make some output more quiet",
515 },
516 { name: ["-h", "--help"], description: "Show this message" },
517 {
518 name: ["--formula", "--formulae"],
519 description:
520 "Treat all named arguments as formulae. If no named arguments are specified, upgrade only outdated formulae",
521 },
522 {
523 name: "--env",
524 description: "Disabled other than for internal Homebrew use",
525 },
526 {
527 name: "--ignore-dependencies",
528 description:
529 "An unsupported Homebrew development flag to skip installing any dependencies of any kind. If the dependencies are not already present, the formula will have issues. If you're not developing Homebrew, consider adjusting your PATH rather than using this flag",
530 },
531 {
532 name: "--only-dependencies",
533 description:
534 "Install the dependencies with specified options but do not install the formula itself",
535 },
536 {
537 name: "--cc",
538 description:
539 "Attempt to compile using the specified compiler, which should be the name of the compiler's executable",
540 args: {
541 name: "compiler",
542 suggestions: ["gcc-7", "llvm_clang", "clang"],
543 },
544 },
545 {
546 name: "--force-bottle",
547 description:
548 "Install from a bottle if it exists for the current or newest version of macOS, even if it would not normally be used for installation",
549 },
550 {
551 name: "--include-test",
552 description:
553 "Install testing dependencies required to run brew test formula",
554 },
555 {
556 name: "--HEAD",
557 description:
558 "If formula defines it, install the HEAD version, aka. main, trunk, unstable, master",
559 },
560 {
561 name: "--fetch-HEAD",
562 description:
563 "Fetch the upstream repository to detect if the HEAD installation of the formula is outdated. Otherwise, the repository's HEAD will only be checked for updates when a new stable or development version has been released",
564 },
565 {
566 name: "--ignore-pinned",
567 description:
568 "Set a successful exit status even if pinned formulae are not upgraded",
569 },
570 {
571 name: "--keep-tmp",
572 description: "Retain the temporary files created during installation",
573 },
574 {
575 name: "--build-bottle",
576 description:
577 "Prepare the formula for eventual bottling during installation, skipping any post-install steps",
578 },
579 {
580 name: "--bottle-arch",
581 description:
582 "Optimise bottles for the specified architecture rather than the oldest architecture supported by the version of macOS the bottles are built on",
583 },
584 {
585 name: "--display-times",
586 description:
587 "Print install times for each formula at the end of the run",
588 },
589 {
590 name: ["--cask", "--casks"],
591 description:
592 "Treat all named arguments as casks. If no named arguments are specified, upgrade only outdated casks",
593 },
594 {
595 name: "--binaries",
596 description:
597 "Disable/enable linking of helper executables (default: enabled)",
598 exclusiveOn: ["--no-binaries"],
599 },
600 {
601 name: "--no-binaries",
602 description:
603 "Disable/enable linking of helper executables (default: enabled)",
604 exclusiveOn: ["--binaries"],
605 },
606 {
607 name: "--require-sha",
608 description: "Require all casks to have a checksum",
609 },
610 {
611 name: "--quarantine",
612 description:
613 "Disable/enable quarantining of downloads (default: enabled)",
614 exclusiveOn: ["--no-quarantine"],
615 },
616 {
617 name: "--no-quarantine",
618 description:
619 "Disable/enable quarantining of downloads (default: enabled)",
620 exclusiveOn: ["--quarantine"],
621 },
622 {
623 name: "--skip-cask-deps",
624 description: "Skip installing cask dependencies",
625 },
626 {
627 name: "--greedy",
628 description:
629 "Also include casks with auto_updates true or version :latest",
630 exclusiveOn: ["--greedy-latest", "--greedy-auto-updates"],
631 },
632 {
633 name: "--greedy-latest",
634 description: "Also include casks with version :latest",
635 },
636 {
637 name: "--greedy-auto-updates",
638 description: "Also include casks with auto_updates true",
639 },
640 {
641 name: "--appdir",
642 description:
643 "Target location for Applications (default: /Applications)",
644 args: {
645 name: "location",
646 template: "folders",
647 },
648 },
649 {
650 name: "--colorpickerdir",
651 description:
652 "Target location for Color Pickers (default: ~/Library/ColorPickers)",
653 args: {
654 name: "location",
655 template: "folders",
656 },
657 },
658 {
659 name: "--prefpanedir",
660 description:
661 "Target location for Preference Panes (default: ~/Library/PreferencePanes)",
662 args: {
663 name: "location",
664 template: "folders",
665 },
666 },
667 {
668 name: "--qlplugindir",
669 description:
670 "Target location for QuickLook Plugins (default: ~/Library/QuickLook)",
671 args: {
672 name: "location",
673 template: "folders",
674 },
675 },
676 {
677 name: "--mdimporterdir",
678 description:
679 "Target location for Spotlight Plugins (default: ~/Library/Spotlight)",
680 args: {
681 name: "location",
682 template: "folders",
683 },
684 },
685 {
686 name: "--dictionarydir",
687 description:
688 "Target location for Dictionaries (default: ~/Library/Dictionaries)",
689 args: {
690 name: "location",
691 template: "folders",
692 },
693 },
694 {
695 name: "--fontdir",
696 description: "Target location for Fonts (default: ~/Library/Fonts)",
697 args: {
698 name: "location",
699 template: "folders",
700 },
701 },
702 {
703 name: "--servicedir",
704 description:
705 "Target location for Services (default: ~/Library/Services)",
706 args: {
707 name: "location",
708 template: "folders",
709 },
710 },
711 {
712 name: "--input-methoddir",
713 description:
714 "Target location for Input Methods (default: ~/Library/Input Methods)",
715 args: {
716 name: "location",
717 template: "folders",
718 },
719 },
720 {
721 name: "--internet-plugindir",
722 description:
723 "Target location for Internet Plugins (default: ~/Library/Internet Plug-Ins)",
724 args: {
725 name: "location",
726 template: "folders",
727 },
728 },
729 {
730 name: "--audio-unit-plugindir",
731 description:
732 "Target location for Audio Unit Plugins (default: ~/Library/Audio/Plug-Ins/Components)",
733 args: {
734 name: "location",
735 template: "folders",
736 },
737 },
738 {
739 name: "--vst-plugindir",
740 description:
741 "Target location for VST Plugins (default: ~/Library/Audio/Plug-Ins/VST)",
742 args: {
743 name: "location",
744 template: "folders",
745 },
746 },
747 {
748 name: "--vst3-plugindir",
749 description:
750 "Target location for VST3 Plugins (default: ~/Library/Audio/Plug-Ins/VST3)",
751 args: {
752 name: "location",
753 template: "folders",
754 },
755 },
756 {
757 name: "--screen-saverdir",
758 description:
759 "Target location for Screen Savers (default: ~/Library/Screen Savers)",
760 args: {
761 name: "location",
762 template: "folders",
763 },
764 },
765 {
766 name: "--language",
767 description:
768 "Comma-separated list of language codes to prefer for cask installation. The first matching language is used, otherwise it reverts to the cask's default language. The default value is the language of your system",
769 },
770 ],
771 args: {
772 isVariadic: true,
773 isOptional: true,
774 name: "outdated_formula|outdated_cask",
775 generators: outdatedformulaeGenerator,
776 },
777 },
778 {
779 name: "search",
780 description:
781 "Perform a substring search of cask tokens and formula names",
782 options: [
783 ...commonOptions,
784 {
785 name: "--formula",
786 description: "Search online and locally for formulae",
787 },
788 {
789 name: "--cask",
790 description: "Search online and locally for casks",
791 },
792 {
793 name: "--desc",
794 description:
795 "Search for formulae with a description matching text and casks with a name matching text",
796 },
797 {
798 name: "--pull-request",
799 description: "Search for GitHub pull requests containing text",
800 },
801 {
802 name: "--open",
803 description: "Search for only open GitHub pull requests",
804 },
805 {
806 name: "--closed",
807 description: "Search for only closed GitHub pull requests",
808 },
809 {
810 name: ["--repology", "--macports"],
811 description: "Search for text in the given database",
812 },
813 {
814 name: ["--fink", "--opensuse"],
815 description: "Search for text in the given database",
816 },
817 {
818 name: ["--fedora", "--debian"],
819 description: "Search for text in the given database",
820 },
821 {
822 name: "--ubuntu",
823 description: "Search for text in the given database",
824 },
825 ],
826 },
827 {
828 name: "config",
829 description: "Show Homebrew and system configuration info",
830 },
831 {
832 name: "postinstall",
833 description: "Rerun the post install step for formula",
834 options: [
835 {
836 name: ["-d", "--debug"],
837 description: "Display any debugging information",
838 },
839 {
840 name: ["-v", "--verbose"],
841 description: "Make some output more verbose",
842 },
843 {
844 name: ["-q", "--quiet"],
845 description: "Make some output more quiet",
846 },
847 { name: ["-h", "--help"], description: "Show this message" },
848 ],
849 args: {
850 isVariadic: true,
851 name: "formula",
852 generators: formulaeGenerator,
853 },
854 },
855 {
856 name: "install",
857 description: "Install <formula>",
858 options: [
859 {
860 name: ["-f", "--force"],
861 description:
862 "Install formulae without checking for previously installed keg-only or non-migrated versions. When installing casks",
863 },
864 {
865 name: ["-v", "--verbose"],
866 description: "Print the verification and postinstall steps",
867 },
868 {
869 name: ["-s", "--build-from-source"],
870 description:
871 "Compile formula from source even if a bottle is provided. Dependencies will still be installed from bottles if they are available",
872 },
873 {
874 name: ["-i", "--interactive"],
875 description: "Download and patch formula",
876 },
877 { name: ["-g", "--git"], description: "Create a Git repository" },
878 {
879 name: ["-q", "--quiet"],
880 description: "Make some output more quiet",
881 },
882 { name: ["-h", "--help"], description: "Show this message" },
883 {
884 name: "--formula",
885 description: "Treat all named arguments as formulae",
886 },
887 {
888 name: "--env",
889 description: "Disabled other than for internal Homebrew use",
890 },
891 {
892 name: "--ignore-dependencies",
893 description:
894 "An unsupported Homebrew development flag to skip installing any dependencies of any kind. If the dependencies are not already present, the formula will have issues. If you're not developing Homebrew, consider adjusting your PATH rather than using this flag",
895 },
896 {
897 name: "--only-dependencies",
898 description:
899 "Install the dependencies with specified options but do not install the formula itself",
900 },
901 {
902 name: "--cc",
903 description:
904 "Attempt to compile using the specified compiler, which should be the name of the compiler's executable",
905 args: {
906 name: "compiler",
907 suggestions: ["gcc-7", "llvm_clang", "clang"],
908 },
909 },
910 {
911 name: "--force-bottle",
912 description:
913 "Install from a bottle if it exists for the current or newest version of macOS, even if it would not normally be used for installation",
914 },
915 {
916 name: "--include-test",
917 description:
918 "Install testing dependencies required to run brew test formula",
919 },
920 {
921 name: "--HEAD",
922 description:
923 "If formula defines it, install the HEAD version, aka. main, trunk, unstable, master",
924 },
925 {
926 name: "--fetch-HEAD",
927 description:
928 "Fetch the upstream repository to detect if the HEAD installation of the formula is outdated. Otherwise, the repository's HEAD will only be checked for updates when a new stable or development version has been released",
929 },
930 {
931 name: "--keep-tmp",
932 description: "Retain the temporary files created during installation",
933 },
934 {
935 name: "--build-bottle",
936 description:
937 "Prepare the formula for eventual bottling during installation, skipping any post-install steps",
938 },
939 {
940 name: "--bottle-arch",
941 description:
942 "Optimise bottles for the specified architecture rather than the oldest architecture supported by the version of macOS the bottles are built on",
943 },
944 {
945 name: "--display-times",
946 description:
947 "Print install times for each formula at the end of the run",
948 },
949 {
950 name: "--cask",
951 description: "--casks Treat all named arguments as casks",
952 },
953 {
954 name: "--binaries",
955 description:
956 "Disable/enable linking of helper executables (default: enabled)",
957 },
958 {
959 name: "--no-binaries",
960 description:
961 "Disable/enable linking of helper executables (default: enabled)",
962 },
963 {
964 name: "--require-sha",
965 description: "Require all casks to have a checksum",
966 },
967 {
968 name: "--quarantine",
969 description:
970 "Disable/enable quarantining of downloads (default: enabled)",
971 },
972 {
973 name: "--no-quarantine",
974 description:
975 "Disable/enable quarantining of downloads (default: enabled)",
976 },
977 {
978 name: "--skip-cask-deps",
979 description: "Skip installing cask dependencies",
980 },
981 {
982 name: "--appdir",
983 description:
984 "Target location for Applications (default: /Applications)",
985 args: {
986 name: "location",
987 template: "folders",
988 },
989 },
990 {
991 name: "--colorpickerdir",
992 description:
993 "Target location for Color Pickers (default: ~/Library/ColorPickers)",
994 args: {
995 name: "location",
996 template: "folders",
997 },
998 },
999 {
1000 name: "--prefpanedir",
1001 description:
1002 "Target location for Preference Panes (default: ~/Library/PreferencePanes)",
1003 args: {
1004 name: "location",
1005 template: "folders",
1006 },
1007 },
1008 {
1009 name: "--qlplugindir",
1010 description:
1011 "Target location for QuickLook Plugins (default: ~/Library/QuickLook)",
1012 args: {
1013 name: "location",
1014 template: "folders",
1015 },
1016 },
1017 {
1018 name: "--mdimporterdir",
1019 description:
1020 "Target location for Spotlight Plugins (default: ~/Library/Spotlight)",
1021 args: {
1022 name: "location",
1023 template: "folders",
1024 },
1025 },
1026 {
1027 name: "--dictionarydir",
1028 description:
1029 "Target location for Dictionaries (default: ~/Library/Dictionaries)",
1030 args: {
1031 name: "location",
1032 template: "folders",
1033 },
1034 },
1035 {
1036 name: "--fontdir",
1037 description: "Target location for Fonts (default: ~/Library/Fonts)",
1038 args: {
1039 name: "location",
1040 template: "folders",
1041 },
1042 },
1043 {
1044 name: "--servicedir",
1045 description:
1046 "Target location for Services (default: ~/Library/Services)",
1047 args: {
1048 name: "location",
1049 template: "folders",
1050 },
1051 },
1052 {
1053 name: "--input-methoddir",
1054 description:
1055 "Target location for Input Methods (default: ~/Library/Input Methods)",
1056 args: {
1057 name: "location",
1058 template: "folders",
1059 },
1060 },
1061 {
1062 name: "--internet-plugindir",
1063 description:
1064 "Target location for Internet Plugins (default: ~/Library/Internet Plug-Ins)",
1065 args: {
1066 name: "location",
1067 template: "folders",
1068 },
1069 },
1070 {
1071 name: "--audio-unit-plugindir",
1072 description:
1073 "Target location for Audio Unit Plugins (default: ~/Library/Audio/Plug-Ins/Components)",
1074 args: {
1075 name: "location",
1076 template: "folders",
1077 },
1078 },
1079 {
1080 name: "--vst-plugindir",
1081 description:
1082 "Target location for VST Plugins (default: ~/Library/Audio/Plug-Ins/VST)",
1083 args: {
1084 name: "location",
1085 template: "folders",
1086 },
1087 },
1088 {
1089 name: "--vst3-plugindir",
1090 description:
1091 "Target location for VST3 Plugins (default: ~/Library/Audio/Plug-Ins/VST3)",
1092 args: {
1093 name: "location",
1094 template: "folders",
1095 },
1096 },
1097 {
1098 name: "--screen-saverdir",
1099 description:
1100 "Target location for Screen Savers (default: ~/Library/Screen Savers)",
1101 args: {
1102 name: "location",
1103 template: "folders",
1104 },
1105 },
1106 {
1107 name: "--language",
1108 description:
1109 "Comma-separated list of language codes to prefer for cask installation. The first matching language is used, otherwise it reverts to the cask's default language. The default value is the language of your system",
1110 },
1111 ],
1112 args: {
1113 isVariadic: true,
1114 name: "formula",
1115 description: "Formula or cask to install",
1116 generators: [generateAllFormulae, generateAllCasks],
1117 },
1118 },
1119 {
1120 name: "reinstall",
1121 description:
1122 "Uninstall and then reinstall a formula or cask using the same options it was originally installed with, plus any appended options specific to a formula",
1123 options: [
1124 {
1125 name: ["-d", "--debug"],
1126 description:
1127 "If brewing fails, open an interactive debugging session with access to IRB or a shell inside the temporary build directory",
1128 },
1129 {
1130 name: ["-f", "--force"],
1131 description:
1132 "Install formulae without checking for previously installed keg-only or non-migrated versions. When installing casks",
1133 },
1134 {
1135 name: ["-v", "--verbose"],
1136 description: "Print the verification and postinstall steps",
1137 },
1138 {
1139 name: ["-s", "--build-from-source"],
1140 description:
1141 "Compile formula from source even if a bottle is provided. Dependencies will still be installed from bottles if they are available",
1142 },
1143 {
1144 name: ["-i", "--interactive"],
1145 description: "Download and patch formula",
1146 },
1147 { name: ["-g", "--git"], description: "Create a Git repository" },
1148 {
1149 name: "--formula",
1150 description: "Treat all named arguments as formulae",
1151 },
1152 {
1153 name: "--force-bottle",
1154 description:
1155 "Install from a bottle if it exists for the current or newest version of macOS, even if it would not normally be used for installation",
1156 },
1157 {
1158 name: "--keep-tmp",
1159 description: "Retain the temporary files created during installation",
1160 },
1161 {
1162 name: "--display-times",
1163 description:
1164 "Print install times for each formula at the end of the run",
1165 },
1166 {
1167 name: "--cask",
1168 description: "--casks Treat all named arguments as casks",
1169 },
1170 {
1171 name: "--binaries",
1172 description:
1173 "Disable/enable linking of helper executables (default: enabled)",
1174 exclusiveOn: ["--no-binaries"],
1175 },
1176 {
1177 name: "--no-binaries",
1178 description:
1179 "Disable/enable linking of helper executables (default: enabled)",
1180 exclusiveOn: ["--binaries"],
1181 },
1182 {
1183 name: "--require-sha",
1184 description: "Require all casks to have a checksum",
1185 },
1186 {
1187 name: "--quarantine",
1188 description:
1189 "Disable/enable quarantining of downloads (default: enabled)",
1190 exclusiveOn: ["--no-quarantine"],
1191 },
1192 {
1193 name: "--no-quarantine",
1194 description:
1195 "Disable/enable quarantining of downloads (default: enabled)",
1196 exclusiveOn: ["--quarantine"],
1197 },
1198 {
1199 name: "--skip-cask-deps",
1200 description: "Skip installing cask dependencies",
1201 },
1202 ],
1203 args: {
1204 isVariadic: true,
1205 name: "formula",
1206 generators: formulaeGenerator,
1207 },
1208 },
1209 {
1210 name: ["uninstall", "remove", "rm"],
1211 description: "Uninstall a formula or cask",
1212 args: {
1213 isVariadic: true,
1214 name: "formula",
1215 generators: formulaeGenerator,
1216 },
1217 },
1218 {
1219 // NOTE: this is actually a command even if it has the double dash in the front
1220 name: "--prefix",
1221 description: "Prefix of <formula>",
1222 args: {
1223 isVariadic: true,
1224 name: "formula",
1225 generators: formulaeGenerator,
1226 },
1227 options: [
1228 {
1229 name: "--unbrewed",
1230 description:
1231 "List files in Homebrew's prefix not installed by Homebrew",
1232 },
1233 {
1234 name: "--installed",
1235 description:
1236 "Outputs nothing and returns a failing status code if formula is not installed",
1237 },
1238 ],
1239 },
1240 {
1241 name: "cask",
1242 description:
1243 "Homebrew Cask provides a friendly CLI workflow for the administration of macOS applications distributed as binaries",
1244 subcommands: [
1245 {
1246 name: "install",
1247 description: "Installs the given cask",
1248 args: {
1249 name: "cask",
1250 description: "Cask to install",
1251 },
1252 },
1253 {
1254 name: "uninstall",
1255 description: "Uninstalls the given cask",
1256 options: [
1257 ...commonOptions,
1258 {
1259 name: "--zap",
1260 description:
1261 "Remove all files associated with a cask. May remove files which are shared between applications",
1262 },
1263 {
1264 name: "--ignore-dependencies",
1265 description:
1266 "Don't fail uninstall, even if formula is a dependency of any installed formulae",
1267 },
1268 {
1269 name: "--formula",
1270 description: "Treat all named arguments as formulae",
1271 },
1272 {
1273 name: "--cask",
1274 description: "Treat all named arguments as casks",
1275 },
1276 ],
1277 args: {
1278 isVariadic: true,
1279
1280 generators: {
1281 script: ["brew", "list", "-1", "--cask"],
1282 postProcess: function (out) {
1283 return out.split("\n").map((formula) => {
1284 return {
1285 name: formula,
1286 icon: "πΊ",
1287 description: "Installed formula",
1288 };
1289 });
1290 },
1291 },
1292 },
1293 },
1294 ],
1295 },
1296 {
1297 name: "cleanup",
1298 description:
1299 "Remove stale lock files and outdated downloads for all formulae and casks and remove old versions of installed formulae",
1300 options: [
1301 ...commonOptions,
1302 {
1303 name: ["--prune", "--prune=all"],
1304 description: "Remove all cache files older than specified days",
1305 },
1306 {
1307 name: ["-n", "--dry-run"],
1308 description:
1309 "Show what would be removed, but do not actually remove anything",
1310 },
1311 {
1312 name: "-s",
1313 description:
1314 "Scrub the cache, including downloads for even the latest versions",
1315 },
1316 {
1317 name: "--prune-prefix",
1318 description:
1319 "Only prune the symlinks and directories from the prefix and remove no other files",
1320 },
1321 ],
1322 args: {
1323 isVariadic: true,
1324 isOptional: true,
1325 generators: servicesGenerator("Cleanup"),
1326 },
1327 },
1328 {
1329 name: "services",
1330 description:
1331 "Manage background services with macOS' launchctl(1) daemon manager",
1332 options: [
1333 ...commonOptions,
1334 {
1335 name: "--file",
1336 description:
1337 "Use the plist file from this location to start or run the service",
1338 },
1339 {
1340 name: "--all",
1341 description: "Run subcommand on all services",
1342 },
1343 {
1344 name: ["-v", "--verbose"],
1345 description: "Make some output more verbose",
1346 },
1347 {
1348 name: ["-h", "--help"],
1349 description: "Get help with services command",
1350 },
1351 ],
1352 subcommands: [
1353 {
1354 name: "cleanup",
1355 description: "Remove all unused services",
1356 },
1357 {
1358 name: "list",
1359 description: "List all services",
1360 },
1361 {
1362 name: "run",
1363 description:
1364 "Run the service formula without registering to launch at login (or boot)",
1365 options: [
1366 {
1367 name: "--all",
1368 description: "Start all services",
1369 },
1370 ],
1371 args: {
1372 isVariadic: true,
1373 generators: servicesGenerator("Run"),
1374 },
1375 },
1376 {
1377 name: "start",
1378 description:
1379 "Start the service formula immediately and register it to launch at login",
1380 options: [
1381 {
1382 name: "--all",
1383 description: "Start all services",
1384 },
1385 ],
1386 args: {
1387 isVariadic: true,
1388 generators: servicesGenerator("Start"),
1389 },
1390 },
1391 {
1392 name: "stop",
1393 description:
1394 "Stop the service formula immediately and unregister it from launching at",
1395 options: [
1396 {
1397 name: "--all",
1398 description: "Start all services",
1399 },
1400 ],
1401 args: {
1402 isVariadic: true,
1403 generators: servicesGenerator("Stop"),
1404 },
1405 },
1406 {
1407 name: "restart",
1408 description:
1409 "Stop (if necessary) and start the service formula immediately and register it to launch at login (or boot)",
1410 options: [
1411 {
1412 name: "--all",
1413 description: "Start all services",
1414 },
1415 ],
1416 args: {
1417 isVariadic: true,
1418 generators: servicesGenerator("Restart"),
1419 },
1420 },
1421 ],
1422 },
1423 {
1424 name: "analytics",
1425 description: "Manages analytics preferences",
1426 subcommands: [
1427 {
1428 name: "on",
1429 description: "Turns on analytics",
1430 },
1431 {
1432 name: "off",
1433 description: "Turns off analytics",
1434 },
1435 {
1436 name: "regenerate-uuid",
1437 description: "Regenerate the UUID used for analytics",
1438 },
1439 ],
1440 },
1441 {
1442 name: "autoremove",
1443 description:
1444 "Uninstall formulae that were only installed as a dependency of another formula and are now no longer needed",
1445 options: [
1446 {
1447 name: ["-n", "--dry-run"],
1448 description:
1449 "List what would be uninstalled, but do not actually uninstall anything",
1450 },
1451 ],
1452 },
1453 {
1454 name: "tap",
1455 description: "Tap a formula repository",
1456 options: [
1457 ...commonOptions,
1458 {
1459 name: "--full",
1460 description:
1461 "Convert a shallow clone to a full clone without untapping",
1462 },
1463 {
1464 name: "--shallow",
1465 description: "Fetch tap as a shallow clone rather than a full clone",
1466 },
1467 {
1468 name: "--force-auto-update",
1469 description: "Auto-update tap even if it is not hosted on GitHub",
1470 },
1471 {
1472 name: "--repair",
1473 description:
1474 "Migrate tapped formulae from symlink-based to directory-based structure",
1475 },
1476 {
1477 name: "--list-pinned",
1478 description: "List all pinned taps",
1479 },
1480 ],
1481 args: {
1482 name: "user/repo or URL",
1483 },
1484 },
1485 {
1486 name: "untap",
1487 description: "Remove a tapped formula repository",
1488 args: {
1489 name: "repository",
1490 generators: repositoriesGenerator(),
1491 },
1492 options: [
1493 {
1494 name: ["-f", "--force"],
1495 description:
1496 "Untap even if formulae or casks from this tap are currently installed",
1497 },
1498 {
1499 name: ["-d", "--debug"],
1500 description: "Display any debugging information",
1501 },
1502 {
1503 name: ["-q", "--quiet"],
1504 description: "Make some output more quiet",
1505 },
1506 {
1507 name: ["-v", "--verbose"],
1508 description: "Make some output more verbose",
1509 },
1510 {
1511 name: ["-h", "--help"],
1512 description: "Show help message",
1513 },
1514 ],
1515 },
1516 {
1517 name: "link",
1518 description:
1519 "Symlink all of formula's installed files into Homebrew's prefix",
1520 args: {
1521 isOptional: true,
1522 isVariadic: true,
1523 name: "formula",
1524 generators: formulaeGenerator,
1525 },
1526 options: [
1527 {
1528 name: "--overwrite",
1529 description:
1530 "Delete files that already exist in the prefix while linking",
1531 },
1532 {
1533 name: ["-n", "--dry-run"],
1534 description:
1535 "List files which would be linked or deleted by brew link --overwrite without actually linking or deleting any files",
1536 },
1537 {
1538 name: ["-f", "--force"],
1539 description: "Allow keg-only formulae to be linked",
1540 },
1541 {
1542 name: "--HEAD",
1543 description:
1544 "Link the HEAD version of the formula if it is installed",
1545 },
1546 ],
1547 },
1548 {
1549 name: "unlink",
1550 description: "Remove symlinks for formula from Homebrew's prefix",
1551 args: {
1552 isOptional: true,
1553 isVariadic: true,
1554 name: "formula",
1555 generators: formulaeGenerator,
1556 },
1557 options: [
1558 {
1559 name: ["-n", "--dry-run"],
1560 description:
1561 "List files which would be unlinked without actually unlinking or deleting any files",
1562 },
1563 ],
1564 },
1565 {
1566 name: "formulae",
1567 description: "List all available formulae",
1568 },
1569 {
1570 name: "casks",
1571 description: "List all available casks",
1572 },
1573 {
1574 name: "edit",
1575 description: "",
1576 args: {
1577 isVariadic: true,
1578 isOptional: true,
1579 name: "formula",
1580 description: "Formula or cask to install",
1581 generators: [generateAllFormulae, generateAllCasks],
1582 },
1583 options: [
1584 ...commonOptions,
1585 {
1586 name: ["--formula", "--formulae"],
1587 description: "Treat all named arguments as formulae",
1588 },
1589 {
1590 name: ["--cask", "--casks"],
1591 description: "Treat all named arguments as casks",
1592 },
1593 ],
1594 },
1595 {
1596 name: ["home", "homepage"],
1597 description:
1598 "Open a formula, cask's homepage in a browser, or open Homebrew's own homepage if no argument is provided",
1599 args: {
1600 isVariadic: true,
1601 isOptional: true,
1602 name: "formula",
1603 description: "Formula or cask to open homepage for",
1604 generators: [generateAllFormulae, generateAllCasks],
1605 },
1606 options: [
1607 ...commonOptions,
1608 {
1609 name: ["--formula", "--formulae"],
1610 description: "Treat all named arguments as formulae",
1611 },
1612 {
1613 name: ["--cask", "--casks"],
1614 description: "Treat all named arguments as casks",
1615 },
1616 ],
1617 },
1618 {
1619 name: "alias",
1620 description: "Manage custom user created brew aliases",
1621 options: [
1622 {
1623 name: "--edit",
1624 description: "Edit aliases in a text editor",
1625 },
1626 {
1627 name: ["-d", "--debug"],
1628 description: "Display any debugging information",
1629 },
1630 {
1631 name: ["-q", "--quiet"],
1632 description: "Make some output more quiet",
1633 },
1634 {
1635 name: ["-v", "--verbose"],
1636 description: "Make some output more verbose",
1637 },
1638 {
1639 name: ["-h", "--help"],
1640 description: "Show help message",
1641 },
1642 ],
1643 args: {
1644 name: "alias",
1645 generators: generateAliases,
1646 description: "Display the alias command",
1647 isOptional: true,
1648 },
1649 },
1650 {
1651 name: "developer",
1652 description: "Display the current state of Homebrew's developer mode",
1653 args: {
1654 name: "state",
1655 description: "Turn Homebrew's developer mode on or off respectively",
1656 suggestions: ["on", "off"],
1657 isOptional: true,
1658 },
1659 },
1660 ],
1661
options: [
1662 {
1663 name: "--version",
1664 description: "The current Homebrew version",
1665 },
1666 ],
1667
args: {
1668
name: "alias",
1669
generators: generateAliases,
1670
description: "Custom user defined brew alias",
1671
isOptional: true,
1672
},
1673
};
1674
1675
export default completionSpec;
cat.tsextensions/terminal-suggest/src/completions/upstream
+50
AddedMark as viewed
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;
chmod.tsextensions/terminal-suggest/src/completions/upstream
+88
AddedMark as viewed
1
const completionSpec: Fig.Spec = {
2
name: "chmod",
3
description: "Change file modes or Access Control Lists",
4
args: [
5 {
6 name: "mode",
7 suggestions: [
8 // Some of the most common chmod's (non-exhaustive)
9 {
10 name: "u+x",
11 type: "arg",
12 description: "Give execute permission for the user",
13 icon: "π",
14 },
15 {
16 name: "a+rx",
17 type: "arg",
18 description: "Adds read and execute permissions for all classes",
19 icon: "π",
20 },
21 {
22 name: "744",
23 type: "arg",
24 description:
25 "Sets read, write, and execute permissions for user, and sets read permission for Group and Others",
26 icon: "π",
27 },
28 {
29 name: "664",
30 type: "arg",
31 description:
32 "Sets read and write permissions for user and Group, and provides read to Others",
33 icon: "π",
34 },
35 {
36 name: "777",
37 type: "arg",
38 description: "β οΈ allows all actions for all users",
39 icon: "π",
40 },
41 ],
42 },
43 {
44 // Modifying
45 template: "filepaths",
46 },
47 ],
48
49
options: [
50 {
51 name: "-f",
52 description:
53 "Do not display a diagnostic message if chmod could not modify the mode for file, nor modify the exit status to reflect such failures",
54 },
55 {
56 name: "-H",
57 description:
58 "If the -R option is specified, symbolic links on the command line are followed and hence unaffected by the command. (Symbolic links encountered during tree traversal are not followed.)",
59 },
60 {
61 name: "-h",
62 description:
63 "If the file is a symbolic link, change the mode of the link itself rather than the file that the link points to",
64 },
65 {
66 name: "-L",
67 description:
68 "If the -R option is specified, all symbolic links are followed",
69 },
70 {
71 name: "-P",
72 description:
73 "If the -R option is specified, no symbolic links are followed. This is the default",
74 },
75 {
76 name: "-R",
77 description:
78 "Change the modes of the file hierarchies rooted in the files, instead of just the files themselves. Beware of unintentionally matching the ``..'' hard link to the parent directory when using wildcards like ``.*''",
79 },
80 {
81 name: "-v",
82 description:
83 "Cause chmod to be verbose, showing filenames as the mode is modified. If the -v flag is specified more than once, the old and new modes of the file will also be printed, in both octal and symbolic notation",
84 },
85 ],
86
};
87
88
export default completionSpec;
chown.tsextensions/terminal-suggest/src/completions/upstream
+117
AddedMark as viewed
1
export const existingUsersandGroups: Fig.Generator = {
2
custom: async function (tokens, executeShellCommand) {
3
const colonAdded = tokens.find((token) => token.includes(":"));
4
const nFlagUsed = tokens.find((token) => /^-.*n.*/.test(token));
5
6
let shell: string;
7
// Using `:` as a trigger, check to see if a colon is added
8
// in the current command. If it is, get the system groups
9
// else retrieve the list of system users
10
if (colonAdded) {
11
const { stdout } = await executeShellCommand({
12
command: "bash",
13
args: [
14 "-c",
15 "dscl . -list /Groups PrimaryGroupID | tr -s ' '| sort -r",
16 ],
17
});
18
shell = stdout;
19
} else {
20
const { stdout } = await executeShellCommand({
21
command: "bash",
22
args: ["-c", "dscl . -list /Users UniqueID | tr -s ' '| sort -r"],
23
});
24
shell = stdout;
25
}
26
27
return (
28
shell
29
.split("\n")
30
// The shell command retrieves a table
31
`` // with rows that look like `user uid```
32
// so each row is split again to get the
33
// user/group and uid/gid
34
.map((line) => line.split(" "))
35
.map((value) => {
36
return {
37
// If the user has entered the option n
38
// suggest the uid/gid instead of user/group
39
name: nFlagUsed ? value[1] : value[0],
40
description: colonAdded
41
`` ? Group - ${nFlagUsed ? value[0] : gid: ${value[1]}`}```
42
: `User - ${nFlagUsed ? value[0] : `uid: ${value[1]}`}`,
43
icon: colonAdded ? "π₯" : "π€",
44
priority: 90,
45
};
46
})
47
);
48
},
49
trigger: ":",
50
getQueryTerm: ":",
51
};
52
53
const completionSpec: Fig.Spec = {
54
name: "chown",
55
description:
56
"Change the user and/or group ownership of a given file, directory, or symbolic link",
57
args: [
58 {
59 name: "owner[:group] or :group",
60 generators: existingUsersandGroups,
61 },
62 {
63 name: "file/directory",
64 isVariadic: true,
65 template: ["filepaths", "folders"],
66 },
67 ],
68
options: [
69 {
70 name: "-f",
71 description:
72 "Don't report any failure to change file owner or group, nor modify the exit status to reflect such failures",
73 },
74 {
75 name: "-h",
76 description:
77 "If the file is a symbolic link, change the user ID and/or the group ID of the link itself",
78 },
79 {
80 name: "-n",
81 description:
82 "Interpret user ID and group ID as numeric, avoiding name lookups",
83 },
84 {
85 name: "-v",
86 description:
87 "Cause chown to be verbose, showing files as the owner is modified",
88 },
89 {
90 name: "-R",
91 description:
92 "Change the user ID and/or the group ID for the file hierarchies rooted in the files instead of just the files themselves",
93 },
94 {
95 name: "-H",
96 description:
97 "If the -R option is specified, symbolic links on the command line are followed",
98 exclusiveOn: ["-L", "-P"],
99 dependsOn: ["-R"],
100 },
101 {
102 name: "-L",
103 description:
104 "If the -R option is specified, all symbolic links are followed",
105 exclusiveOn: ["-H", "-P"],
106 dependsOn: ["-R"],
107 },
108 {
109 name: "-P",
110 description:
111 "If the -R option is specified, no symbolic links are followed",
112 exclusiveOn: ["-H", "-L"],
113 dependsOn: ["-R"],
114 },
115 ],
116
};
117
export default completionSpec;
cp.tsextensions/terminal-suggest/src/completions/upstream
+79
AddedMark as viewed
1
const completionSpec: Fig.Spec = {
2
name: "cp",
3
description: "Copy files and directories",
4
args: [
5 {
6 name: "source",
7 template: ["filepaths", "folders"],
8 isVariadic: true,
9 },
10 {
11 name: "target",
12 template: ["filepaths", "folders"],
13 },
14 ],
15
options: [
16 {
17 name: "-a",
18 description:
19 "Preserves structure and attributes of files but not directory structure",
20 },
21 {
22 name: "-f",
23 description:
24 "If the destination file cannot be opened, remove it and create a new file, without prompting for confirmation",
25 exclusiveOn: ["-n"],
26 },
27 {
28 name: "-H",
29 description:
30 "If the -R option is specified, symbolic links on the command line are followed",
31 exclusiveOn: ["-L", "-P"],
32 dependsOn: ["-R"],
33 },
34 {
35 name: "-i",
36 description:
37 "Cause cp to write a prompt to the standard error output before copying a file that would overwrite an existing file",
38 exclusiveOn: ["-n"],
39 },
40 {
41 name: "-L",
42 description:
43 "If the -R option is specified, all symbolic links are followed",
44 exclusiveOn: ["-H", "-P"],
45 dependsOn: ["-R"],
46 },
47 {
48 name: "-n",
49 description: "Do not overwrite an existing file",
50 exclusiveOn: ["-f", "-i"],
51 },
52 {
53 name: "-P",
54 description:
55 "If the -R option is specified, no symbolic links are followed",
56 exclusiveOn: ["-H", "-L"],
57 dependsOn: ["-R"],
58 },
59 {
60 name: "-R",
61 description:
62 "If source designates a directory, cp copies the directory and the entire subtree connected at that point. If source ends in a /, the contents of the directory are copied rather than the directory itself",
63 },
64 {
65 name: "-v",
66 description: "Cause cp to be verbose, showing files as they are copied",
67 },
68 {
69 name: "-X",
70 description: "Do not copy Extended Attributes (EAs) or resource forks",
71 },
72 {
73 name: "-c",
74 description: "Copy files using clonefile",
75 },
76 ],
77
};
78
79
export default completionSpec;
curl.tsextensions/terminal-suggest/src/completions/upstream
+914
AddedMark as viewed
1
const completionSpec: Fig.Spec = {
2
name: "curl",
3
description: "Transfer a URL",
4
args: { name: "URL", template: "history" },
5
options: [
6 {
7 name: ["-a", "--append"],
8 description: "Append to target file when uploading",
9 },
10 {
11 name: ["-E", "--cert"],
12 description: "Client certificate file and password",
13 args: {
14 name: "certificate[:password]",
15 generators: {
16 getQueryTerm: ":",
17 },
18 },
19 },
20 {
21 name: ["-K", "--config"],
22 description: "Read config from a file",
23 args: { name: "file", template: "filepaths" },
24 },
25 {
26 name: ["-C", "--continue-at"],
27 description: "Resumed transfer offset",
28 args: { name: "offset" },
29 },
30 {
31 name: ["-b", "--cookie"],
32 description: "Send cookies from string/file",
33 args: { name: "data or filename", template: "filepaths" },
34 },
35 {
36 name: ["-c", "--cookie-jar"],
37 description: "Write cookies to <filename> after operation",
38 args: { name: "filename", template: "filepaths" },
39 },
40 {
41 name: ["-d", "--data"],
42 description: "HTTP POST data",
43 insertValue: "-d '{cursor}'",
44 args: { name: "data" },
45 isRepeatable: true,
46 },
47 { name: ["-q", "--disable"], description: "Disable .curlrc" },
48 {
49 name: ["-D", "--dump-header"],
50 description: "Write the received headers to <filename>",
51 args: { name: "filename", template: "filepaths" },
52 },
53 {
54 name: ["-f", "--fail"],
55 description: "Fail silently (no output at all) on HTTP errors",
56 },
57 {
58 name: ["-F", "--form"],
59 description: "Specify multipart MIME data",
60 args: { name: "content" },
61 isRepeatable: true,
62 },
63 {
64 name: ["-P", "--ftp-port"],
65 description: "Use PORT instead of PASV",
66 args: { name: "address" },
67 },
68 {
69 name: ["-G", "--get"],
70 description: "Put the post data in the URL and use GET",
71 },
72 {
73 name: ["-g", "--globoff"],
74 description: "Disable URL sequences and ranges using {} and []",
75 },
76 { name: ["-I", "--head"], description: "Show document info only" },
77 {
78 name: ["-H", "--header"],
79 description: "Pass custom header(s) to server",
80 args: {
81 name: "header/file",
82 suggestions: [
83 { name: "Content-Type: application/json" },
84 { name: "Content-Type: application/x-www-form-urlencoded" },
85 ],
86 },
87 },
88 { name: ["-h", "--help"], description: "This help text" },
89 { name: ["-0", "--http1.0"], description: "Use HTTP 1.0" },
90 {
91 name: ["-i", "--include"],
92 description: "Include protocol response headers in the output",
93 },
94 {
95 name: ["-k", "--insecure"],
96 description: "Allow insecure server connections when using SSL",
97 },
98 { name: ["-4", "--ipv4"], description: "Resolve names to IPv4 addresses" },
99 { name: ["-6", "--ipv6"], description: "Resolve names to IPv6 addresses" },
100 {
101 name: ["-j", "--junk-session-cookies"],
102 description: "Ignore session cookies read from file",
103 },
104 { name: ["-l", "--list-only"], description: "List only mode" },
105 { name: ["-L", "--location"], description: "Follow redirects" },
106 { name: ["-M", "--manual"], description: "Display the full manual" },
107 {
108 name: ["-m", "--max-time"],
109 description: "Maximum time allowed for the transfer",
110 args: { name: "seconds" },
111 },
112 {
113 name: ["-n", "--netrc"],
114 description: "Must read .netrc for user name and password",
115 },
116 {
117 name: ["-:", "--next"],
118 description: "Make next URL use its separate set of options",
119 },
120 {
121 name: ["-N", "--no-buffer"],
122 description: "Disable buffering of the output stream",
123 },
124 {
125 name: ["-o", "--output"],
126 description: "Write to file instead of stdout",
127 args: { name: "file", template: "filepaths" },
128 },
129 {
130 name: ["-#", "--progress-bar"],
131 description: "Display transfer progress as a bar",
132 },
133 {
134 name: ["-x", "--proxy"],
135 description: "[protocol://]host[:port] Use this proxy",
136 },
137 {
138 name: ["-U", "--proxy-user"],
139 description: "Proxy user and password",
140 args: { name: "user:password" },
141 },
142 {
143 name: ["-p", "--proxytunnel"],
144 description: "Operate through an HTTP proxy tunnel (using CONNECT)",
145 },
146 {
147 name: ["-Q", "--quote"],
148 description: "Send command(s) to server before transfer",
149 },
150 {
151 name: ["-r", "--range"],
152 description: "Retrieve only the bytes within RANGE",
153 args: { name: "range" },
154 },
155 {
156 name: ["-e", "--referer"],
157 description: "Referrer URL",
158 args: { name: "URL" },
159 },
160 {
161 name: ["-J", "--remote-header-name"],
162 description: "Use the header-provided filename",
163 },
164 {
165 name: ["-O", "--remote-name"],
166 description: "Write output to a file named as the remote file",
167 },
168 {
169 name: ["-R", "--remote-time"],
170 description: "Set the remote file's time on the local output",
171 },
172 {
173 name: ["-X", "--request"],
174 description: "Specify request command to use",
175 args: {
176 name: "command",
177 suggestions: [
178 { name: "GET" },
179 { name: "HEAD" },
180 { name: "POST" },
181 { name: "PUT" },
182 { name: "DELETE" },
183 { name: "CONNECT" },
184 { name: "OPTIONS" },
185 { name: "TRACE" },
186 { name: "PATCH" },
187 ],
188 },
189 },
190 {
191 name: ["-S", "--show-error"],
192 description: "Show error even when -s is used",
193 },
194 { name: ["-s", "--silent"], description: "Silent mode" },
195 {
196 name: ["-Y", "--speed-limit"],
197 description: "Stop transfers slower than this",
198 args: { name: "speed" },
199 },
200 {
201 name: ["-y", "--speed-time"],
202 description: "Trigger 'speed-limit' abort after this time",
203 args: { name: "seconds" },
204 },
205 { name: ["-2", "--sslv2"], description: "Use SSLv2" },
206 { name: ["-3", "--sslv3"], description: "Use SSLv3" },
207 {
208 name: ["-t", "--telnet-option"],
209 description: "Set telnet option",
210 args: { name: "val" },
211 },
212 {
213 name: ["-z", "--time-cond"],
214 description: "Transfer based on a time condition",
215 args: { name: "time" },
216 },
217 { name: ["-1", "--tlsv1"], description: "Use TLSv1.0 or greater" },
218 {
219 name: ["-T", "--upload-file"],
220 description: "Transfer local FILE to destination",
221 args: { name: "file", template: "filepaths" },
222 },
223 { name: ["-B", "--use-ascii"], description: "Use ASCII/text transfer" },
224 {
225 name: ["-u", "--user"],
226 description: "Server user and password",
227 args: { name: "user:password" },
228 },
229 {
230 name: ["-A", "--user-agent"],
231 description: "Send User-Agent <name> to server",
232 args: { name: "name" },
233 },
234 {
235 name: ["-v", "--verbose"],
236 description: "Make the operation more talkative",
237 },
238 { name: ["-V", "--version"], description: "Show version number and quit" },
239 {
240 name: ["-w", "--write-out"],
241 description: "Use output FORMAT after completion",
242 args: { name: "format" },
243 },
244 {
245 name: "--abstract-unix-socket",
246 description: "Connect via abstract Unix domain socket",
247 args: { name: "path" },
248 },
249 {
250 name: "--alt-svc",
251 description: "Name> Enable alt-svc with this cache file",
252 args: { name: "file", template: "filepaths" },
253 },
254 { name: "--anyauth", description: "Pick any authentication method" },
255 { name: "--basic", description: "Use HTTP Basic Authentication" },
256 {
257 name: "--cacert",
258 description: "CA certificate to verify peer against",
259 args: { name: "file", template: "filepaths" },
260 },
261 {
262 name: "--capath",
263 description: "CA directory to verify peer against",
264 args: { name: "dir", template: "folders" },
265 },
266 {
267 name: "--cert-status",
268 description: "Verify the status of the server certificate",
269 },
270 {
271 name: "--cert-type",
272 description: "Certificate file type",
273 args: {
274 name: "type",
275 suggestions: [{ name: "DER" }, { name: "PEM" }, { name: "ENG" }],
276 },
277 },
278 {
279 name: "--ciphers",
280 description: "Of ciphers> SSL ciphers to use",
281 args: { name: "list" },
282 },
283 { name: "--compressed", description: "Request compressed response" },
284 { name: "--compressed-ssh", description: "Enable SSH compression" },
285 {
286 name: "--connect-timeout",
287 description: "Maximum time allowed for connection",
288 args: { name: "seconds" },
289 },
290 {
291 name: "--connect-to",
292 description: "Connect to host",
293 args: { name: "HOST1:PORT1:HOST2:PORT2" },
294 },
295 {
296 name: "--create-dirs",
297 description: "Create necessary local directory hierarchy",
298 },
299 { name: "--crlf", description: "Convert LF to CRLF in upload" },
300 {
301 name: "--crlfile",
302 description: "Get a CRL list in PEM format from the given file",
303 args: { name: "file", template: "filepaths" },
304 },
305 {
306 name: "--data-ascii",
307 description: "HTTP POST ASCII data",
308 args: { name: "data" },
309 },
310 {
311 name: "--data-binary",
312 description: "HTTP POST binary data",
313 args: { name: "data" },
314 },
315 {
316 name: "--data-raw",
317 description: "HTTP POST data, '@' allowed",
318 args: { name: "data" },
319 },
320 {
321 name: "--data-urlencode",
322 description: "HTTP POST data url encoded",
323 args: { name: "data" },
324 },
325 {
326 name: "--delegation",
327 description: "GSS-API delegation permission",
328 args: { name: "LEVEL" },
329 },
330 { name: "--digest", description: "Use HTTP Digest Authentication" },
331 { name: "--disable-eprt", description: "Inhibit using EPRT or LPRT" },
332 { name: "--disable-epsv", description: "Inhibit using EPSV" },
333 {
334 name: "--disallow-username-in-url",
335 description: "Disallow username in url",
336 },
337 {
338 name: "--dns-interface",
339 description: "Interface to use for DNS requests",
340 args: { name: "interface" },
341 },
342 {
343 name: "--dns-ipv4-addr",
344 description: "IPv4 address to use for DNS requests",
345 args: { name: "address" },
346 },
347 {
348 name: "--dns-ipv6-addr",
349 description: "IPv6 address to use for DNS requests",
350 args: { name: "address" },
351 },
352 {
353 name: "--dns-servers",
354 description: "DNS server addrs to use",
355 args: { name: "addresses" },
356 },
357 {
358 name: "--doh-url",
359 description: "Resolve host names over DOH",
360 args: { name: "URL" },
361 },
362 {
363 name: "--egd-file",
364 description: "EGD socket path for random data",
365 args: { name: "file", template: "filepaths" },
366 },
367 {
368 name: "--engine",
369 description: "Crypto engine to use",
370 args: { name: "name" },
371 },
372 {
373 name: "--etag-compare",
374 description:
375 "Make a conditional HTTP request for the ETag read from the given file",
376 args: { name: "file" },
377 },
378 {
379 name: "--etag-save",
380 description: "Save an HTTP ETag to the specified file",
381 args: { name: "file" },
382 },
383 {
384 name: "--expect100-timeout",
385 description: "How long to wait for 100-continue",
386 args: { name: "seconds" },
387 },
388 {
389 name: "--fail-early",
390 description: "Fail on first transfer error, do not continue",
391 },
392 {
393 name: "--fail-with-body",
394 description:
395 "On HTTP errors, return an error and also output any HTML response",
396 },
397 { name: "--false-start", description: "Enable TLS False Start" },
398 {
399 name: "--form-string",
400 description: "Specify multipart MIME data",
401 args: { name: "string" },
402 },
403 {
404 name: "--ftp-account",
405 description: "Account data string",
406 args: { name: "data" },
407 },
408 {
409 name: "--ftp-alternative-to-user",
410 description: "String to replace USER [name]",
411 args: { name: "command" },
412 },
413 {
414 name: "--ftp-create-dirs",
415 description: "Create the remote dirs if not present",
416 },
417 {
418 name: "--ftp-method",
419 description: "Control CWD usage",
420 args: { name: "method" },
421 },
422 { name: "--ftp-pasv", description: "Use PASV/EPSV instead of PORT" },
423 { name: "--ftp-pret", description: "Send PRET before PASV" },
424 { name: "--ftp-skip-pasv-ip", description: "Skip the IP address for PASV" },
425 { name: "--ftp-ssl-ccc", description: "Send CCC after authenticating" },
426 {
427 name: "--ftp-ssl-ccc-mode",
428 description: "Set CCC mode",
429 args: {
430 name: "mode",
431 suggestions: [{ name: "active" }, { name: "passive" }],
432 },
433 },
434 {
435 name: "--ftp-ssl-control",
436 description: "Require SSL/TLS for FTP login, clear for transfer",
437 },
438 {
439 name: "--happy-eyeballs-timeout-ms",
440 description:
441 "How long to wait in milliseconds for IPv6 before trying IPv4",
442 args: { name: "milliseconds" },
443 },
444 {
445 name: "--haproxy-protocol",
446 description: "Send HAProxy PROXY protocol v1 header",
447 },
448 {
449 name: "--hostpubmd5",
450 description: "Acceptable MD5 hash of the host public key",
451 args: { name: "md5" },
452 },
453 { name: "--http0.9", description: "Allow HTTP 0.9 responses" },
454 { name: "--http1.1", description: "Use HTTP 1.1" },
455 { name: "--http2", description: "Use HTTP 2" },
456 {
457 name: "--http2-prior-knowledge",
458 description: "Use HTTP 2 without HTTP/1.1 Upgrade",
459 },
460 {
461 name: "--ignore-content-length",
462 description: "Ignore the size of the remote resource",
463 },
464 {
465 name: "--interface",
466 description: "Use network INTERFACE (or address)",
467 args: { name: "name" },
468 },
469 {
470 name: "--keepalive-time",
471 description: "Interval time for keepalive probes",
472 args: { name: "seconds" },
473 },
474 {
475 name: "--key",
476 description: "Private key file name",
477 args: { name: "key" },
478 },
479 {
480 name: "--key-type",
481 description: "Private key file type",
482 args: {
483 name: "type",
484 suggestions: [{ name: "DER" }, { name: "PEM" }, { name: "ENG" }],
485 },
486 },
487 {
488 name: "--krb",
489 description: "Enable Kerberos with security <level>",
490 args: { name: "level" },
491 },
492 {
493 name: "--libcurl",
494 description: "Dump libcurl equivalent code of this command line",
495 args: { name: "file", template: "filepaths" },
496 },
497 {
498 name: "--limit-rate",
499 description: "Limit transfer speed to RATE",
500 args: { name: "speed" },
501 },
502 {
503 name: "--local-port",
504 description: "Force use of RANGE for local port numbers",
505 args: { name: "num/range" },
506 },
507 {
508 name: "--location-trusted",
509 description: "Like --location, and send auth to other hosts",
510 },
511 {
512 name: "--login-options",
513 description: "Server login options",
514 args: { name: "options" },
515 },
516 {
517 name: "--mail-auth",
518 description: "Originator address of the original email",
519 args: { name: "address" },
520 },
521 {
522 name: "--mail-from",
523 description: "Mail from this address",
524 args: { name: "address" },
525 },
526 {
527 name: "--mail-rcpt",
528 description: "Mail to this address",
529 args: { name: "address" },
530 },
531 {
532 name: "--max-filesize",
533 description: "Maximum file size to download",
534 args: { name: "bytes" },
535 },
536 {
537 name: "--max-redirs",
538 description: "Maximum number of redirects allowed",
539 args: { name: "num" },
540 },
541 {
542 name: "--metalink",
543 description: "Process given URLs as metalink XML file",
544 },
545 {
546 name: "--negotiate",
547 description: "Use HTTP Negotiate (SPNEGO) authentication",
548 },
549 {
550 name: "--netrc-file",
551 description: "Specify FILE for netrc",
552 args: { name: "filename", template: "filepaths" },
553 },
554 { name: "--netrc-optional", description: "Use either .netrc or URL" },
555 { name: "--no-alpn", description: "Disable the ALPN TLS extension" },
556 {
557 name: "--no-keepalive",
558 description: "Disable TCP keepalive on the connection",
559 },
560 { name: "--no-npn", description: "Disable the NPN TLS extension" },
561 { name: "--no-sessionid", description: "Disable SSL session-ID reusing" },
562 {
563 name: "--noproxy",
564 description: "List of hosts which do not use proxy",
565 args: { name: "no-proxy-list" },
566 },
567 { name: "--ntlm", description: "Use HTTP NTLM authentication" },
568 {
569 name: "--ntlm-wb",
570 description: "Use HTTP NTLM authentication with winbind",
571 },
572 {
573 name: "--oauth2-bearer",
574 description: "OAuth 2 Bearer Token",
575 args: { name: "token" },
576 },
577 {
578 name: "--pass",
579 description: "Pass phrase for the private key",
580 args: { name: "phrase" },
581 },
582 {
583 name: "--path-as-is",
584 description: "Do not squash .. sequences in URL path",
585 },
586 {
587 name: "--pinnedpubkey",
588 description: "FILE/HASHES Public key to verify peer against",
589 args: { name: "hashes" },
590 },
591 {
592 name: "--post301",
593 description: "Do not switch to GET after following a 301",
594 },
595 {
596 name: "--post302",
597 description: "Do not switch to GET after following a 302",
598 },
599 {
600 name: "--post303",
601 description: "Do not switch to GET after following a 303",
602 },
603 {
604 name: "--preproxy",
605 description: "[protocol://]host[:port] Use this proxy first",
606 },
607 {
608 name: "--proto",
609 description: "Enable/disable PROTOCOLS",
610 args: { name: "protocols" },
611 },
612 {
613 name: "--proto-default",
614 description: "Use PROTOCOL for any URL missing a scheme",
615 args: { name: "protocol" },
616 },
617 {
618 name: "--proto-redir",
619 description: "Enable/disable PROTOCOLS on redirect",
620 args: { name: "protocols" },
621 },
622 {
623 name: "--proxy-anyauth",
624 description: "Pick any proxy authentication method",
625 },
626 {
627 name: "--proxy-basic",
628 description: "Use Basic authentication on the proxy",
629 },
630 {
631 name: "--proxy-cacert",
632 description: "CA certificate to verify peer against for proxy",
633 args: { name: "file", template: "filepaths" },
634 },
635 {
636 name: "--proxy-capath",
637 description: "CA directory to verify peer against for proxy",
638 args: { name: "dir", template: "folders" },
639 },
640 {
641 name: "--proxy-cert",
642 description: "Set client certificate for proxy",
643 args: { name: "cert[:passwd]" },
644 },
645 {
646 name: "--proxy-cert-type",
647 description: "Client certificate type for HTTPS proxy",
648 args: { name: "type" },
649 },
650 {
651 name: "--proxy-ciphers",
652 description: "SSL ciphers to use for proxy",
653 args: { name: "list" },
654 },
655 {
656 name: "--proxy-crlfile",
657 description: "Set a CRL list for proxy",
658 args: { name: "file", template: "filepaths" },
659 },
660 {
661 name: "--proxy-digest",
662 description: "Use Digest authentication on the proxy",
663 },
664 {
665 name: "--proxy-header",
666 description: "Pass custom header(s) to proxy",
667 args: {
668 name: "header/file",
669 suggestions: [
670 { name: "Content-Type: application/json" },
671 { name: "Content-Type: application/x-www-form-urlencoded" },
672 ],
673 },
674 },
675 {
676 name: "--proxy-insecure",
677 description: "Do HTTPS proxy connections without verifying the proxy",
678 },
679 {
680 name: "--proxy-key",
681 description: "Private key for HTTPS proxy",
682 args: { name: "key" },
683 },
684 {
685 name: "--proxy-key-type",
686 description: "Private key file type for proxy",
687 args: { name: "type" },
688 },
689 {
690 name: "--proxy-negotiate",
691 description: "Use HTTP Negotiate (SPNEGO) authentication on the proxy",
692 },
693 {
694 name: "--proxy-ntlm",
695 description: "Use NTLM authentication on the proxy",
696 },
697 {
698 name: "--proxy-pass",
699 description: "Pass phrase for the private key for HTTPS proxy",
700 args: { name: "phrase" },
701 },
702 {
703 name: "--proxy-pinnedpubkey",
704 description: "FILE/HASHES public key to verify proxy with",
705 args: { name: "hashes" },
706 },
707 {
708 name: "--proxy-service-name",
709 description: "SPNEGO proxy service name",
710 args: { name: "name" },
711 },
712 {
713 name: "--proxy-ssl-allow-beast",
714 description: "Allow security flaw for interop for HTTPS proxy",
715 },
716 {
717 name: "--proxy-tls13-ciphers",
718 description: "List> TLS 1.3 proxy cipher suites",
719 args: { name: "ciphersuite" },
720 },
721 {
722 name: "--proxy-tlsauthtype",
723 description: "TLS authentication type for HTTPS proxy",
724 args: { name: "type" },
725 },
726 {
727 name: "--proxy-tlspassword",
728 description: "TLS password for HTTPS proxy",
729 args: { name: "string" },
730 },
731 {
732 name: "--proxy-tlsuser",
733 description: "TLS username for HTTPS proxy",
734 args: { name: "name" },
735 },
736 { name: "--proxy-tlsv1", description: "Use TLSv1 for HTTPS proxy" },
737 {
738 name: "--proxy1.0",
739 description: "Use HTTP/1.0 proxy on given port",
740 args: { name: "host[:port]" },
741 },
742 {
743 name: "--pubkey",
744 description: "SSH Public key file name",
745 args: { name: "key", template: "filepaths" },
746 },
747 {
748 name: "--random-file",
749 description: "File for reading random data from",
750 args: { name: "file", template: "filepaths" },
751 },
752 { name: "--raw", description: 'Do HTTP "raw"; no transfer decoding' },
753 {
754 name: "--remote-name-all",
755 description: "Use the remote file name for all URLs",
756 },
757 {
758 name: "--request-target",
759 description: "Specify the target for this request",
760 },
761 {
762 name: "--resolve",
763 description: "Resolve the host+port to this address",
764 args: { name: "host:port:address[,address]..." },
765 },
766 {
767 name: "--retry",
768 description: "Retry request if transient problems occur",
769 args: { name: "num" },
770 },
771 {
772 name: "--retry-connrefused",
773 description: "Retry on connection refused (use with --retry)",
774 },
775 {
776 name: "--retry-delay",
777 description: "Wait time between retries",
778 args: { name: "seconds" },
779 },
780 {
781 name: "--retry-max-time",
782 description: "Retry only within this period",
783 args: { name: "seconds" },
784 },
785 {
786 name: "--sasl-ir",
787 description: "Enable initial response in SASL authentication",
788 },
789 {
790 name: "--service-name",
791 description: "SPNEGO service name",
792 args: { name: "name" },
793 },
794 {
795 name: "--socks4",
796 description: "SOCKS4 proxy on given host + port",
797 args: { name: "host[:port]" },
798 },
799 {
800 name: "--socks4a",
801 description: "SOCKS4a proxy on given host + port",
802 args: { name: "host[:port]" },
803 },
804 {
805 name: "--socks5",
806 description: "SOCKS5 proxy on given host + port",
807 args: { name: "host[:port]" },
808 },
809 {
810 name: "--socks5-basic",
811 description: "Enable username/password auth for SOCKS5 proxies",
812 },
813 {
814 name: "--socks5-gssapi",
815 description: "Enable GSS-API auth for SOCKS5 proxies",
816 },
817 {
818 name: "--socks5-gssapi-nec",
819 description: "Compatibility with NEC SOCKS5 server",
820 },
821 {
822 name: "--socks5-gssapi-service",
823 description: "SOCKS5 proxy service name for GSS-API",
824 args: { name: "name" },
825 },
826 {
827 name: "--socks5-hostname",
828 description: "SOCKS5 proxy, pass host name to proxy",
829 args: { name: "host[:port]" },
830 },
831 { name: "--ssl", description: "Try SSL/TLS" },
832 {
833 name: "--ssl-auto-client-cert",
834 description: "Obtain and use a client certificate automatically",
835 },
836 {
837 name: "--ssl-allow-beast",
838 description: "Allow security flaw to improve interop",
839 },
840 {
841 name: "--ssl-no-revoke",
842 description: "Disable cert revocation checks (Schannel)",
843 },
844 { name: "--ssl-reqd", description: "Require SSL/TLS" },
845 { name: "--stderr", description: "Where to redirect stderr" },
846 {
847 name: "--styled-output",
848 description: "Enable styled output for HTTP headers",
849 },
850 {
851 name: "--suppress-connect-headers",
852 description: "Suppress proxy CONNECT response headers",
853 },
854 { name: "--tcp-fastopen", description: "Use TCP Fast Open" },
855 { name: "--tcp-nodelay", description: "Use the TCP_NODELAY option" },
856 {
857 name: "--tftp-blksize",
858 description: "Set TFTP BLKSIZE option",
859 args: { name: "value" },
860 },
861 { name: "--tftp-no-options", description: "Do not send any TFTP options" },
862 {
863 name: "--tls-max",
864 description: "Set maximum allowed TLS version",
865 args: { name: "VERSION" },
866 },
867 {
868 name: "--tls13-ciphers",
869 description: "Of TLS 1.3 ciphersuites> TLS 1.3 cipher suites to use",
870 args: { name: "list" },
871 },
872 {
873 name: "--tlsauthtype",
874 description: "TLS authentication type",
875 args: { name: "type" },
876 },
877 { name: "--tlspassword", description: "TLS password" },
878 { name: "--tlsuser", description: "TLS user name", args: { name: "name" } },
879 { name: "--tlsv1.0", description: "Use TLSv1.0 or greater" },
880 { name: "--tlsv1.1", description: "Use TLSv1.1 or greater" },
881 { name: "--tlsv1.2", description: "Use TLSv1.2 or greater" },
882 { name: "--tlsv1.3", description: "Use TLSv1.3 or greater" },
883 {
884 name: "--tr-encoding",
885 description: "Request compressed transfer encoding",
886 },
887 {
888 name: "--trace",
889 description: "Write a debug trace to FILE",
890 args: { name: "file", template: "filepaths" },
891 },
892 {
893 name: "--trace-ascii",
894 description: "Like --trace, but without hex output",
895 args: { name: "file", template: "filepaths" },
896 },
897 {
898 name: "--trace-time",
899 description: "Add time stamps to trace/verbose output",
900 },
901 {
902 name: "--unix-socket",
903 description: "Connect through this Unix domain socket",
904 args: { name: "path" },
905 },
906 { name: "--url", description: "URL to work with", args: { name: "url" } },
907 {
908 name: "--xattr",
909 description: "Store metadata in extended file attributes",
910 },
911 ],
912
};
913
914
export default completionSpec;
df.tsextensions/terminal-suggest/src/completions/upstream
+65
AddedMark as viewed
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;
du.tsextensions/terminal-suggest/src/completions/upstream
+93
AddedMark as viewed
1
const completionSpec: Fig.Spec = {
2
name: "du",
3
description: "Display disk usage statistics",
4
options: [
5 {
6 name: "-a",
7 description: "Display an entry for each file in a file hierarchy",
8 exclusiveOn: ["-s", "-d"],
9 },
10 {
11 name: "-c",
12 description: "Display a grand total",
13 },
14 {
15 name: "-H",
16 description:
17 "Symbolic links on the command line are followed, symbolic links in file hierarchies are not followed",
18 exclusiveOn: ["-L", "-P"],
19 },
20 {
21 name: "-h",
22 description:
23 '"Human-readable" output. Use unit suffixes: Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte',
24 exclusiveOn: ["-k", "-m", "-g"],
25 },
26 {
27 name: "-g",
28 description: "Display block counts in 1073741824-byte (1-Gbyte) blocks",
29 exclusiveOn: ["-k", "-m", "-h"],
30 },
31 {
32 name: "-k",
33 description: "Display block counts in 1024-byte (1-Kbyte) blocks",
34 exclusiveOn: ["-g", "-m", "-h"],
35 },
36 {
37 name: "-m",
38 description: "Display block counts in 1048576-byte (1-Mbyte) blocks",
39 exclusiveOn: ["-g", "-k", "-h"],
40 },
41 {
42 name: "-I",
43 description: "Ignore files and directories matching the specified mask",
44 args: {
45 name: "mask",
46 },
47 },
48 {
49 name: "-L",
50 description:
51 "Symbolic links on the command line and in file hierarchies are followed",
52 exclusiveOn: ["-H", "-P"],
53 },
54 {
55 name: "-r",
56 description:
57 "Generate messages about directories that cannot be read, files that cannot be opened, and so on. This is the default case. This option exists solely for conformance with X/Open Portability Guide Issue 4 (``XPG4'')",
58 },
59 {
60 name: "-P",
61 description: "No symbolic links are followed. This is the default",
62 exclusiveOn: ["-H", "-L"],
63 },
64 {
65 name: "-d",
66 description:
67 "Display an entry for all files and directories depth directories deep",
68 exclusiveOn: ["-a", "-s"],
69 args: {
70 name: "depth",
71 suggestions: ["0", "1", "2"],
72 },
73 },
74 {
75 name: "-s",
76 description:
77 "Display an entry for each specified file. (Equivalent to -d 0)",
78 exclusiveOn: ["-a", "-d"],
79 },
80 {
81 name: "-x",
82 description:
83 "Display an entry for each specified file. (Equivalent to -d 0)",
84 },
85 ],
86
args: {
87
isOptional: true,
88
name: "files",
89
isVariadic: true,
90
template: ["filepaths", "folders"],
91
},
92
};
93
export default completionSpec;
find.tsextensions/terminal-suggest/src/completions/upstream
+71
AddedMark as viewed
1
const completionSpec: Fig.Spec = {
2
name: "find",
3
description: "Walk a file hierarchy",
4
args: [
5 {
6 name: "path",
7 isOptional: true,
8 isVariadic: true,
9 template: ["folders"],
10 },
11 {
12
`` // TODO Suggestions for primaries and operands. See man find```\ \ 13\ \ name: "expression",\ \ 14\ \ description: "Composition of primaries and operands",\ \ 15\ \ isOptional: true,\ \ 16\ \ isVariadic: true,\ \ 17\ \ },\ \ 18\ \ ],`
19
options: [
20 {
21 name: "-E",
22 description:
23 "Interpret regular expressions followed by -regex and -iregex primaries as extended",
24 },
25 {
26 name: "-H",
27 description:
28 "Cause the file information and file type returned for each symbolic link specified to be those referenced by the link",
29 exclusiveOn: ["-L", "-P"],
30 },
31 {
32 name: "-L",
33 description:
34 "Cause the file information and file type returned for each symbolic link to be those of the file referenced by the link",
35 exclusiveOn: ["-H", "-P"],
36 },
37 {
38 name: "-P",
39 description:
40 "Cause the file information and file type returned for each symbolic link to be those for the link itself",
41 exclusiveOn: ["-H", "-L"],
42 },
43 {
44 name: "-X",
45 description: "Permit find to be safely used in conjunction with xargs",
46 },
47 {
48 name: "-d",
49 description: "Cause find to perform a depth-first traversal",
50 },
51 {
52 name: "-f",
53 description: "Specify a file hierarch for find to traverse",
54 args: {
55 name: "path",
56 },
57 },
58 {
59 name: "-s",
60 description:
61 "Cause find to traverse the file hierarchies in lexicographical order",
62 },
63 {
64 name: "-x",
65 description:
66 "Prevent find from descending into directories that have a device number different than that of the file from which the descent began",
67 },
68 ],
69
};
70
71
export default completionSpec;
grep.tsextensions/terminal-suggest/src/completions/upstream
AddedMark as viewed
const completionSpec: Fig.Spec = {
name: "grep",
description:
"Matches patterns in input text. Supports simple patterns and regular expressions",
args: [
{
name: "search pattern",
suggestCurrentToken: true,
},
{
name: "file",
template: "filepaths",
},
],
options: [
{
name: "--help",
description:
"Print a usage message briefly summarizing these command-line options and the bug-reporting address, then exit",
},
{
name: ["-E", "--extended-regexp"],
description:
"Interpret PATTERN as an extended regular expression (-E is specified by POSIX.)",
},
{
name: ["-F", "--fixed-string"],
description:
"Interpret PATTERN as a list of fixed strings, separated by newlines, any of which is to be matched. (-F is specified by POSIX.)",
},
{
name: ["-G", "--basic-regexp"],
description:
"Interpret PATTERN as a basic regular expression (BRE, see below). This is the default",
},
{
name: ["-e", "--regexp"],
description:
"Use PATTERN as the pattern. This can be used to specify multiple search patterns, or to protect a pattern beginning with a hyphen (-). (-e is specified by POSIX.)",
args: {
name: "pattern",
},
},
{
name: ["-i", "--ignore-case", "-y"],
description:
"Ignore case distinctions in both the PATTERN and the input files. (-i is specified by POSIX.)",
},
{
name: ["-v", "--invert-match"],
description:
"Invert the sense of matching, to select non-matching lines. (-v is specified by POSIX.)",
},
{
name: ["-w", "--word-regexp"],
description:
"Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the beginning of the line, or preceded by a non-word constituent character. Similarly, it must be either at the end of the line or followed by a non-word constituent character. Word-constituent characters are letters, digits, and the underscore",
},
{
name: ["-x", "--line-regexp"],
description:
"Select only those matches that exactly match the whole line. (-x is specified by POSIX.)",
},
{
name: ["-c", "--count"],
description:
"Suppress normal output; instead print a count of matching lines for each input file. With the -v, --invert-match option, count non-matching lines. (-c is specified by POSIX.)",
},
{
name: "--color",
description:
"Surround the matched (non-empty) strings, matching lines, context lines, file names, line numbers, byte offsets, and separators (for fields and groups of context lines) with escape sequences to display them in color on the terminal. The colors are defined by the environment variable GREP_COLORS. The deprecated environment variable GREP_COLOR is still supported, but its setting does not have priority",
args: {
name: "WHEN",
default: "auto",
suggestions: ["never", "always", "auto"],
},
},
{
name: ["-L", "--files-without-match"],
exclusiveOn: ["-l", "--files-with-matches"],
description:
"Suppress normal output; instead print the name of each input file from which no output would normally have been printed. The scanning will stop on the first match",
},
{
name: ["-l", "--files-with-matches"],
exclusiveOn: ["-L", "--files-without-match"],
description:
"Suppress normal output; instead print the name of each input file from which output would normally have been printed. The scanning will stop on the first match. (-l is specified by POSIX.)",
},
{
name: ["-m", "--max-count"],
description:
"Stop reading a file after NUM matching lines. If the input is standard input from a regular file, and NUM matching lines are output, grep ensures that the standard input is positioned to just after the last matching line before exiting, regardless of the presence of trailing context lines. This enables a calling process to resume a search. When grep stops after NUM matching lines, it outputs any trailing context lines. When the -c or --count option is also used, grep does not output a count greater than NUM. When the -v or --invert-match option is also used, grep stops after outputting NUM non-matching lines",
args: {
name: "NUM",
},
},
{
name: ["-o", "--only-matching"],
description:
"Print only the matched (non-empty) parts of a matching line, with each such part on a separate output line",
},
{
name: ["-q", "--quiet", "--silent"],
description:
"Quiet; do not write anything to standard output. Exit immediately with zero status if any match is found, even if an error was detected. Also see the -s or --no-messages option. (-q is specified by POSIX.)",
},
{
name: ["-s", "--no-messages"],
description:
"Suppress error messages about nonexistent or unreadable files. Portability note: unlike GNU grep, 7th Edition Unix grep did not conform to POSIX, because it lacked -q and its -s option behaved like GNU grep's -q option. USG -style grep also lacked -q but its -s option behaved like GNU grep. Portable shell scripts should avoid both -q and -s and should redirect standard and error output to /dev/null instead. (-s is specified by POSIX.)",
},
{
name: ["-b", "--byte-offset"],
description:
"Print the 0-based byte offset within the input file before each line of output. If -o (--only-matching) is specified, print the offset of the matching part itself",
},
{
name: ["-H", "--with-filename"],
description:
"Print the file name for each match. This is the default when there is more than one file to search",
},
{
name: ["-h", "--no-filename"],
description:
"Suppress the prefixing of file names on output. This is the default when there is only one file (or only standard input) to search",
},
{
name: "--label",
description:
"Display input actually coming from standard input as input coming from file LABEL. This is especially useful when implementing tools like zgrep, e.g., gzip -cd foo.gz | grep --label=foo -H something",
args: {
name: "LABEL",
},
},
{
name: ["-n", "--line-number"],
description:
"Prefix each line of output with the 1-based line number within its input file. (-n is specified by POSIX.)",
},
{
name: ["-T", "--initial-tab"],
description:
"Make sure that the first character of actual line content lies on a tab stop, so that the alignment of tabs looks normal. This is useful with options that prefix their output to the actual content: -H,-n, and -b. In order to improve the probability that lines from a single file will all start at the same column, this also causes the line number and byte offset (if present) to be printed in a minimum size field width",
},
{
name: ["-u", "--unix-byte-offsets"],
description:
"Report Unix-style byte offsets. This switch causes grep to report byte offsets as if the file were a Unix-style text file, i.e., with CR characters stripped off. This will produce results identical to running grep on a Unix machine. This option has no effect unless -b option is also used; it has no effect on platforms other than MS-DOS and MS -Windows",
},
{
name: "--null",
description:
"Output a zero byte (the ASCII NUL character) instead of the character that normally follows a file name. For example, grep -lZ outputs a zero byte after each file name instead of the usual newline. This option makes the output unambiguous, even in the presence of file names containing unusual characters like newlines. This option can be used with commands like find -print0, perl -0, sort -z, and xargs -0 to process arbitrary file names, even those that contain newline characters",
},
{
name: ["-A", "--after-context"],
description: "Print num lines of trailing context after each match",
args: {
name: "NUM",
},
},
{
name: ["-B", "--before-context"],
description:
"Print num lines of leading context before each match. See also the -A and -C options",
args: {
name: "NUM",
},
},
{
name: ["-C", "--context"],
description:
"Print NUM lines of output context. Places a line containing a group separator (--) between contiguous groups of matches. With the -o or --only-matching option, this has no effect and a warning is given",
args: {
name: "NUM",
},
},
{
name: ["-a", "--text"],
description:
"Treat all files as ASCII text. Normally grep will simply print ``Binary file ... matches'' if files contain binary characters. Use of this option forces grep to output lines matching the specified pattern",
},
{
name: "--binary-files",
description: "Controls searching and printing of binary files",
args: {
name: "value",
default: "binary",
suggestions: [
{
name: "binary",
description: "Search binary files but do not print them",
},
{
name: "without-match",
description: "Do not search binary files",
},
{
name: "text",
description: "Treat all files as text",
},
],
},
},
{
name: ["-D", "--devices"],
description: "Specify the demanded action for devices, FIFOs and sockets",
args: {
name: "action",
default: "read",
suggestions: [
{
name: "read",
description: "Read as if they were normal files",
},
{
name: "skip",
description: "Devices will be silently skipped",
},
],
},
},
{
name: ["-d", "--directories"],
description: "Specify the demanded action for directories",
args: {
name: "action",
default: "read",
suggestions: [
{
name: "read",
description:
"Directories are read in the same manner as normal files",
},
{
name: "skip",
description: "Silently ignore the directories",
},
{
name: "recurse",
description: "Read directories recursively",
},
],
},
},
{
name: "--exclude",
description:
"Note that --exclude patterns take priority over --include patterns, and if no --include pattern is specified, all files are searched that are not excluded. Patterns are matched to the full path specified, not only to the filename component",
args: {
name: "GLOB",
isOptional: true,
},
},
{
name: "--exclude-dir",
description:
"If -R is specified, only directories matching the given filename pattern are searched. Note that --exclude-dir patterns take priority over --include-dir patterns",
isRepeatable: true,
args: {
name: "dir",
template: "folders",
isOptional: true,
},
},
{
name: "-I",
description:
"Ignore binary files. This option is equivalent to --binary-file=without-match option",
},
{
name: "--include",
description:
"If specified, only files matching the given filename pattern are searched. Note that --exclude patterns take priority over --include patterns. Patterns are matched to the full path specified, not only to the filename component",
args: {
name: "GLOB",
isOptional: true,
},
},
{
name: "--include-dir",
description:
"If -R is specified, only directories matching the given filename pattern are searched. Note that --exclude-dir patterns take priority over --include-dir patterns",
args: {
name: "dir",
template: "folders",
isOptional: true,
},
},
{
name: ["-R", "-r", "--recursive"],
description: "Recursively search subdirectories listed",
},
{
name: "--line-buffered",
description:
"Force output to be line buffered. By default, output is line buffered when standard output is a terminal and block buffered otherwise",
},
{
name: ["-U", "--binary"],
description: "Search binary files, but do not attempt to print them",
},
{
name: ["-J", "-bz2decompress"],
description:
"Decompress the bzip2(1) compressed file before looking for the text",
},
{
name: ["-V", "--version"],
description: "Print version number of grep to the standard output stream",
},
{
name: ["-P", "--perl-regexp"],
description: "Interpret pattern as a Perl regular expression",
},
{
name: ["-f", "--file"],
description:
"Obtain patterns from FILE, one per line. The empty file contains zero patterns, and therefore matches nothing. (-f is specified by POSIX.)",
args: {
name: "FILE",
template: "filepaths",
},
},
],
additionalSuggestions: [
{
name: "-RIn",
description:
"Search for a pattern [R]ecursively in the current directory, showing matching line [n]umbers, [I]gnoring non-text files",
insertValue: "-RI{cursor}",
},
{
name: "-Hn",
description:
"Print file name with the corresponding line number (n) for each match",
insertValue: "-H{cursor}",
},
],
};
export default completionSpec;
head.tsextensions/terminal-suggest/src/completions/upstream
AddedMark as viewed
const completionSpec: Fig.Spec = {
name: "head",
description: "Output the first part of files",
args: {
name: "file",
template: "filepaths",
},
options: [
{
name: ["-c", "--bytes"],
description: "Print the first [numBytes] bytes of each file",
args: { name: "numBytes" },
},
{
name: ["-n", "--lines"],
description: "Print the first [numLines] lines instead of the first 10",
args: { name: "numLines" },
},
{
name: ["-q", "--quiet", "--silent"],
description: "Never print headers giving file names",
},
{
name: ["-v", "--verbose"],
description: "Always print headers giving file names",
},
{ name: "--help", description: "Display this help and exit" },
{
name: "--version",
description: "Output version information and exit",
},
],
};
export default completionSpec;
kill.tsextensions/terminal-suggest/src/completions/upstream
AddedMark as viewed
// Compatibility: macOS
function processIcon(path: string): string { const idx = path.indexOf(".app/"); if (idx === -1) { return "fig://icon?type=gear"; } return "fig://" + path.slice(0, idx + 4); }
const completionSpec: Fig.Spec = {
name: "kill",
description: "Terminate or signal a process",
args: {
name: "pid",
isVariadic: true,
generators: {
script: ["bash", "-c", "ps axo pid,comm | sed 1d"],
postProcess: (result: string) => {
return result.split("\n").map((line) => {
const [pid, path] = line.trim().split(/\s+/);
const name = path.slice(path.lastIndexOf("/") + 1);
return {
name: pid,
description: path,
displayName: `${pid} (${name})`,
icon: processIcon(path),
};
});
},
},
},
options: [
{
name: "-s",
description: "A symbolic signal name specifying the signal to be sent",
args: {
name: "signal_name",
generators: {
// Bash's `kill` builtin has different output to /bin/kill
script: ["env", "kill", "-l"],
postProcess: (out) =>
out.match(/\w+/g)?.map((name) => ({
name,
description: `Send ${name} instead of TERM`,
icon: "fig://icon?type=string",
})),
},
},
},
{
name: "-l",
description:
"If no operand is given, list the signal names; otherwise, write the signal name corresponding to exit_status",
args: {
name: "exit_status",
isOptional: true,
},
},
],
};
export default completionSpec;
killall.tsextensions/terminal-suggest/src/completions/upstream
AddedMark as viewed
// Linux incompatible
const signals = [
"hup",
"int",
"quit",
"ill",
"trap",
"abrt",
"emt",
"fpe",
"kill",
"bus",
"segv",
"sys",
"pipe",
"alrm",
// This is the default signal
// "term",
"urg",
"stop",
"tstp",
"cont",
"chld",
"ttin",
"ttou",
"io",
"xcpu",
"xfsz",
"vtalrm",
"prof",
"winch",
"info",
"usr1",
"usr2",
];
const completionSpec: Fig.Spec = {
name: "killall",
description: "Kill processes by name",
args: {
name: "process_name",
isVariadic: true,
generators: {
// All processes, only display the path
script: ["bash", "-c", "ps -A -o comm | sort -u"],
postProcess: (out) =>
out
.trim()
.split("\n")
.map((path) => {
const appExtIndex = path.indexOf(".app/");
const isApp = appExtIndex !== -1;
const name = path.slice(path.lastIndexOf("/") + 1);
const nameChars = new Set(name);
const badChars = ["(", "_", "."];
return {
name,
description: path,
priority:
!badChars.some((char) => nameChars.has(char)) && isApp
? 51
: 40,
icon: isApp
? "fig://" + path.slice(0, appExtIndex + 4)
: "fig://icon?type=gear",
};
}),
},
},
options: [
{
name: "-d",
description: "Be verbose (dry run) and display number of user processes",
},
{
name: "-e",
description:
"Use the effective user ID instead of the real user ID for matching processes with -u",
},
{
name: "-help",
description: "Display help and exit",
},
{
name: "-I",
description: "Request confirmation before killing each process",
},
{
name: "-l",
description: "List the names of the available signals and exit",
},
{
name: "-m",
description: "Match the process name as a regular expression",
},
{
name: "-v",
description: "Be verbose",
},
{
name: "-s",
description: "Be verbose (dry run)",
},
...signals.map((signal) => ({
name: "-SIG" + signal.toUpperCase(),
description: `Send ${signal.toUpperCase()} instead of TERM`,
})),
{
name: "-u",
description:
"Limit potentially matching processes to those belonging to the user",
args: {
name: "user",
generators: {
script: ["bash", "-c", "dscl . -list /Users | grep -v '^_'"],
postProcess: (out) =>
out
.trim()
.split("\n")
.map((username) => ({
name: username,
icon: "fig://template?badge=π€",
})),
},
},
},
{
name: "-t",
description:
"Limit matching processes to those running on the specified TTY",
args: {
name: "tty",
},
},
{
name: "-c",
description: "Limit matching processes to those matching the given name",
args: {
name: "name",
},
},
{
name: "-q",
description: "Suppress error message if no processes are matched",
},
{
name: "-z",
description: "Do not skip zombies",
},
],
};
export default completionSpec;
less.tsextensions/terminal-suggest/src/completions/upstream
AddedMark as viewed
const completionSpec: Fig.Spec = {
name: "less",
description: "Opposite of more",
args: {
isVariadic: true,
template: "filepaths",
},
options: [
{
name: ["-?", "--help"],
description:
'This option displays a summary of the commands accepted by less (the same as the h command). (Depending on how your shell interprets the question mark, it may be necessary to quote the question mark, thus: "-?"',
},
{
name: ["-a", "--search-skip-screen"],
description: `By default, forward searches start at the top of the displayed
screen and backwards searches start at the bottom of the
displayed screen (except for repeated searches invoked by the n
or N commands, which start after or before the "target" line
respectively; see the -j option for more about the target line).
The -a option causes forward searches to instead start at the
bottom of the screen and backward searches to start at the top
of the screen, thus skipping all lines displayed on the screen`,
},
{
name: ["-A", "--SEARCH-SKIP-SCREEN"],
description: `Causes all forward searches (not just non-repeated searches) to
start just after the target line, and all backward searches to
start just before the target line. Thus, forward searches will
skip part of the displayed screen (from the first line up to and
including the target line). Similarly backwards searches will
skip the displayed screen from the last line up to and including
the target line. This was the default behavior in less versions
prior to 441`,
},
{
name: ["-b", "--buffers"],
args: { name: "n" },
description: `Specifies the amount of buffer space less will use for each
file, in units of kilobytes (1024 bytes). By default 64Β KB of
buffer space is used for each file (unless the file is a pipe;
see the -B option). The -b option specifies instead that n
kilobytes of buffer space should be used for each file. If n is
-1, buffer space is unlimited; that is, the entire file can be
read into memory`,
},
{
name: ["-B", "--auto-buffers"],
description: `By default, when data is read from a pipe, buffers are allocated
automatically as needed. If a large amount of data is read from
the pipe, this can cause a large amount of memory to be
allocated. The -B option disables this automatic allocation of
buffers for pipes, so that only 64Β KB (or the amount of space
specified by the -b option) is used for the pipe. Warning: use
of -B can result in erroneous display, since only the most
recently viewed part of the piped data is kept in memory; any
earlier data is lost`,
},
{
name: ["-c", "--clear-screen"],
description: `Causes full screen repaints to be painted from the top line
down. By default, full screen repaints are done by scrolling
from the bottom of the screen`,
},
{
name: ["-C", "--CLEAR-SCREEN"],
description: `Same as -c, for compatibility with older versions of less`,
},
{
name: ["-d", "--dumb"],
description: `The -d option suppresses the error message normally displayed if
the terminal is dumb; that is, lacks some important capability,
such as the ability to clear the screen or scroll backward. The
-d option does not otherwise change the behavior of less on a
dumb terminal`,
},
{
name: ["-D", "--color"],
args: { name: "xcolor" },
description: `Changes the color of different parts of the displayed text. x
is a single character which selects the type of text whose color
is being set:
B Binary characters.
C Control characters.
E Errors and informational messages.
M Mark letters in the status column.
N Line numbers enabled via the -N option.
P Prompts.
R The rscroll character.
S Search results.
W The highlight enabled via the -w option.
d Bold text.
k Blinking text.
s Standout text.
u Underlined text.
The uppercase letters can be used only when the --use-color
option is enabled. When text color is specified by both an
uppercase letter and a lowercase letter, the uppercase letter
takes precedence. For example, error messages are normally
displayed as standout text. So if both "s" and "E" are given a
color, the "E" color applies to error messages, and the "s"
color applies to other standout text. The "d" and "u" letters
refer to bold and underline text formed by overstriking with
backspaces (see the -u option), not to text using ANSI escape
sequences with the -R option.
A lowercase letter may be followed by a + to indicate that both
the normal format change and the specified color should both be
used. For example, -Dug displays underlined text as green
without underlining; the green color has replaced the usual
underline formatting. But -Du+g displays underlined text as
both green and in underlined format.
color is either a 4-bit color string or an 8-bit color string:
A 4-bit color string is zero, one or two characters, where the
first character specifies the foreground color and the second
specifies the background color as follows:
b Blue
c Cyan
g Green
k Black
m Magenta
r Red
w White
y Yellow
The corresponding upper-case letter denotes a brighter shade of
the color. For example, -DNGk displays line numbers as bright
green text on a black background, and -DEbR displays error
messages as blue text on a bright red background. If either
character is a "-" or is omitted, the corresponding color is set
to that of normal text.
An 8-bit color string is one or two decimal integers separated
by a dot, where the first integer specifies the foreground color
and the second specifies the background color. Each integer is
a value between 0 and 255 inclusive which selects a "CSI 38;5"
color value (see
https://en.wikipedia.org/wiki/ANSI\_escape\_code#SGR\_parameters)\
If either integer is a "-" or is omitted, the corresponding
color is set to that of normal text. On MS-DOS versions of
less, 8-bit color is not supported; instead, decimal values are
interpreted as 4-bit CHAR_INFO.Attributes values (see
https://docs.microsoft.com/en-us/windows/console/char-info-str)\`,\
},
{
name: ["-e", "--quit-at-eof"],
description: `Causes less to automatically exit the second time it reaches
end-of-file. By default, the only way to exit less is via the
"q" command`,
},
{
name: ["-E", "--QUIT-AT-EOF"],
description: `Causes less to automatically exit the first time it reaches end-
of-file`,
},
{
name: ["-f", "--force"],
description: `Forces non-regular files to be opened. (A non-regular file is a
directory or a device special file.) Also suppresses the
warning message when a binary file is opened. By default, less
will refuse to open non-regular files. Note that some operating
systems will not allow directories to be read, even if -f is
set`,
},
{
name: ["-F", "--quit-if-one-screen"],
description: `Causes less to automatically exit if the entire file can be
displayed on the first screen`,
},
{
name: ["-g", "--hilite-search"],
description: `Normally, less will highlight ALL strings which match the last
search command. The -g option changes this behavior to
highlight only the particular string which was found by the last
search command. This can cause less to run somewhat faster than
the default`,
},
{
name: ["-G", "--HILITE-SEARCH"],
description: `The -G option suppresses all highlighting of strings found by
search commands`,
},
{
name: ["-h", "--max-back-scroll"],
args: { name: "n" },
description: `Specifies a maximum number of lines to scroll backward. If it
is necessary to scroll backward more than n lines, the screen is
repainted in a forward direction instead. (If the terminal does
not have the ability to scroll backward, -h0 is implied.)`,
},
{
name: ["-i", "--ignore-case"],
description: `Causes searches to ignore case; that is, uppercase and lowercase
are considered identical. This option is ignored if any
uppercase letters appear in the search pattern; in other words,
if a pattern contains uppercase letters, then that search does
not ignore case`,
},
{
name: ["-I", "--IGNORE-CASE"],
description: `Like -i, but searches ignore case even if the pattern contains
uppercase letters`,
},
{
name: ["-j", "--jump-target"],
args: { name: "n" },
description: `Specifies a line on the screen where the "target" line is to be
positioned. The target line is the line specified by any
command to search for a pattern, jump to a line number, jump to
a file percentage or jump to a tag. The screen line may be
specified by a number: the top line on the screen is 1, the next
is 2, and so on. The number may be negative to specify a line
relative to the bottom of the screen: the bottom line on the
screen is -1, the second to the bottom is -2, and so on.
Alternately, the screen line may be specified as a fraction of
the height of the screen, starting with a decimal point: .5 is
in the middle of the screen, .3 is three tenths down from the
first line, and so on. If the line is specified as a fraction,
the actual line number is recalculated if the terminal window is
resized, so that the target line remains at the specified
fraction of the screen height. If any form of the -j option is
used, repeated forward searches (invoked with "n" or "N") begin
at the line immediately after the target line, and repeated
backward searches begin at the target line, unless changed by -a
or -A. For example, if "-j4" is used, the target line is the
fourth line on the screen, so forward searches begin at the
fifth line on the screen. However nonrepeated searches (invoked
with "/" or "?") always begin at the start or end of the current
screen respectively`,
},
{
name: ["-J", "--status-column"],
description: `Displays a status column at the left edge of the screen. The
status column shows the lines that matched the current search,
and any lines that are marked (via the m or M command)`,
},
{
name: ["-k", "--lesskey-file"],
args: { name: "filename", template: "filepaths" },
description: `Causes less to open and interpret the named file as a lesskey(1)
file. Multiple -k options may be specified. If the LESSKEY or
LESSKEY_SYSTEM environment variable is set, or if a lesskey file
is found in a standard place (see KEY BINDINGS), it is also used
as a lesskey file`,
},
{
name: ["-K", "--quit-on-intr"],
description: `Causes less to exit immediately (with status 2) when an
interrupt character (usually ^C) is typed. Normally, an
interrupt character causes less to stop whatever it is doing and
return to its command prompt. Note that use of this option
makes it impossible to return to the command prompt from the "F"
command`,
},
{
name: ["-L", "--no-lessopen"],
description: `Ignore the LESSOPEN environment variable (see the INPUT
PREPROCESSOR section below). This option can be set from within
less, but it will apply only to files opened subsequently, not
to the file which is currently open`,
},
{
name: ["-m", "--long-prompt"],
description: `Causes less to prompt verbosely (like more), with the percent
into the file. By default, less prompts with a colon`,
},
{
name: ["-M", "--LONG-PROMPT"],
description: `Causes less to prompt even more verbosely than more`,
},
{
name: ["-n", "--line-numbers"],
description: `Suppresses line numbers. The default (to use line numbers) may
cause less to run more slowly in some cases, especially with a
very large input file. Suppressing line numbers with the -n
option will avoid this problem. Using line numbers means: the
line number will be displayed in the verbose prompt and in the =
command, and the v command will pass the current line number to
the editor (see also the discussion of LESSEDIT in PROMPTS
below)`,
},
{
name: ["-N", "--LINE-NUMBERS"],
description: `Causes a line number to be displayed at the beginning of each
line in the display`,
},
{
name: ["-o", "--log-file"],
args: { name: "filename", template: "filepaths" },
description: `Causes less to copy its input to the named file as it is being
viewed. This applies only when the input file is a pipe, not an
ordinary file. If the file already exists, less will ask for
confirmation before overwriting it`,
},
{
name: ["-O", "--LOG-FILE"],
args: { name: "filename", template: "filepaths" },
description: `The -O option is like -o, but it will overwrite an existing file
without asking for confirmation.
If no log file has been specified, the -o and -O options can be
used from within less to specify a log file. Without a file
name, they will simply report the name of the log file. The "s"
command is equivalent to specifying -o from within less`,
},
{
name: ["-p", "--pattern"],
args: { name: "pattern" },
description: `The -p option on the command line is equivalent to specifying
+/pattern; that is, it tells less to start at the first
occurrence of pattern in the file`,
},
{
name: ["-P", "--prompt"],
args: { name: "prompt" },
description: `Provides a way to tailor the three prompt styles to your own
preference. This option would normally be put in the LESS
environment variable, rather than being typed in with each less
command. Such an option must either be the last option in the
LESS variable, or be terminated by a dollar sign.
-Ps followed by a string changes the default (short) prompt to
that string.
-Pm changes the medium (-m) prompt.
-PM changes the long (-M) prompt.
-Ph changes the prompt for the help screen.
-P= changes the message printed by the = command.
-Pw changes the message printed while waiting for data (in the
F command).
All prompt strings consist of a sequence of letters and special
escape sequences. See the section on PROMPTS for more details`,
},
{
name: ["-q", "--quiet", "--silent"],
description: `Causes moderately "quiet" operation: the terminal bell is not
rung if an attempt is made to scroll past the end of the file or
before the beginning of the file. If the terminal has a "visual
bell", it is used instead. The bell will be rung on certain
other errors, such as typing an invalid character. The default
is to ring the terminal bell in all such cases`,
},
{
name: ["-Q", "--QUIET", "--SILENT"],
description: `Causes totally "quiet" operation: the terminal bell is never
rung. If the terminal has a "visual bell", it is used in all
cases where the terminal bell would have been rung`,
},
{
name: ["-r", "--raw-control-chars"],
description: `Causes "raw" control characters to be displayed. The default is
to display control characters using the caret notation; for
example, a control-A (octal 001) is displayed as "^A". Warning:
when the -r option is used, less cannot keep track of the actual
appearance of the screen (since this depends on how the screen
responds to each type of control character). Thus, various
display problems may result, such as long lines being split in
the wrong place.
USE OF THE -r OPTION IS NOT RECOMMENDED`,
},
{
name: ["-R", "--RAW-CONTROL-CHARS"],
description: `Like -r, but only ANSI "color" escape sequences and OSC 8
hyperlink sequences are output in "raw" form. Unlike -r, the
screen appearance is maintained correctly, provided that there
are no escape sequences in the file other than these types of
escape sequences. Color escape sequences are only supported
when the color is changed within one line, not across lines. In
other words, the beginning of each line is assumed to be normal
(non-colored), regardless of any escape sequences in previous
lines. For the purpose of keeping track of screen appearance,
these escape sequences are assumed to not move the cursor.
OSC 8 hyperlinks are sequences of the form:
ESC ] 8 ;
ANSI color escape sequences are sequences of the form:
ESC [ ... m
where the "..." is zero or more color specification characters.
You can make less think that characters other than "m" can end
ANSI color escape sequences by setting the environment variable
LESSANSIENDCHARS to the list of characters which can end a color
escape sequence. And you can make less think that characters
other than the standard ones may appear between the ESC and the
m by setting the environment variable LESSANSIMIDCHARS to the
list of characters which can appear`,
},
{
name: ["-s", "--squeeze-blank-lines"],
description: `Causes consecutive blank lines to be squeezed into a single
blank line. This is useful when viewing nroff output`,
},
{
name: ["-S", "--chop-long-lines"],
description: `Causes lines longer than the screen width to be chopped
(truncated) rather than wrapped. That is, the portion of a long
line that does not fit in the screen width is not displayed
until you press RIGHT-ARROW. The default is to wrap long lines;
that is, display the remainder on the next line`,
},
{
name: ["-t", "--tag"],
args: { name: "tag" },
description: `The -t option, followed immediately by a TAG, will edit the file
containing that tag. For this to work, tag information must be
available; for example, there may be a file in the current
directory called "tags", which was previously built by ctags(1)
or an equivalent command. If the environment variable
LESSGLOBALTAGS is set, it is taken to be the name of a command
compatible with global(1), and that command is executed to find
the tag. (See http://www.gnu.org/software/global/global.html).\
The -t option may also be specified from within less (using the
- command) as a way of examining a new file. The command ":t"
is equivalent to specifying -t from within less`,
},
{
name: ["-T", "--tag-file"],
args: { name: "tagsfile" },
description: `Specifies a tags file to be used instead of "tags"`,
},
{
name: ["-u", "--underline-special"],
description: `Causes backspaces and carriage returns to be treated as
printable characters; that is, they are sent to the terminal
when they appear in the input`,
},
{
name: ["-U", "--UNDERLINE-SPECIAL"],
description: `Causes backspaces, tabs, carriage returns and "formatting
characters" (as defined by Unicode) to be treated as control
characters; that is, they are handled as specified by the -r
option.
By default, if neither -u nor -U is given, backspaces which
appear adjacent to an underscore character are treated
specially: the underlined text is displayed using the terminal's
hardware underlining capability. Also, backspaces which appear
between two identical characters are treated specially: the
overstruck text is printed using the terminal's hardware
boldface capability. Other backspaces are deleted, along with
the preceding character. Carriage returns immediately followed
by a newline are deleted. Other carriage returns are handled as
specified by the -r option. Unicode formatting characters, such
as the Byte Order Mark, are sent to the terminal. Text which is
overstruck or underlined can be searched for if neither -u nor
-U is in effect`,
},
{
name: ["-V", "--version"],
description: `Displays the version number of less`,
},
{
name: ["-w", "--hilite-unread"],
description: `Temporarily highlights the first "new" line after a forward
movement of a full page. The first "new" line is the line
immediately following the line previously at the bottom of the
screen. Also highlights the target line after a g or p command.
The highlight is removed at the next command which causes
movement. The entire line is highlighted, unless the -J option
is in effect, in which case only the status column is
highlighted`,
},
{
name: ["-W", "--HILITE-UNREAD"],
description: `Like -w, but temporarily highlights the first new line after any
forward movement command larger than one line`,
},
{
name: ["-x", "--tabs="],
args: { name: "n,..." },
description: `Sets tab stops. If only one n is specified, tab stops are set
at multiples of n. If multiple values separated by commas are
specified, tab stops are set at those positions, and then
continue with the same spacing as the last two. For example,
-x9,17 will set tabs at positions 9, 17, 25, 33, etc. The
default for n is 8`,
},
{
name: ["-X", "--no-init"],
description: `Disables sending the termcap initialization and deinitialization
strings to the terminal. This is sometimes desirable if the
deinitialization string does something unnecessary, like
clearing the screen`,
},
{
name: ["-y", "--max-forw-scroll"],
args: { name: "n" },
description: `Specifies a maximum number of lines to scroll forward. If it is
necessary to scroll forward more than n lines, the screen is
repainted instead. The -c or -C option may be used to repaint
from the top of the screen if desired. By default, any forward
movement causes scrolling`,
},
{
name: ["-z", "--window"],
args: { name: "n" },
description: `Changes the default scrolling window size to n lines. The
default is one screenful. The z and w commands can also be used
to change the window size. The "z" may be omitted for
compatibility with some versions of more. If the number n is
negative, it indicates n lines less than the current screen
size. For example, if the screen is 24 lines, -z-4 sets the
scrolling window to 20 lines. If the screen is resized to 40
lines, the scrolling window automatically changes to 36 lines`,
},
{
name: "--quotes",
description: `Changes the filename quoting character. This may be necessary
if you are trying to name a file which contains both spaces and
quote characters. Followed by a single character, this changes
the quote character to that character. Filenames containing a
space should then be surrounded by that character rather than by
double quotes. Followed by two characters, changes the open
quote to the first character, and the close quote to the second
character. Filenames containing a space should then be preceded
by the open quote character and followed by the close quote
character. Note that even after the quote characters are
changed, this option remains -" (a dash followed by a double
quote)`,
},
{
name: ["-", "--tilde"],). This option causes lines after end of file to be displayed
description: `Normally lines after end of file are displayed as a single tilde
(
as blank lines`,
},
{
name: ["-#", "--shift"],
description: `Specifies the default number of positions to scroll horizontally
in the RIGHTARROW and LEFTARROW commands. If the number
specified is zero, it sets the default number of positions to
one half of the screen width. Alternately, the number may be
specified as a fraction of the width of the screen, starting
with a decimal point: .5 is half of the screen width, .3 is
three tenths of the screen width, and so on. If the number is
specified as a fraction, the actual number of scroll positions
is recalculated if the terminal window is resized, so that the
actual scroll remains at the specified fraction of the screen
width`,
},
{
name: "--follow-name",
description: `Normally, if the input file is renamed while an F command is
executing, less will continue to display the contents of the
original file despite its name change. If --follow-name is
specified, during an F command less will periodically attempt to
reopen the file by name. If the reopen succeeds and the file is
a different file from the original (which means that a new file
has been created with the same name as the original (now
renamed) file), less will display the contents of that new file`,
},
{
name: "--incsearch",
description: `Subsequent search commands will be "incremental"; that is, less
will advance to the next line containing the search pattern as
each character of the pattern is typed in`,
},
{
name: "--line-num-width",
description: `Sets the minimum width of the line number field when the -N
option is in effect. The default is 7 characters`,
},
{
name: "--mouse",
description: `Enables mouse input: scrolling the mouse wheel down moves
forward in the file, scrolling the mouse wheel up moves
backwards in the file, and clicking the mouse sets the "#" mark
to the line where the mouse is clicked. The number of lines to
scroll when the wheel is moved can be set by the --wheel-lines
option. Mouse input works only on terminals which support X11
mouse reporting, and on the Windows version of less`,
},
{
name: "--MOUSE",
description: `Like --mouse, except the direction scrolled on mouse wheel
movement is reversed`,
},
{
name: "--no-keypad",
description: `Disables sending the keypad initialization and deinitialization
strings to the terminal. This is sometimes useful if the keypad
strings make the numeric keypad behave in an undesirable manner`,
},
{
name: "--no-histdups",
description: `This option changes the behavior so that if a search string or
file name is typed in, and the same string is already in the
history list, the existing copy is removed from the history list
before the new one is added. Thus, a given string will appear
only once in the history list. Normally, a string may appear
multiple times`,
},
{
name: "--rscroll",
description: `This option changes the character used to mark truncated lines.
It may begin with a two-character attribute indicator like
LESSBINFMT does. If there is no attribute indicator, standout
is used. If set to "-", truncated lines are not marked`,
},
{
name: "--save-marks",
description: `Save marks in the history file, so marks are retained across
different invocations of less`,
},
{
name: "--status-col-width",
description: `Sets the width of the status column when the -J option is in
effect. The default is 2 characters`,
},
{
name: "--use-backslash",
description: `This option changes the interpretations of options which follow
this one. After the --use-backslash option, any backslash in an
option string is removed and the following character is taken
literally. This allows a dollar sign to be included in option
strings`,
},
{
name: "--use-color",
description: `Enables the colored text in various places. The -D option can
be used to change the colors. Colored text works only if the
terminal supports ANSI color escape sequences (as defined in
ECMA-48 SGR; see
https://www.ecma-international.org/publications-and-\
standards/standards/ecma-48)`,
},
{
name: "--wheel-lines",
args: { name: "n" },
description: `Set the number of lines to scroll when the mouse wheel is rolled`,
},
],
};
export default completionSpec;
more.tsextensions/terminal-suggest/src/completions/upstream
AddedMark as viewed
const completionSpec: Fig.Spec = {
name: "more",
description: "Opposite of less",
options: [
{
name: ["-d", "--silent"],
description:
"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",
},
{
name: ["-l", "--logical"],
description: "Do not pause after any line containing a ^L (form feed)",
},
{
name: ["-f", "--no-pause"],
description: "Count logical lines, rather than screen lines",
},
{
name: ["-p", "--print-over"],
description: "Instead, clear the whole screen and then display the text",
},
{
name: ["-c", "--clean-print"],
description:
"Instead, paint each screen from the top, clearing the remainder of each line as it is displayed",
},
{
name: ["-s", "--squeeze"],
description: "Squeeze multiple blank lines into one",
},
{
name: ["-u", "--plain"],
description: "Silently ignored as backwards compatibility",
},
{
name: ["-n", "--lines"],
description: "Specify the number of lines per screenful",
args: { name: "n" },
},
{
name: "--help",
description: "Display help text",
},
{
name: ["-V", "--version"],
description: "Display version information",
},
],
args: {
isVariadic: true,
template: "filepaths",
},
};
export default completionSpec;
mv.tsextensions/terminal-suggest/src/completions/upstream
AddedMark as viewed
const completionSpec: Fig.Spec = {
name: "mv",
description: "Move & rename files and folders",
args: [
{
name: "source",
isVariadic: true,
template: ["filepaths", "folders"],
},
{
name: "target",
template: ["filepaths", "folders"],
},
],
options: [
{
name: "-f",
description:
"Do not prompt for confirmation before overwriting the destination path",
exclusiveOn: ["-i", "-n"],
},
{
name: "-i",
description:
"Cause mv to write a prompt to standard error before moving a file that would overwrite an existing file",
exclusiveOn: ["-f", "-n"],
},
{
name: "-n",
description: "Do not overwrite existing file",
exclusiveOn: ["-f", "-i"],
},
{
name: "-v",
description: "Cause mv to be verbose, showing files after they are moved",
},
],
};
export default completionSpec;
nano.tsextensions/terminal-suggest/src/completions/upstream
AddedMark as viewed
const completionSpec: Fig.Spec = { name: "nano", description: "Nano's ANOther editor, an enhanced free Pico clone", args: { template: "filepaths", }, };
export default completionSpec;
node.tsextensions/terminal-suggest/src/completions/upstream
AddedMark as viewed
// import { filepaths } from "@fig/autocomplete-generators";
const completionSpec: Fig.Subcommand = {
name: "node",
description: "Run the node interpreter",
args: {
name: "node script",
isScript: true,
template: 'folders',
// generators: filepaths({
// extensions: ["mjs", "js", "cjs"],
// editFileSuggestions: { priority: 76 },
// }),
},
options: [
{
name: ["-e", "--eval=..."],
insertValue: "-e '{cursor}'",
description: "Evaluate script",
args: {},
},
{
name: "--watch",
description: "Watch input files",
},
{
name: "--watch-path",
description: "Specify a watch directory or file",
args: {
name: "path",
template: "filepaths",
},
isRepeatable: true,
},
{
name: "--watch-preserve-output",
description:
"Disable the clearing of the console when watch mode restarts the process",
dependsOn: ["--watch", "--watch-path"],
},
{
name: "--env-file",
description: "Specify a file containing environment variables",
args: {
name: "path",
template: "filepaths",
},
isRepeatable: true,
},
{
name: ["-p", "--print"],
description: "Evaluate script and print result",
},
{
name: ["-c", "--check"],
description: "Syntax check script without executing",
},
{
name: ["-v", "--version"],
description: "Print Node.js version",
},
{
name: ["-i", "--interactive"],
description:
"Always enter the REPL even if stdin does not appear to be a terminal",
},
{
name: ["-h", "--help"],
description: "Print node command line options (currently set)",
},
{
name: "--inspect",
requiresSeparator: true,
args: {
name: "[host:]port",
isOptional: true,
},
description: "Activate inspector on host:port (default: 127.0.0.1:9229)",
},
{
name: "--preserve-symlinks",
description:
"Follows symlinks to directories when examining source code and templates for translation strings",
},
],
// generateSpec: async (tokens, executeShellCommand) => {
// const isAdonisJsonPresentCommand = "test -f .adonisrc.json";
// if (
// (
// await executeShellCommand({
// command: "bash",
// args: ["-c", "isAdonisJsonPresentCommand"],
// })
// ).status === 0
// ) {
// return {
// name: "node",
// subcommands: [
// {
// name: "ace",
// description: "Run AdonisJS command-line",
// options: [
// {
// name: ["-h", "--help"],
// description: "Display AdonisJS Ace help",
// },
// {
// name: ["-v", "--version"],
// description: "Display AdonisJS version",
// },
// ],
// subcommands: [
// {
// name: "build",
// description:
// "Compile project from Typescript to Javascript. Also compiles the frontend assets if using webpack encore",
// options: [
// {
// name: ["-prod", "--production"],
// description: "Build for production",
// },
// {
// name: "--assets",
// description:
// "Build frontend assets when webpack encore is installed",
// },
// {
// name: "--no-assets",
// description: "Disable building assets",
// },
// {
// name: "--ignore-ts-errors",
// description:
// "Ignore typescript errors and complete the build process",
// },
// {
// name: "--tsconfig",
// description:
// "Path to the TypeScript project configuration file",
// args: {
// name: "path",
// description: "Path to tsconfig.json",
// },
// },
// {
// name: "--encore-args",
// requiresSeparator: true,
// insertValue: "--encore-args='{cursor}'",
// description:
// "CLI options to pass to the encore command line",
// },
// {
// name: "--client",
// args: {
// name: "name",
// },
// description:
// "Select the package manager to decide which lock file to copy to the build folder",
// },
// ],
// },
// {
// name: ["configure", "invoke"],
// description: "Configure a given AdonisJS package",
// args: {
// name: "name",
// description: "Name of the package you want to configure",
// },
// subcommands: [
// {
// name: "@adonisjs/auth",
// description: "Trigger auto configuring auth package",
// },
// {
// name: "@adonisjs/shield",
// description: "Trigger auto configuring shield package",
// },
// {
// name: "@adonisjs/redis",
// description: "Trigger auto configuring redis package",
// },
// {
// name: "@adonisjs/mail",
// description: "Trigger auto configuring mail package",
// },
// ],
// },
// {
// name: "repl",
// description: "Start a new REPL session",
// },
// {
// name: "serve",
// description:
// "Start the AdonisJS HTTP server, along with the file watcher. Also starts the webpack dev server when webpack encore is installed",
// options: [
// {
// name: "--assets",
// description:
// "Start webpack dev server when encore is installed",
// },
// {
// name: "--no-assets",
// description: "Disable webpack dev server",
// },
// {
// name: ["-w", "--watch"],
// description:
// "Watch for file changes and re-start the HTTP server on change",
// },
// {
// name: ["-p", "--poll"],
// description:
// "Detect file changes by polling files instead of listening to filesystem events",
// },
// {
// name: "--node-args",
// requiresSeparator: true,
// insertValue: "--node-args='{cursor}'",
// description: "CLI options to pass to the node command line",
// },
// {
// name: "--encore-args",
// requiresSeparator: true,
// insertValue: "--encore-args='{cursor}'",
// description:
// "CLI options to pass to the encore command line",
// },
// ],
// },
// {
// name: "db:seed",
// description: "Execute database seeder files",
// options: [
// {
// name: ["-c", "--connection"],
// description:
// "Define a custom database connection for the seeders",
// args: {
// name: "name",
// },
// },
// {
// name: ["-i", "--interactive"],
// description: "Run seeders in interactive mode",
// },
// {
// name: ["-f", "--files"],
// args: {
// name: "file",
// isVariadic: true,
// template: "filepaths",
// },
// description:
// "Define a custom set of seeders files names to run",
// },
// ],
// },
// {
// name: "dump:rcfile",
// description:
// "Dump contents of .adonisrc.json file along with defaults",
// },
// {
// name: "generate:key",
// description: "Generate a new APP_KEY secret",
// },
// {
// name: "generate:manifest",
// description:
// "Generate ace commands manifest file. Manifest file speeds up commands lookup",
// },
// {
// name: "list:routes",
// description: "List application routes",
// },
// {
// name: "make:command",
// description: "Make a new ace command",
// },
// {
// name: "make:controller",
// description: "Make a new HTTP controller",
// args: {
// name: "name",
// description: "Name of the controller class",
// },
// options: [
// {
// name: ["-r", "--resource"],
// description:
// "Add resourceful methods to the controller class",
// },
// {
// name: ["-e", "--exact"],
// description:
// "Create the controller with the exact name as provided",
// },
// ],
// },
// {
// name: "make:exception",
// description: "Make a new custom exception class",
// },
// {
// name: "make:listener",
// description: "Make a new event listener class",
// },
// {
// name: "make:mailer",
// description: "Make a new mailer class",
// args: {
// name: "name",
// description: "Mailer class name",
// },
// },
// {
// name: "make:middleware",
// description: "Make a new middleware",
// args: {
// name: "name",
// description: "Middleware class name",
// },
// },
// {
// name: "make:migration",
// description: "Make a new migration file",
// args: {
// name: "name",
// description: "Name of the migration file",
// },
// options: [
// {
// name: "--connection",
// description:
// "The connection flag is used to lookup the directory for the migration file",
// args: {
// name: "name",
// },
// },
// {
// name: "--folder",
// description: "Pre-select a migration directory",
// args: {
// name: "name",
// template: "filepaths",
// },
// },
// {
// name: "--create",
// description:
// "Define the table name for creating a new table",
// args: {
// name: "name",
// },
// },
// {
// name: "--table",
// description:
// "Define the table name for altering an existing table",
// args: {
// name: "name",
// },
// },
// ],
// },
// {
// name: "make:model",
// description: "Make a new Lucid model",
// args: {
// name: "name",
// description: "Name of the model class",
// },
// options: [
// {
// name: ["-m", "--migration"],
// description: "Generate the migration for the model",
// },
// {
// name: ["-c", "--controller"],
// description: "Generate the controller for the model",
// },
// ],
// },
// {
// name: "make:prldfile",
// description: "Make a new preload file",
// subcommands: [
// {
// name: "events",
// description: "Make events preload file",
// },
// ],
// },
// {
// name: "make:provider",
// description: "Make a new provider class",
// },
// {
// name: "make:seeder",
// description: "Make a new Seeder file",
// args: {
// name: "name",
// description: "Name of the seeder class",
// },
// },
// {
// name: "make:validator",
// description: "Make a new validator",
// args: {
// name: "name",
// description: "Name of the validator class",
// },
// options: [
// {
// name: ["-e", "--exact"],
// description:
// "Create the validator with the exact name as provided",
// },
// ],
// },
// {
// name: "make:view",
// description: "Make a new view template",
// args: {
// name: "name",
// description: "Name of the view",
// },
// options: [
// {
// name: ["-e", "--exact"],
// description:
// "Create the template file with the exact name as provided",
// },
// ],
// },
// {
// name: "migration:rollback",
// description: "Rollback migrations to a given batch number",
// options: [
// {
// name: ["-c", "--connection"],
// description: "Define a custom database connection",
// args: {
// name: "name",
// },
// },
// {
// name: "--force",
// description:
// "Explicitly force to run migrations in production",
// isDangerous: true,
// },
// {
// name: "--dry-run",
// description:
// "Print SQL queries, instead of running the migrations",
// },
// {
// name: "--batch",
// args: {
// name: "number",
// description: "Use 0 to rollback to initial state",
// },
// description: "Define custom batch number for rollback",
// },
// ],
// },
// {
// name: "migration:run",
// description: "Run pending migrations",
// options: [
// {
// name: ["-c", "--connection"],
// description: "Define a custom database connection",
// args: {
// name: "name",
// },
// },
// {
// name: "--force",
// description:
// "Explicitly force to run migrations in production",
// isDangerous: true,
// },
// {
// name: "--dry-run",
// description:
// "Print SQL queries, instead of running the migrations",
// },
// ],
// },
// {
// name: "migration:status",
// description: "Check migrations current status",
// },
// ],
// },
// ],
// };
// }
// },
};
export default completionSpec;
npm.tsextensions/terminal-suggest/src/completions/upstream
AddedMark as viewed
function uninstallSubcommand(named: string | string[]): Fig.Subcommand { return { name: named, description: "Uninstall a package", args: { name: "package", generators: dependenciesGenerator, filterStrategy: "fuzzy", isVariadic: true, }, options: npmUninstallOptions, }; }
const atsInStr = (s: string) => (s.match(/@/g) || []).length;
export const createNpmSearchHandler = (keywords?: string[]) => async ( context: string[], executeShellCommand: Fig.ExecuteCommandFunction, shellContext: Fig.ShellContext ): Promise<Fig.Suggestion[]> => { const searchTerm = context[context.length - 1]; if (searchTerm === "") { return []; } // Add optional keyword parameter const keywordParameter = keywords && keywords.length > 0 ? `+keywords:${keywords.join(",")}` : "";
const queryPackagesUrl = keywordParameter ? `https://api.npms.io/v2/search?size=20&q=${searchTerm}${keywordParameter}\` : `https://api.npms.io/v2/search/suggestions?q=${searchTerm}&size=20\`;
// Query the API with the package name
const queryPackages = [
"-s",
"-H",
"Accept: application/json",
queryPackagesUrl,
];
// We need to remove the '@' at the end of the searchTerm before querying versions
const queryVersions = [
"-s",
"-H",
"Accept: application/vnd.npm.install-v1+json",
`https://registry.npmjs.org/${searchTerm.slice(0, -1)}`,
];
// If the end of our token is '@', then we want to generate version suggestions
// Otherwise, we want packages
const out = (query: string) =>
executeShellCommand({
command: "curl",
args: query[query.length - 1] === "@" ? queryVersions : queryPackages,
});
// If our token starts with '@', then a 2nd '@' tells us we want
// versions.
// Otherwise, '@' anywhere else in the string will indicate the same.
const shouldGetVersion = searchTerm.startsWith("@")
? atsInStr(searchTerm) > 1
: searchTerm.includes("@");
try { const data = JSON.parse((await out(searchTerm)).stdout); if (shouldGetVersion) { // create dist tags suggestions const versions = Object.entries(data["dist-tags"] || {}).map( ([key, value]) => ({ name: key, description: value, }) ) as Fig.Suggestion[]; // create versions versions.push( ...Object.keys(data.versions) .map((version) => ({ name: version }) as Fig.Suggestion) .reverse() ); return versions; }
const results = keywordParameter ? data.results : data; return results.map((item: any) => ({ name: item.package.name, description: item.package.description, })) as Fig.Suggestion[]; } catch (error) { console.error({ error }); return []; } };
// GENERATORS export const npmSearchGenerator: Fig.Generator = { trigger: (newToken, oldToken) => { // If the package name starts with '@', we want to trigger when // the 2nd '@' is typed because we'll need to generate version // suggetsions // e.g. @typescript-eslint/types if (oldToken.startsWith("@")) { return !(atsInStr(oldToken) > 1 && atsInStr(newToken) > 1); }
// If the package name doesn't start with '@', then trigger when // we see the first '@' so we can generate version suggestions return !(oldToken.includes("@") && newToken.includes("@")); }, getQueryTerm: "@", cache: { ttl: 1000 * 60 * 60 * 24 * 2, // 2 days }, custom: createNpmSearchHandler(), };
const workspaceGenerator: Fig.Generator = { // script: "cat $(npm prefix)/package.json", custom: async (tokens, executeShellCommand) => { const { stdout: npmPrefix } = await executeShellCommand({ command: "npm", // eslint-disable-next-line @withfig/fig-linter/no-useless-arrays args: ["prefix"], });
const { stdout: out } = await executeShellCommand({ command: "cat", // eslint-disable-next-line @withfig/fig-linter/no-useless-arrays args: [`${npmPrefix}/package.json`], });
const suggestions: Fig.Suggestion[] = []; try { if (out.trim() == "") { return suggestions; }
const packageContent = JSON.parse(out); const workspaces = packageContent["workspaces"];
if (workspaces) { for (const workspace of workspaces) { suggestions.push({ name: workspace, description: "Workspaces", }); } } } catch (e) { console.log(e); } return suggestions; }, };
/\\ Generator that lists package.json dependencies */ export const dependenciesGenerator: Fig.Generator = { trigger: (newToken) => newToken === "-g" || newToken === "--global", custom: async function (tokens, executeShellCommand) { if (!tokens.includes("-g") && !tokens.includes("--global")) { const { stdout: npmPrefix } = await executeShellCommand({ command: "npm", // eslint-disable-next-line @withfig/fig-linter/no-useless-arrays args: ["prefix"], }); const { stdout: out } = await executeShellCommand({ command: "cat", // eslint-disable-next-line @withfig/fig-linter/no-useless-arrays args: [`${npmPrefix}/package.json`], }); const packageContent = JSON.parse(out); const dependencies = packageContent["dependencies"] ?? {}; const devDependencies = packageContent["devDependencies"]; const optionalDependencies = packageContent["optionalDependencies"] ?? {}; Object.assign(dependencies, devDependencies, optionalDependencies);
return Object.keys(dependencies) .filter((pkgName) => { const isListed = tokens.some((current) => current === pkgName); return !isListed; }) .map((pkgName) => ({ name: pkgName, icon: "π¦", description: dependencies[pkgName] ? "dependency" : optionalDependencies[pkgName] ? "optionalDependency" : "devDependency", })); } else { const { stdout } = await executeShellCommand({ command: "bash", args: ["-c", "ls -1 `npm root -g`"], }); return stdout.split("\n").map((name) => ({ name, icon: "π¦", description: "Global dependency", })); } }, };
/\\ Generator that lists package.json scripts (with the respect to the `fig` field) */
export const npmScriptsGenerator: Fig.Generator = {
cache: {
strategy: "stale-while-revalidate",
cacheByDirectory: true,
},
script: [
"bash",
"-c",
"until [[ -f package.json ]] || [[ $PWD = '/' ]]; do cd ..; done; cat package.json",
],
postProcess: function (out, [npmClient]) {
if (out.trim() == "") {
return [];
}
try { const packageContent = JSON.parse(out); const scripts = packageContent["scripts"]; const figCompletions = packageContent["fig"] || {};
if (scripts) { return Object.entries(scripts).map(([scriptName, scriptContents]) => { const icon = npmClient === "yarn" ? "fig://icon?type=yarn" : "fig://icon?type=npm"; const customScripts: Fig.Suggestion = figCompletions[scriptName]; return { name: scriptName, icon, description: scriptContents as string, priority: 51, /\\ \* If there are custom definitions for the scripts \* we want to override the default values \* */ ...customScripts, }; }); } } catch (e) { console.error(e); }
return []; }, };
const globalOption: Fig.Option = { name: ["-g", "--global"], description: "Operates in 'global' mode, so that packages are installed into the prefix folder instead of the current working directory", };
const jsonOption: Fig.Option = { name: "--json", description: "Show output in json format", };
const omitOption: Fig.Option = { name: "--omit", description: "Dependency types to omit from the installation tree on disk", args: { name: "Package type", default: "dev", suggestions: ["dev", "optional", "peer"], }, isRepeatable: 3, };
const parseableOption: Fig.Option = { name: ["-p", "--parseable"], description: "Output parseable results from commands that write to standard output", };
const longOption: Fig.Option = { name: ["-l", "--long"], description: "Show extended information", };
const workSpaceOptions: Fig.Option[] = [
{
name: ["-w", "--workspace"],
description:
"Enable running a command in the context of the configured workspaces of the current project",
args: {
name: "workspace",
generators: workspaceGenerator,
isVariadic: true,
},
},
{
name: ["-ws", "--workspaces"],
description:
"Enable running a command in the context of all the configured workspaces",
},
];
const npmUninstallOptions: Fig.Option[] = [
{
name: ["-S", "--save"],
description: "Package will be removed from your dependencies",
},
{
name: ["-D", "--save-dev"],
description: "Package will appear in your `devDependencies`",
},
{
name: ["-O", "--save-optional"],
description: "Package will appear in your `optionalDependencies`",
},
{
name: "--no-save",
description: "Prevents saving to `dependencies`",
},
{
name: "-g",
description: "Uninstall global package",
},
...workSpaceOptions,
];
const npmListOptions: Fig.Option[] = [
{
name: ["-a", "-all"],
description: "Show all outdated or installed packages",
},
jsonOption,
longOption,
parseableOption,
{
name: "--depth",
description: "The depth to go when recursing packages",
args: { name: "depth" },
},
{
name: "--link",
description: "Limits output to only those packages that are linked",
},
{
name: "--package-lock-only",
description:
"Current operation will only use the package-lock.json, ignoring node_modules",
},
{
name: "--no-unicode",
description: "Uses unicode characters in the tree output",
},
globalOption,
omitOption,
...workSpaceOptions,
];
const registryOption: Fig.Option = { name: "--registry", description: "The base URL of the npm registry", args: { name: "registry" }, };
const verboseOption: Fig.Option = { name: "--verbose", description: "Show extra information", args: { name: "verbose" }, };
const otpOption: Fig.Option = { name: "--otp", description: "One-time password from a two-factor authenticator", args: { name: "otp" }, };
const ignoreScriptsOption: Fig.Option = { name: "--ignore-scripts", description: "If true, npm does not run scripts specified in package.json files", };
const scriptShellOption: Fig.Option = {
name: "--script-shell",
description:
"The shell to use for scripts run with the npm exec, npm run and npm init
const dryRunOption: Fig.Option = { name: "--dry-run", description: "Indicates that you don't want npm to make any changes and that it should only report what it would have done", };
const completionSpec: Fig.Spec = {
name: "npm",
parserDirectives: {
flagsArePosixNoncompliant: true,
},
description: "Node package manager",
subcommands: [
{
name: ["install", "i", "add"],
description: "Install a package and its dependencies",
args: {
name: "package",
isOptional: true,
generators: npmSearchGenerator,
debounce: true,
isVariadic: true,
},
options: [
{
name: ["-P", "--save-prod"],
description:
"Package will appear in your `dependencies`. This is the default unless `-D` or `-O` are present",
},
{
name: ["-D", "--save-dev"],
description: "Package will appear in your `devDependencies`",
},
{
name: ["-O", "--save-optional"],
description: "Package will appear in your `optionalDependencies`",
},
{
name: "--no-save",
description: "Prevents saving to `dependencies`",
},
{
name: ["-E", "--save-exact"],
description:
"Saved dependencies will be configured with an exact version rather than using npm's default semver range operator",
},
{
name: ["-B", "--save-bundle"],
description:
"Saved dependencies will also be added to your bundleDependencies list",
},
globalOption,
{
name: "--global-style",
description:
"Causes npm to install the package into your local node_modules folder with the same layout it uses with the global node_modules folder",
},
{
name: "--legacy-bundling",
description:
"Causes npm to install the package such that versions of npm prior to 1.4, such as the one included with node 0.8, can install the package",
},
{
name: "--legacy-peer-deps",
description:
"Bypass peerDependency auto-installation. Emulate install behavior of NPM v4 through v6",
},
{
name: "--strict-peer-deps",
description:
"If set to true, and --legacy-peer-deps is not set, then any conflicting peerDependencies will be treated as an install failure",
},
{
name: "--no-package-lock",
description: "Ignores package-lock.json files when installing",
},
registryOption,
verboseOption,
omitOption,
ignoreScriptsOption,
{
name: "--no-audit",
description:
"Submit audit reports alongside the current npm command to the default registry and all registries configured for scopes",
},
{
name: "--no-bin-links",
description:
"Tells npm to not create symlinks (or .cmd shims on Windows) for package executables",
},
{
name: "--no-fund",
description:
"Hides the message at the end of each npm install acknowledging the number of dependencies looking for funding",
},
dryRunOption,
...workSpaceOptions,
],
},
{
name: ["run", "run-script"],
description: "Run arbitrary package scripts",
options: [
...workSpaceOptions,
{
name: "--if-present",
description:
"Npm will not exit with an error code when run-script is invoked for a script that isn't defined in the scripts section of package.json",
},
{
name: "--silent",
description: "",
},
ignoreScriptsOption,
scriptShellOption,
{
name: "--",
args: {
name: "args",
isVariadic: true,
// TODO: load the spec based on the runned script (see yarn spec `yarnScriptParsedDirectives`)
},
},
],
args: {
name: "script",
description: "Script to run from your package.json",
filterStrategy: "fuzzy",
generators: npmScriptsGenerator,
},
},
{
name: "init",
description: "Trigger the initialization",
options: [
{
name: ["-y", "--yes"],
description:
"Automatically answer 'yes' to any prompts that npm might print on the command line",
},
{
name: "-w",
description:
"Create the folders and boilerplate expected while also adding a reference to your project workspaces property",
args: { name: "dir" },
},
],
},
{ name: "access", description: "Set access controls on private packages" },
{
name: ["adduser", "login"],
description: "Add a registry user account",
options: [
registryOption,
{
name: "--scope",
description:
"Associate an operation with a scope for a scoped registry",
args: {
name: "scope",
description: "Scope name",
},
},
],
},
{
name: "audit",
description: "Run a security audit",
subcommands: [
{
name: "fix",
description:
"If the fix argument is provided, then remediations will be applied to the package tree",
options: [
dryRunOption,
{
name: ["-f", "--force"],
description:
"Removes various protections against unfortunate side effects, common mistakes, unnecessary performance degradation, and malicious input",
isDangerous: true,
},
...workSpaceOptions,
],
},
],
options: [
...workSpaceOptions,
{
name: "--audit-level",
description:
"The minimum level of vulnerability for npm audit to exit with a non-zero exit code",
args: {
name: "audit",
suggestions: [
"info",
"low",
"moderate",
"high",
"critical",
"none",
],
},
},
{
name: "--package-lock-only",
description:
"Current operation will only use the package-lock.json, ignoring node_modules",
},
jsonOption,
omitOption,
],
},
{
name: "bin",
description: "Print the folder where npm will install executables",
options: [globalOption],
},
{
name: ["bugs", "issues"],
description: "Report bugs for a package in a web browser",
args: {
name: "package",
isOptional: true,
generators: npmSearchGenerator,
debounce: true,
isVariadic: true,
},
options: [
{
name: "--no-browser",
description: "Display in command line instead of browser",
exclusiveOn: ["--browser"],
},
{
name: "--browser",
description:
"The browser that is called by the npm bugs command to open websites",
args: { name: "browser" },
exclusiveOn: ["--no-browser"],
},
registryOption,
],
},
{
name: "cache",
description: "Manipulates packages cache",
subcommands: [
{
name: "add",
description: "Add the specified packages to the local cache",
},
{
name: "clean",
description: "Delete all data out of the cache folder",
},
{
name: "verify",
description:
"Verify the contents of the cache folder, garbage collecting any unneeded data, and verifying the integrity of the cache index and all cached data",
},
],
options: [
{
name: "--cache",
args: { name: "cache" },
description: "The location of npm's cache directory",
},
],
},
{
name: ["ci", "clean-install", "install-clean"],
description: "Install a project with a clean slate",
options: [
{
name: "--audit",
description:
'When "true" submit audit reports alongside the current npm command to the default registry and all registries configured for scopes',
args: {
name: "audit",
suggestions: ["true", "false"],
},
exclusiveOn: ["--no-audit"],
},
{
name: "--no-audit",
description:
"Do not submit audit reports alongside the current npm command",
exclusiveOn: ["--audit"],
},
ignoreScriptsOption,
scriptShellOption,
verboseOption,
registryOption,
],
},
{
name: "cit",
description: "Install a project with a clean slate and run tests",
},
{
name: "clean-install-test",
description: "Install a project with a clean slate and run tests",
},
{ name: "completion", description: "Tab completion for npm" },
{
name: ["config", "c"],
description: "Manage the npm configuration files",
subcommands: [
{
name: "set",
description: "Sets the config key to the value",
args: [{ name: "key" }, { name: "value" }],
options: [
{ name: ["-g", "--global"], description: "Sets it globally" },
],
},
{
name: "get",
description: "Echo the config value to stdout",
args: { name: "key" },
},
{
name: "list",
description: "Show all the config settings",
options: [
{ name: "-g", description: "Lists globally installed packages" },
{ name: "-l", description: "Also shows defaults" },
jsonOption,
],
},
{
name: "delete",
description: "Deletes the key from all configuration files",
args: { name: "key" },
},
{
name: "edit",
description: "Opens the config file in an editor",
options: [
{ name: "--global", description: "Edits the global config" },
],
},
],
},
{ name: "create", description: "Create a package.json file" },
{
name: ["dedupe", "ddp"],
description: "Reduce duplication in the package tree",
},
{
name: "deprecate",
description: "Deprecate a version of a package",
options: [registryOption],
},
{ name: "dist-tag", description: "Modify package distribution tags" },
{
name: ["docs", "home"],
description: "Open documentation for a package in a web browser",
args: {
name: "package",
isOptional: true,
generators: npmSearchGenerator,
debounce: true,
isVariadic: true,
},
options: [
...workSpaceOptions,
registryOption,
{
name: "--no-browser",
description: "Display in command line instead of browser",
exclusiveOn: ["--browser"],
},
{
name: "--browser",
description:
"The browser that is called by the npm docs command to open websites",
args: { name: "browser" },
exclusiveOn: ["--no-browser"],
},
],
},
{
name: "doctor",
description: "Check your npm environment",
options: [registryOption],
},
{
name: "edit",
description: "Edit an installed package",
options: [
{
name: "--editor",
description: "The command to run for npm edit or npm config edit",
},
],
},
{
name: "explore",
description: "Browse an installed package",
args: {
name: "package",
filterStrategy: "fuzzy",
generators: dependenciesGenerator,
},
},
{ name: "fund", description: "Retrieve funding information" },
{ name: "get", description: "Echo the config value to stdout" },
{
name: "help",
description: "Get help on npm",
args: {
name: "term",
isVariadic: true,
description: "Terms to search for",
},
options: [
{
name: "--viewer",
description: "The program to use to view help content",
args: {
name: "viewer",
},
},
],
},
{
name: "help-search",
description: "Search npm help documentation",
args: {
name: "text",
description: "Text to search for",
},
options: [longOption],
},
{ name: "hook", description: "Manage registry hooks" },
{
name: "install-ci-test",
description: "Install a project with a clean slate and run tests",
},
{ name: "install-test", description: "Install package(s) and run tests" },
{ name: "it", description: "Install package(s) and run tests" },
{
name: "link",
description: "Symlink a package folder",
args: { name: "path", template: "filepaths" },
},
{ name: "ln", description: "Symlink a package folder" },
{
name: "logout",
description: "Log out of the registry",
options: [
registryOption,
{
name: "--scope",
description:
"Associate an operation with a scope for a scoped registry",
args: {
name: "scope",
description: "Scope name",
},
},
],
},
{
name: ["ls", "list"],
description: "List installed packages",
options: npmListOptions,
args: { name: "[@scope]/pkg", isVariadic: true },
},
{
name: "org",
description: "Manage orgs",
subcommands: [
{
name: "set",
description: "Add a user to an org or manage roles",
args: [
{
name: "orgname",
description: "Organization name",
},
{
name: "username",
description: "User name",
},
{
name: "role",
isOptional: true,
suggestions: ["developer", "admin", "owner"],
},
],
options: [registryOption, otpOption],
},
{
name: "rm",
description: "Remove a user from an org",
args: [
{
name: "orgname",
description: "Organization name",
},
{
name: "username",
description: "User name",
},
],
options: [registryOption, otpOption],
},
{
name: "ls",
description:
"List users in an org or see what roles a particular user has in an org",
args: [
{
name: "orgname",
description: "Organization name",
},
{
name: "username",
description: "User name",
isOptional: true,
},
],
options: [registryOption, otpOption, jsonOption, parseableOption],
},
],
},
{
name: "outdated",
description: "Check for outdated packages",
args: {
name: "[<@scope>/]
isVariadic: true,
isOptional: true,
},
options: [
{
name: ["-a", "-all"],
description: "Show all outdated or installed packages",
},
jsonOption,
longOption,
parseableOption,
{
name: "-g",
description: "Checks globally",
},
...workSpaceOptions,
],
},
{
name: ["owner", "author"],
description: "Manage package owners",
subcommands: [
{
name: "ls",
description:
"List all the users who have access to modify a package and push new versions. Handy when you need to know who to bug for help",
args: { name: "[@scope/]pkg" },
options: [registryOption],
},
{
name: "add",
description:
"Add a new user as a maintainer of a package. This user is enabled to modify metadata, publish new versions, and add other owners",
args: [{ name: "user" }, { name: "[@scope/]pkg" }],
options: [registryOption, otpOption],
},
{
name: "rm",
description:
"Remove a user from the package owner list. This immediately revokes their privileges",
args: [{ name: "user" }, { name: "[@scope/]pkg" }],
options: [registryOption, otpOption],
},
],
},
{
name: "pack",
description: "Create a tarball from a package",
args: {
name: "[<@scope>/]
},
options: [
jsonOption,
dryRunOption,
...workSpaceOptions,
{
name: "--pack-destination",
description: "Directory in which npm pack will save tarballs",
args: {
name: "pack-destination",
template: ["folders"],
},
},
],
},
{
name: "ping",
description: "Ping npm registry",
options: [registryOption],
},
{
name: "pkg",
description: "Manages your package.json",
subcommands: [
{
name: "get",
description:
"Retrieves a value key, defined in your package.json file. It is possible to get multiple values and values for child fields",
args: {
name: "field",
description:
"Name of the field to get. You can view child fields by separating them with a period",
isVariadic: true,
},
options: [jsonOption, ...workSpaceOptions],
},
{
name: "set",
description:
"Sets a value in your package.json based on the field value. It is possible to set multiple values and values for child fields",
args: {
// Format is
name: "field",
description:
"Name of the field to set. You can set child fields by separating them with a period",
isVariadic: true,
},
options: [
jsonOption,
...workSpaceOptions,
{
name: ["-f", "--force"],
description:
"Removes various protections against unfortunate side effects, common mistakes, unnecessary performance degradation, and malicious input. Allow clobbering existing values in npm pkg",
isDangerous: true,
},
],
},
{
name: "delete",
description: "Deletes a key from your package.json",
args: {
name: "key",
description:
"Name of the key to delete. You can delete child fields by separating them with a period",
isVariadic: true,
},
options: [
...workSpaceOptions,
{
name: ["-f", "--force"],
description:
"Removes various protections against unfortunate side effects, common mistakes, unnecessary performance degradation, and malicious input. Allow clobbering existing values in npm pkg",
isDangerous: true,
},
],
},
],
},
{
name: "prefix",
description: "Display prefix",
options: [
{
name: ["-g", "--global"],
description: "Print the global prefix to standard out",
},
],
},
{
name: "profile",
description: "Change settings on your registry profile",
subcommands: [
{
name: "get",
description:
"Display all of the properties of your profile, or one or more specific properties",
args: {
name: "property",
isOptional: true,
description: "Property name",
},
options: [registryOption, jsonOption, parseableOption, otpOption],
},
{
name: "set",
description: "Set the value of a profile property",
args: [
{
name: "property",
description: "Property name",
suggestions: [
"email",
"fullname",
"homepage",
"freenode",
"twitter",
"github",
],
},
{
name: "value",
description: "Property value",
},
],
options: [registryOption, jsonOption, parseableOption, otpOption],
subcommands: [
{
name: "password",
description:
"Change your password. This is interactive, you'll be prompted for your current password and a new password",
},
],
},
{
name: "enable-2fa",
description: "Enables two-factor authentication",
args: {
name: "mode",
description:
"Mode for two-factor authentication. Defaults to auth-and-writes mode",
isOptional: true,
suggestions: [
{
name: "auth-only",
description:
"Require an OTP when logging in or making changes to your account's authentication",
},
{
name: "auth-and-writes",
description:
"Requires an OTP at all the times auth-only does, and also requires one when publishing a module, setting the latest dist-tag, or changing access via npm access and npm owner",
},
],
},
options: [registryOption, otpOption],
},
{
name: "disable-2fa",
description: "Disables two-factor authentication",
options: [registryOption, otpOption],
},
],
},
{
name: "prune",
description: "Remove extraneous packages",
args: {
name: "[<@scope>/]
isOptional: true,
},
options: [
omitOption,
dryRunOption,
jsonOption,
{
name: "--production",
description: "Remove the packages specified in your devDependencies",
},
...workSpaceOptions,
],
},
{
name: "publish",
description: "Publish a package",
args: {
name: "tarball|folder",
isOptional: true,
description:
"A url or file path to a gzipped tar archive containing a single folder with a package.json file inside | A folder containing a package.json file",
template: ["folders"],
},
options: [
{
name: "--tag",
description: "Registers the published package with the given tag",
args: { name: "tag" },
},
...workSpaceOptions,
{
name: "--access",
description:
"Sets scoped package to be publicly viewable if set to 'public'",
args: {
default: "restricted",
suggestions: ["restricted", "public"],
},
},
dryRunOption,
otpOption,
],
},
{
name: ["rebuild", "rb"],
description: "Rebuild a package",
args: {
name: "[<@scope>/]
},
options: [
globalOption,
...workSpaceOptions,
ignoreScriptsOption,
{
name: "--no-bin-links",
description:
"Tells npm to not create symlinks (or .cmd shims on Windows) for package executables",
},
],
},
{
name: "repo",
description: "Open package repository page in the browser",
args: {
name: "package",
isOptional: true,
generators: npmSearchGenerator,
debounce: true,
isVariadic: true,
},
options: [
...workSpaceOptions,
{
name: "--no-browser",
description: "Display in command line instead of browser",
exclusiveOn: ["--browser"],
},
{
name: "--browser",
description:
"The browser that is called by the npm repo command to open websites",
args: { name: "browser" },
exclusiveOn: ["--no-browser"],
},
],
},
{
name: "restart",
description: "Restart a package",
options: [
ignoreScriptsOption,
scriptShellOption,
{
name: "--",
args: {
name: "arg",
description: "Arguments to be passed to the restart script",
},
},
],
},
{
name: "root",
description: "Display npm root",
options: [
{
name: ["-g", "--global"],
description:
"Print the effective global node_modules folder to standard out",
},
],
},
{
name: ["search", "s", "se", "find"],
description: "Search for packages",
args: {
name: "search terms",
isVariadic: true,
},
options: [
longOption,
jsonOption,
{
name: "--color",
description: "Show colors",
args: {
name: "always",
suggestions: ["always"],
description: "Always show colors",
},
exclusiveOn: ["--no-color"],
},
{
name: "--no-color",
description: "Do not show colors",
exclusiveOn: ["--color"],
},
parseableOption,
{
name: "--no-description",
description: "Do not show descriptions",
},
{
name: "--searchopts",
description:
"Space-separated options that are always passed to search",
args: {
name: "searchopts",
},
},
{
name: "--searchexclude",
description:
"Space-separated options that limit the results from search",
args: {
name: "searchexclude",
},
},
registryOption,
{
name: "--prefer-online",
description:
"If true, staleness checks for cached data will be forced, making the CLI look for updates immediately even for fresh package data",
exclusiveOn: ["--prefer-offline", "--offline"],
},
{
name: "--prefer-offline",
description:
"If true, staleness checks for cached data will be bypassed, but missing data will be requested from the server",
exclusiveOn: ["--prefer-online", "--offline"],
},
{
name: "--offline",
description:
"Force offline mode: no network requests will be done during install",
exclusiveOn: ["--prefer-online", "--prefer-offline"],
},
],
},
{ name: "set", description: "Sets the config key to the value" },
{
name: "set-script",
description: "Set tasks in the scripts section of package.json",
args: [
{
name: "script",
description:
"Name of the task to be added to the scripts section of package.json",
},
{
name: "command",
description: "Command to run when script is called",
},
],
options: workSpaceOptions,
},
{
name: "shrinkwrap",
description: "Lock down dependency versions for publication",
},
{
name: "star",
description: "Mark your favorite packages",
args: {
name: "pkg",
description: "Package to mark as favorite",
},
options: [
registryOption,
{
name: "--no-unicode",
description: "Do not use unicode characters in the tree output",
},
],
},
{
name: "stars",
description: "View packages marked as favorites",
args: {
name: "user",
isOptional: true,
description: "View packages marked as favorites by
},
options: [registryOption],
},
{
name: "start",
description: "Start a package",
options: [
ignoreScriptsOption,
scriptShellOption,
{
name: "--",
args: {
name: "arg",
description: "Arguments to be passed to the start script",
},
},
],
},
{
name: "stop",
description: "Stop a package",
options: [
ignoreScriptsOption,
scriptShellOption,
{
name: "--",
args: {
name: "arg",
description: "Arguments to be passed to the stop script",
},
},
],
},
{
name: "team",
description: "Manage organization teams and team memberships",
subcommands: [
{
name: "create",
args: { name: "scope:team" },
options: [registryOption, otpOption],
},
{
name: "destroy",
args: { name: "scope:team" },
options: [registryOption, otpOption],
},
{
name: "add",
args: [{ name: "scope:team" }, { name: "user" }],
options: [registryOption, otpOption],
},
{
name: "rm",
args: [{ name: "scope:team" }, { name: "user" }],
options: [registryOption, otpOption],
},
{
name: "ls",
args: { name: "scope|scope:team" },
options: [registryOption, jsonOption, parseableOption],
},
],
},
{
name: ["test", "tst", "t"],
description: "Test a package",
options: [ignoreScriptsOption, scriptShellOption],
},
{
name: "token",
description: "Manage your authentication tokens",
subcommands: [
{
name: "list",
description: "Shows a table of all active authentication tokens",
options: [jsonOption, parseableOption],
},
{
name: "create",
description: "Create a new authentication token",
options: [
{
name: "--read-only",
description:
"This is used to mark a token as unable to publish when configuring limited access tokens with the npm token create command",
},
{
name: "--cidr",
description:
"This is a list of CIDR address to be used when configuring limited access tokens with the npm token create command",
isRepeatable: true,
args: {
name: "cidr",
},
},
],
},
{
name: "revoke",
description:
"Immediately removes an authentication token from the registry. You will no longer be able to use it",
args: { name: "idtoken" },
},
],
options: [registryOption, otpOption],
},
uninstallSubcommand("uninstall"),
uninstallSubcommand(["r", "rm"]),
uninstallSubcommand("un"),
uninstallSubcommand("remove"),
uninstallSubcommand("unlink"),
{
name: "unpublish",
description: "Remove a package from the registry",
args: {
name: "[<@scope>/]
},
options: [
dryRunOption,
{
name: ["-f", "--force"],
description:
"Allow unpublishing all versions of a published package. Removes various protections against unfortunate side effects, common mistakes, unnecessary performance degradation, and malicious input",
isDangerous: true,
},
...workSpaceOptions,
],
},
{
name: "unstar",
description: "Remove an item from your favorite packages",
args: {
name: "pkg",
description: "Package to unmark as favorite",
},
options: [
registryOption,
otpOption,
{
name: "--no-unicode",
description: "Do not use unicode characters in the tree output",
},
],
},
{
name: ["update", "upgrade", "up"],
description: "Update a package",
options: [
{ name: "-g", description: "Update global package" },
{
name: "--global-style",
description:
"Causes npm to install the package into your local node_modules folder with the same layout it uses with the global node_modules folder",
},
{
name: "--legacy-bundling",
description:
"Causes npm to install the package such that versions of npm prior to 1.4, such as the one included with node 0.8, can install the package",
},
{
name: "--strict-peer-deps",
description:
"If set to true, and --legacy-peer-deps is not set, then any conflicting peerDependencies will be treated as an install failure",
},
{
name: "--no-package-lock",
description: "Ignores package-lock.json files when installing",
},
omitOption,
ignoreScriptsOption,
{
name: "--no-audit",
description:
"Submit audit reports alongside the current npm command to the default registry and all registries configured for scopes",
},
{
name: "--no-bin-links",
description:
"Tells npm to not create symlinks (or .cmd shims on Windows) for package executables",
},
{
name: "--no-fund",
description:
"Hides the message at the end of each npm install acknowledging the number of dependencies looking for funding",
},
{
name: "--save",
description:
"Update the semver values of direct dependencies in your project package.json",
},
dryRunOption,
...workSpaceOptions,
],
},
{
name: "version",
description: "Bump a package version",
options: [
...workSpaceOptions,
jsonOption,
{
name: "--allow-same-version",
description:
"Prevents throwing an error when npm version is used to set the new version to the same value as the current version",
},
{
name: "--no-commit-hooks",
description:
"Do not run git commit hooks when using the npm version command",
},
{
name: "--no-git-tag-version",
description:
"Do not tag the commit when using the npm version command",
},
{
name: "--preid",
description:
'The "prerelease identifier" to use as a prefix for the "prerelease" part of a semver. Like the rc in 1.2.0-rc.8',
args: {
name: "prerelease-id",
},
},
{
name: "--sign-git-tag",
description:
"If set to true, then the npm version command will tag the version using -s to add a signature",
},
],
},
{
name: ["view", "v", "info", "show"],
description: "View registry info",
options: [...workSpaceOptions, jsonOption],
},
{
name: "whoami",
description: "Display npm username",
options: [registryOption],
},
],
};
export default completionSpec;
npx.tsextensions/terminal-suggest/src/completions/upstream
AddedMark as viewed
// import autocannon from "./autocannon";
export const npxSuggestions: Fig.Suggestion[] = [
// {
// name: autocannon.name,
// ...("icon" in autocannon && { icon: autocannon.icon }),
// },
{
name: "vite",
icon: "https://vitejs.dev/logo.svg",\
},
{
name: "babel",
icon: "https://raw.githubusercontent.com/babel/logo/master/babel.png",\
},
{
name: "create-react-native-app",
icon: "https://reactnative.dev/img/pwa/manifest-icon-512.png",\
},
{
name: "react-native",
icon: "https://reactnative.dev/img/pwa/manifest-icon-512.png",\
},
{
name: "tailwindcss",
icon: "https://tailwindcss.com/favicons/favicon-32x32.png",\
},
{
name: "next",
icon: "https://nextjs.org/static/favicon/favicon-16x16.png",\
},
{
name: "nuxi",
icon: "https://raw.githubusercontent.com/nuxt/framework/main/docs/public/icon.png",\
},
{
name: "gltfjsx",
icon: "https://raw.githubusercontent.com/pmndrs/branding/master/logo.svg",\
},
{
name: "prisma",
icon: "https://raw.githubusercontent.com/prisma/docs/main/src/images/favicon-16x16.png",\
},
{
name: "eslint",
icon: "https://raw.githubusercontent.com/eslint/eslint.org/main/src/static/icon-512.png",\
},
{
name: "prettier",
icon: "https://prettier.io/icon.png",\
},
{
name: "tsc",
icon: "https://upload.wikimedia.org/wikipedia/commons/thumb/4/4c/Typescript\_logo\_2020.svg/240px-Typescript\_logo\_2020.svg.png",\
},
{
name: "typeorm",
icon: "https://avatars.githubusercontent.com/u/20165699?s=200&v=4",\
},
// {
// name: "fig-teams",
// icon: "https://fig.io/icons/fig-light.png",\
// },
{
name: "@withfig/autocomplete-tools",
icon: "https://fig.io/icons/fig-light.png",\
},
{
name: "create-completion-spec",
icon: "https://fig.io/icons/fig-light.png",\
},
{
name: "@fig/publish-spec-to-team",
icon: "https://fig.io/icons/fig-light.png",\
},
{
name: "fig-teams@latest",
icon: "https://fig.io/icons/fig-light.png",\
},
{
name: "create-next-app",
icon: "https://nextjs.org/static/favicon/favicon-16x16.png",\
},
{
name: "create-t3-app",
icon: "https://create.t3.gg/favicon.svg",\
},
{
name: "create-discord-bot",
icon: "https://discordjs.dev/favicon-32x32.png",\
},
{
name: "create-video",
icon: "https://raw.githubusercontent.com/remotion-dev/remotion/main/packages/docs/static/img/logo-small.png",\
},
{
name: "remotion",
icon: "https://raw.githubusercontent.com/remotion-dev/remotion/main/packages/docs/static/img/logo-small.png",\
},
{
name: "create-remix",
icon: "https://remix.run/favicon-light.1.png",\
},
{
name: "remix",
icon: "https://remix.run/favicon-light.1.png",\
},
{
name: "playwright",
icon: "https://playwright.dev/img/playwright-logo.svg",\
},
{
name: "ignite-cli",
icon: "π₯",
},
{
name: "vsce",
},
{
name: "degit",
icon: "fig://icon?type=git",
},
{
name: "@preset/cli",
icon: "https://raw.githubusercontent.com/preset/preset/main/.github/assets/logo.svg",\
},
{
name: "mikro-orm",
icon: "https://raw.githubusercontent.com/mikro-orm/mikro-orm/master/docs/static/img/favicon.ico",\
},
{
name: "pod-install",
},
{
name: "capacitor",
icon: "https://capacitorjs.com/docs/img/meta/favicon.png",\
},
{
name: "cap",
icon: "https://capacitorjs.com/docs/img/meta/favicon.png",\
},
{
name: "@magnolia/cli",
icon: "https://avatars.githubusercontent.com/u/25686615?s=200&v=4",\
},
{
name: "stencil",
icon: "https://stenciljs.com/assets/icon/favicon.ico",\
},
{
name: "swagger-typescript-api",
icon: "https://static1.smartbear.co/swagger/media/assets/swagger\_fav.png",\
},
{
name: "sta",
icon: "https://static1.smartbear.co/swagger/media/assets/swagger\_fav.png",\
},
{
name: "@wordpress/create-block",
icon: "https://s1.wp.com/i/webclip.png",\
},
{
name: "astro",
icon: "https://astro.build/favicon.svg",\
},
{
name: "ampx",
icon: "https://raw.githubusercontent.com/aws-amplify/docs/refs/heads/main/public/favicon.ico",\
},
];
const completionSpec: Fig.Spec = {
name: "npx",
description: "Execute binaries from npm packages",
args: {
name: "command",
isCommand: true,
generators: {
script: [
"bash",
"-c",
"until [[ -d node_modules/ ]] || [[ $PWD = '/' ]]; do cd ..; done; ls -1 node_modules/.bin/",
],
postProcess: function (out) {
const cli = [...npxSuggestions].reduce(
(acc: any, { name }) => [...acc, name],
[]
);
return out
.split("\n")
.filter((name) => !cli.includes(name))
.map((name) => ({
name,
icon: "fig://icon?type=command",
loadSpec: name,
}));
},
},
suggestions: [...npxSuggestions],
isOptional: true,
},
options: [
{
name: ["--package", "-p"],
description: "Package to be installed",
args: {
name: "package",
},
},
{
name: "--cache",
args: {
name: "path",
template: "filepaths",
},
description: "Location of the npm cache",
},
{
name: "--always-spawn",
description: "Always spawn a child process to execute the command",
},
{
name: "-y",
description: "Execute npx command without prompting for confirmation",
},
{
description: "Skip installation if a package is missing",
name: "--no-install",
},
{
args: {
name: "path",
template: "filepaths",
},
description: "Path to user npmrc",
name: "--userconfig",
},
{
name: ["--call", "-c"],
args: {
name: "script",
},
description: "Execute string as if inside `npm run-script`",
},
{
name: ["--shell", "-s"],
description: "Shell to execute the command with, if any",
args: {
name: "shell",
suggestions: [
{
name: "bash",
},
{
name: "fish",
},
{
name: "zsh",
},
],
},
},
{
args: {
name: "shell-fallback",
suggestions: [
{
name: "bash",
},
{
name: "fish",
},
{
name: "zsh",
},
],
},
name: "--shell-auto-fallback",
description:
'Generate shell code to use npx as the "command not found" fallback',
},
{
name: "--ignore-existing",
description:
"Ignores existing binaries in $PATH, or in the localproject. This forces npx to do a temporary install and use the latest version",
},
{
name: ["--quiet", "-q"],
description:
"Suppress output from npx itself. Subcommands will not be affected",
},
{
name: "--npm",
args: {
name: "path to binary",
template: "filepaths",
},
description: "Npm binary to use for internal operations",
},
{
args: {},
description: "Extra node argument when calling a node binary",
name: ["--node-arg", "-n"],
},
{
description: "Show version number",
name: ["--version", "-v"],
},
{
description: "Show help",
name: ["--help", "-h"],
},
],
};
export default completionSpec;
nvm.tsextensions/terminal-suggest/src/completions/upstream
AddedMark as viewed
// args
const version: Fig.Arg = {
name: "version",
description: "Node version",
suggestions: [
{
name: "node",
description: "The latest version of node",
},
{
name: "iojs",
description: "The latest version of io.js",
},
{
name: "system",
description: "System-installed version of node",
},
],
};
const command: Fig.Arg = { name: "command", isVariadic: true, };
const args: Fig.Arg = { name: "args", isVariadic: true, };
// const pattern: Fig.Arg = { // name: "pattern", // };
const name: Fig.Arg = { name: "name", };
const ltsName: Fig.Arg = { name: "LTS name", };
const colorCodes: Fig.Arg = { name: "color codes", description: 'Using format "yMeBg"', };
// options const noColors: Fig.Option = { name: "--no-colors", description: "Suppress colored output", };
const noAlias: Fig.Option = { name: "--no-alias", description: "Suppress `nvm alias` output", };
const silent: Fig.Option = { name: "--silent", description: "Silences stdout/stderr output", };
const lts: Fig.Option = { name: "--lts", description: "Uses automatic LTS (long-term support) alias `lts/*`, if available", };
const ltsWithName: Fig.Option = { name: "--lts", description: "Uses automatic alias for provided LTS line, if available", args: ltsName, };
const completionSpec: Fig.Spec = {
name: "nvm",
description: "Node Package Manager",
subcommands: [
{
name: "install",
description:
"Download and install a
args: { ...version, isOptional: true },
options: [
{
name: "-s",
description: "Skip binary download, install from source only",
},
{
name: "--reinstall-packages-from",
description:
"When installing, reinstall packages installed in
args: version,
},
{
...lts,
description:
"When installing, only select from LTS (long-term support) versions",
},
{
...ltsWithName,
description:
"When installing, only select from versions for a specific LTS line",
},
{
name: "--skip-default-packages",
description:
"When installing, skip the default-packages file if it exists",
},
{
name: "--latest-npm",
description:
"After installing, attempt to upgrade to the latest working npm on the given node version",
},
{
name: "--no-progress",
description: "Disable the progress bar on any downloads",
},
{
name: "--alias",
description:
"After installing, set the alias specified to the version specified. (same as: nvm alias
args: name,
},
{
name: "--default",
description:
"After installing, set default alias to the version specified. (same as: nvm alias default
},
],
},
{
name: "uninstall",
description: "Uninstall a version",
args: version,
options: [
{
...lts,
description:
"Uninstall using automatic LTS (long-term support) alias `lts/*`, if available",
},
{
...ltsWithName,
description:
"Uninstall using automatic alias for provided LTS line, if available",
},
],
},
{
name: "use",
description:
"Modify PATH to use
args: { ...version, isOptional: true },
options: [silent, lts, ltsWithName],
},
{
name: "exec",
description:
"Run
args: [{ ...version, isOptional: true }, command],
options: [silent, lts, ltsWithName],
},
{
name: "run",
description:
"Run `node` on
args: [{ ...version, isOptional: true }, args],
options: [silent, lts, ltsWithName],
},
{
name: "current",
description: "Display currently activated version of Node",
},
{
name: "ls",
description:
"List installed versions, matching a given
args: version,
options: [noColors, noAlias],
},
{
name: "ls-remote",
description:
"List remote versions available for install, matching a given
args: version,
options: [
{
...lts,
description:
"When listing, only show LTS (long-term support) versions",
},
{
...ltsWithName,
description:
"When listing, only show versions for a specific LTS line",
},
noColors,
],
},
{
name: "version",
description: "Resolve the given description to a single local version",
args: version,
},
{
name: "version-remote",
description: "Resolve the given description to a single remote version",
args: version,
options: [
{
...lts,
description:
"When listing, only show LTS (long-term support) versions",
},
{
...ltsWithName,
description:
"When listing, only show versions for a specific LTS line",
},
],
},
{
name: "deactivate",
description: "Undo effects of `nvm` on current shell",
options: [silent],
},
{
name: "alias",
description:
"Show all aliases beginning with
args: [
{
name: "pattern or name",
description: "Pattern or name",
},
{
name: "version",
isOptional: true,
},
],
},
{
name: "unalias",
description: "Deletes the alias named
args: name,
},
{
name: "install-latest-npm",
description:
"Attempt to upgrade to the latest working `npm` on the current node version",
},
{
name: "reinstall-packages",
description:
"Reinstall global `npm` packages contained in
args: version,
},
{
name: "unload",
description: "Unload `nvm` from shell",
},
{
name: "which",
description:
"Display path to installed node version. Uses .nvmrc if available and version is omitted",
args: { ...version, isOptional: true },
subcommands: [
{
name: "current",
},
],
options: [
{
...silent,
description:
"Silences stdout/stderr output when a version is omitted",
},
],
},
{
name: "cache",
args: {
suggestions: [
{
name: "dir",
description: "Display path to the cache directory for nvm",
type: "subcommand",
},
{
name: "clear",
description: "Empty cache directory for nvm",
type: "subcommand",
},
],
},
},
{
name: "set-colors",
description:
'Set five text colors using format "yMeBg". Available when supported',
args: colorCodes,
},
],
options: [
{
name: "--help",
description: "Show help page",
},
{
name: "--version",
description: "Print out the installed version of nvm",
},
noColors,
],
};
export default completionSpec;
pnpm.tsextensions/terminal-suggest/src/completions/upstream
AddedMark as viewed
// GENERATORS
import { npmScriptsGenerator, npmSearchGenerator } from "./npm"; import { dependenciesGenerator, nodeClis } from "./yarn";
const filterMessages = (out: string): string => { return out.startsWith("warning:") || out.startsWith("error:") ? out.split("\n").slice(1).join("\n") : out; };
const searchBranches: Fig.Generator = { script: ["git", "branch", "--no-color"], postProcess: function (out) { const output = filterMessages(out);
if (output.startsWith("fatal:")) { return []; }
return output.split("\n").map((elm) => { let name = elm.trim(); const parts = elm.match(/\S+/g); if (parts && parts.length > 1) { if (parts[0] == "*") { // Current branch. return { name: elm.replace("*", "").trim(), description: "Current branch", icon: "βοΈ", }; } else if (parts[0] == "+") { // Branch checked out in another worktree. name = elm.replace("+", "").trim(); } }
return { name, description: "Branch", icon: "fig://icon?type=git", }; }); }, };
const generatorInstalledPackages: Fig.Generator = {
script: ["pnpm", "ls"],
postProcess: function (out) {
/\\
\* out
\* @example
\* ```
\* Legend: production dependency, optional only, dev only
\*
\* /xxxx/xxxx/
const output = out .split("\n") .slice(3) // remove empty lines, "*dependencies:" lines, local workspace packages (eg: "foo":"workspace:*") .filter( (item) => !!item && !item.toLowerCase().includes("dependencies") && !item.includes("link:") ) .map((item) => item.replace(/\s/, "@")); // typescript 4.7.4 -> typescript@4.7.4
return output.map((pkg) => { return { name: pkg, icon: "fig://icon?type=package", }; }); }, };
const FILTER_OPTION: Fig.Option = { name: "--filter", args: { template: "filepaths", name: "Filepath / Package", description: "To only select packages under the specified directory, you may specify any absolute path, typically in POSIX format", }, description: `Filtering allows you to restrict commands to specific subsets of packages. pnpm supports a rich selector syntax for picking packages by name or by relation. More details: https://pnpm.io/filtering\`, };
/\\ Options that being appended for `pnpm i` and `add` */
const INSTALL_BASE_OPTIONS: Fig.Option[] = [
{
name: "--offline",
description:
"If true, pnpm will use only packages already available in the store. If a package won't be found locally, the installation will fail",
},
{
name: "--prefer-offline",
description:
"If true, staleness checks for cached data will be bypassed, but missing data will be requested from the server. To force full offline mode, use --offline",
},
{
name: "--ignore-scripts",
description:
"Do not execute any scripts defined in the project package.json and its dependencies",
},
{
name: "--reporter",
description: `Allows you to choose the reporter that will log debug info to the terminal about the installation progress`,
args: {
name: "Reporter Type",
suggestions: ["silent", "default", "append-only", "ndjson"],
},
},
];
/\\ Base options for pnpm i when run without any arguments */
const INSTALL_OPTIONS: Fig.Option[] = [
{
name: ["-P", "--save-prod"],
description: `Pnpm will not install any package listed in devDependencies if the NODE_ENV environment variable is set to production.
Use this flag to instruct pnpm to ignore NODE_ENV and take its production status from this flag instead`,
},
{
name: ["-D", "--save-dev"],
description:
"Only devDependencies are installed regardless of the NODE_ENV",
},
{
name: "--no-optional",
description: "OptionalDependencies are not installed",
},
{
name: "--lockfile-only",
description:
"When used, only updates pnpm-lock.yaml and package.json instead of checking node_modules and downloading dependencies",
},
{
name: "--frozen-lockfile",
description:
"If true, pnpm doesn't generate a lockfile and fails to install if the lockfile is out of sync with the manifest / an update is needed or no lockfile is present",
},
{
name: "--use-store-server",
description:
"Starts a store server in the background. The store server will keep running after installation is done. To stop the store server, run pnpm server stop",
},
{
name: "--shamefully-hoist",
description:
"Creates a flat node_modules structure, similar to that of npm or yarn. WARNING: This is highly discouraged",
},
];
/\\ Base options for pnpm add */
const INSTALL_PACKAGE_OPTIONS: Fig.Option[] = [
{
name: ["-P", "--save-prod"],
description: "Install the specified packages as regular dependencies",
},
{
name: ["-D", "--save-dev"],
description: "Install the specified packages as devDependencies",
},
{
name: ["-O", "--save-optional"],
description: "Install the specified packages as optionalDependencies",
},
{
name: "--no-save",
description: "Prevents saving to `dependencies`",
},
{
name: ["-E", "--save-exact"],
description:
"Saved dependencies will be configured with an exact version rather than using pnpm's default semver range operator",
},
{
name: "--save-peer",
description:
"Using --save-peer will add one or more packages to peerDependencies and install them as dev dependencies",
},
{
name: ["--ignore-workspace-root-check", "-W#"],
description: `Adding a new dependency to the root workspace package fails, unless the --ignore-workspace-root-check or -W flag is used.
For instance, pnpm add debug -W`,
},
{
name: ["--global", "-g"],
description: `Install a package globally`,
},
{
name: "--workspace",
description: `Only adds the new dependency if it is found in the workspace`,
},
FILTER_OPTION,
];
// SUBCOMMANDS
const SUBCOMMANDS_MANAGE_DEPENDENCIES: Fig.Subcommand[] = [
{
name: "add",
description: `Installs a package and any packages that it depends on. By default, any new package is installed as a production dependency`,
args: {
name: "package",
generators: npmSearchGenerator,
debounce: true,
isVariadic: true,
},
options: [...INSTALL_BASE_OPTIONS, ...INSTALL_PACKAGE_OPTIONS],
},
{
name: ["install", "i"],
description: `Pnpm install is used to install all dependencies for a project.
In a CI environment, installation fails if a lockfile is present but needs an update.
Inside a workspace, pnpm install installs all dependencies in all the projects.
If you want to disable this behavior, set the recursive-install setting to false`,
async generateSpec(tokens) {
// `pnpm i` with args is an `pnpm add` alias
const hasArgs =
tokens.filter((token) => token.trim() !== "" && !token.startsWith("-"))
.length > 2;
return {
name: "install",
options: [
...INSTALL_BASE_OPTIONS,
...(hasArgs ? INSTALL_PACKAGE_OPTIONS : INSTALL_OPTIONS),
],
};
},
args: {
name: "package",
isOptional: true,
generators: npmSearchGenerator,
debounce: true,
isVariadic: true,
},
},
{
name: ["install-test", "it"],
description:
"Runs pnpm install followed immediately by pnpm test. It takes exactly the same arguments as pnpm install",
options: [...INSTALL_BASE_OPTIONS, ...INSTALL_OPTIONS],
},
{
name: ["update", "upgrade", "up"],
description: `Pnpm update updates packages to their latest version based on the specified range.
When used without arguments, updates all dependencies. You can use patterns to update specific dependencies`,
args: {
name: "Package",
isOptional: true,
filterStrategy: "fuzzy",
generators: dependenciesGenerator,
isVariadic: true,
},
options: [
{
name: ["--recursive", "-r"],
description:
"Concurrently runs update in all subdirectories with a package.json (excluding node_modules)",
},
{
name: ["--latest", "-L"],
description:
"Ignores the version range specified in package.json. Instead, the version specified by the latest tag will be used (potentially upgrading the packages across major versions)",
},
{
name: "--global",
description: "Update global packages",
},
{
name: ["-P", "--save-prod"],
description: `Only update packages in dependencies and optionalDependencies`,
},
{
name: ["-D", "--save-dev"],
description: "Only update packages in devDependencies",
},
{
name: "--no-optional",
description: "Don't update packages in optionalDependencies",
},
{
name: ["--interactive", "-i"],
description:
"Show outdated dependencies and select which ones to update",
},
{
name: "--workspace",
description: `Tries to link all packages from the workspace. Versions are updated to match the versions of packages inside the workspace.
If specific packages are updated, the command will fail if any of the updated dependencies are not found inside the workspace. For instance, the following command fails if express is not a workspace package: pnpm up -r --workspace express`,
},
FILTER_OPTION,
],
},
{
name: ["remove", "rm", "uninstall", "un"],
description: `Removes packages from node_modules and from the project's package.json`,
args: {
name: "Package",
filterStrategy: "fuzzy",
generators: dependenciesGenerator,
isVariadic: true,
},
options: [
{
name: ["--recursive", "-r"],
description: `When used inside a workspace, removes a dependency (or dependencies) from every workspace package.
When used not inside a workspace, removes a dependency (or dependencies) from every package found in subdirectories`,
},
{
name: "--global",
description: "Remove a global package",
},
{
name: ["-P", "--save-prod"],
description: `Only remove the dependency from dependencies`,
},
{
name: ["-D", "--save-dev"],
description: "Only remove the dependency from devDependencies",
},
{
name: ["--save-optional", "-O"],
description: "Only remove the dependency from optionalDependencies",
},
FILTER_OPTION,
],
},
{
name: ["link", "ln"],
description: `Makes the current local package accessible system-wide, or in another location`,
args: [
{
name: "Package",
filterStrategy: "fuzzy",
generators: dependenciesGenerator,
isVariadic: true,
},
{ template: "filepaths" },
],
options: [
{
name: ["--dir", "-C"],
description: `Changes the link location to
},
{
name: "--global",
description:
"Links the specified package (
},
],
},
{
name: "unlink",
description: `Unlinks a system-wide package (inverse of pnpm link).
If called without arguments, all linked dependencies will be unlinked.
This is similar to yarn unlink, except pnpm re-installs the dependency after removing the external link`,
args: [
{
name: "Package",
filterStrategy: "fuzzy",
generators: dependenciesGenerator,
isVariadic: true,
},
{ template: "filepaths" },
],
options: [
{
name: ["--recursive", "-r"],
description: `Unlink in every package found in subdirectories or in every workspace package, when executed inside a workspace`,
},
FILTER_OPTION,
],
},
{
name: "import",
description:
"Pnpm import generates a pnpm-lock.yaml from an npm package-lock.json (or npm-shrinkwrap.json) file",
},
{
name: ["rebuild", "rb"],
description: `Rebuild a package`,
args: [
{
name: "Package",
filterStrategy: "fuzzy",
generators: dependenciesGenerator,
isVariadic: true,
},
{ template: "filepaths" },
],
options: [
{
name: ["--recursive", "-r"],
description: `This command runs the pnpm rebuild command in every package of the monorepo`,
},
FILTER_OPTION,
],
},
{
name: "prune",
description: `Removes unnecessary packages`,
options: [
{
name: "--prod",
description: `Remove the packages specified in devDependencies`,
},
{
name: "--no-optional",
description: `Remove the packages specified in optionalDependencies`,
},
],
},
{
name: "fetch",
description: `EXPERIMENTAL FEATURE: Fetch packages from a lockfile into virtual store, package manifest is ignored: https://pnpm.io/cli/fetch\`,\ options: [
{
name: "--prod",
description: `Development packages will not be fetched`,
},
{
name: "--dev",
description: `Only development packages will be fetched`,
},
],
},
{
name: "patch",
description: `This command will cause a package to be extracted in a temporary directory intended to be editable at will`,
args: {
name: "package",
generators: generatorInstalledPackages,
},
options: [
{
name: "--edit-dir",
description: `The package that needs to be patched will be extracted to this directory`,
},
],
},
{
name: "patch-commit",
args: {
name: "dir",
},
description: `Generate a patch out of a directory`,
},
{
name: "patch-remove",
args: {
name: "package",
isVariadic: true,
// TODO: would be nice to have a generator of all patched packages
},
},
];
const SUBCOMMANDS_RUN_SCRIPTS: Fig.Subcommand[] = [
{
name: ["run", "run-script"],
description: "Runs a script defined in the package's manifest file",
args: {
name: "Scripts",
filterStrategy: "fuzzy",
generators: npmScriptsGenerator,
isVariadic: true,
},
options: [
{
name: ["-r", "--recursive"],
description: `This runs an arbitrary command from each package's "scripts" object. If a package doesn't have the command, it is skipped. If none of the packages have the command, the command fails`,
},
{
name: "--if-present",
description:
"You can use the --if-present flag to avoid exiting with a non-zero exit code when the script is undefined. This lets you run potentially undefined scripts without breaking the execution chain",
},
{
name: "--parallel",
description:
"Completely disregard concurrency and topological sorting, running a given script immediately in all matching packages with prefixed streaming output. This is the preferred flag for long-running processes over many packages, for instance, a lengthy build process",
},
{
name: "--stream",
description:
"Stream output from child processes immediately, prefixed with the originating package directory. This allows output from different packages to be interleaved",
},
FILTER_OPTION,
],
},
{
name: "exec",
description: `Execute a shell command in scope of a project.
node_modules/.bin is added to the PATH, so pnpm exec allows executing commands of dependencies`,
args: {
name: "Scripts",
filterStrategy: "fuzzy",
generators: dependenciesGenerator,
isVariadic: true,
},
options: [
{
name: ["-r", "--recursive"],
description: `Execute the shell command in every project of the workspace.
The name of the current package is available through the environment variable PNPM_PACKAGE_NAME (supported from pnpm v2.22.0 onwards)`,
},
{
name: "--parallel",
description:
"Completely disregard concurrency and topological sorting, running a given script immediately in all matching packages with prefixed streaming output. This is the preferred flag for long-running processes over many packages, for instance, a lengthy build process",
},
FILTER_OPTION,
],
},
{
name: ["test", "t", "tst"],
description: `Runs an arbitrary command specified in the package's test property of its scripts object.
The intended usage of the property is to specify a command that runs unit or integration testing for your program`,
},
{
name: "start",
description: `Runs an arbitrary command specified in the package's start property of its scripts object. If no start property is specified on the scripts object, it will attempt to run node server.js as a default, failing if neither are present.
The intended usage of the property is to specify a command that starts your program`,
},
];
const SUBCOMMANDS_REVIEW_DEPS: Fig.Subcommand[] = [
{
name: "audit",
description: `Checks for known security issues with the installed packages.
If security issues are found, try to update your dependencies via pnpm update.
If a simple update does not fix all the issues, use overrides to force versions that are not vulnerable.
For instance, if lodash@<2.1.0 is vulnerable, use overrides to force lodash@^2.1.0.
Details at: https://pnpm.io/cli/audit\`,\
options: [
{
name: "--audit-level",
description: `Only print advisories with severity greater than or equal to
args: {
name: "Audit Level",
default: "low",
suggestions: ["low", "moderate", "high", "critical"],
},
},
{
name: "--fix",
description:
"Add overrides to the package.json file in order to force non-vulnerable versions of the dependencies",
},
{
name: "--json",
description: `Output audit report in JSON format`,
},
{
name: ["--dev", "-D"],
description: `Only audit dev dependencies`,
},
{
name: ["--prod", "-P"],
description: `Only audit production dependencies`,
},
{
name: "--no-optional",
description: `Don't audit optionalDependencies`,
},
{
name: "--ignore-registry-errors",
description: `If the registry responds with a non-200 status code, the process should exit with 0. So the process will fail only if the registry actually successfully responds with found vulnerabilities`,
},
],
},
{
name: ["list", "ls"],
description: `This command will output all the versions of packages that are installed, as well as their dependencies, in a tree-structure.
Positional arguments are name-pattern@version-range identifiers, which will limit the results to only the packages named. For example, pnpm list "babel-*" "eslint-*" semver@5`,
options: [
{
name: ["--recursive", "-r"],
description: `Perform command on every package in subdirectories or on every workspace package, when executed inside a workspace`,
},
{
name: "--json",
description: `Log output in JSON format`,
},
{
name: "--long",
description: `Show extended information`,
},
{
name: "--parseable",
description: `Outputs package directories in a parseable format instead of their tree view`,
},
{
name: "--global",
description: `List packages in the global install directory instead of in the current project`,
},
{
name: "--depth",
description: `Max display depth of the dependency tree.
pnpm ls --depth 0 will list direct dependencies only. pnpm ls --depth -1 will list projects only. Useful inside a workspace when used with the -r option`,
args: { name: "number" },
},
{
name: ["--dev", "-D"],
description: `Only list dev dependencies`,
},
{
name: ["--prod", "-P"],
description: `Only list production dependencies`,
},
{
name: "--no-optional",
description: `Don't list optionalDependencies`,
},
FILTER_OPTION,
],
},
{
name: "outdated",
description: `Checks for outdated packages. The check can be limited to a subset of the installed packages by providing arguments (patterns are supported)`,
options: [
{
name: ["--recursive", "-r"],
description: `Check for outdated dependencies in every package found in subdirectories, or in every workspace package when executed inside a workspace`,
},
{
name: "--long",
description: `Print details`,
},
{
name: "--global",
description: `List outdated global packages`,
},
{
name: "--no-table",
description: `Prints the outdated dependencies in a list format instead of the default table. Good for small consoles`,
},
{
name: "--compatible",
description: `Prints only versions that satisfy specifications in package.json`,
},
{
name: ["--dev", "-D"],
description: `Only list dev dependencies`,
},
{
name: ["--prod", "-P"],
description: `Only list production dependencies`,
},
{
name: "--no-optional",
description: `Doesn't check optionalDependencies`,
},
],
},
{
name: "why",
description: `Shows all packages that depend on the specified package`,
args: {
name: "Scripts",
filterStrategy: "fuzzy",
generators: dependenciesGenerator,
isVariadic: true,
},
options: [
{
name: ["--recursive", "-r"],
description: `Show the dependency tree for the specified package on every package in subdirectories or on every workspace package when executed inside a workspace`,
},
{
name: "--json",
description: `Log output in JSON format`,
},
{
name: "--long",
description: `Show verbose output`,
},
{
name: "--parseable",
description: `Show parseable output instead of tree view`,
},
{
name: "--global",
description: `List packages in the global install directory instead of in the current project`,
},
{
name: ["--dev", "-D"],
description: `Only display the dependency tree for packages in devDependencies`,
},
{
name: ["--prod", "-P"],
description: `Only display the dependency tree for packages in dependencies`,
},
FILTER_OPTION,
],
},
];
const SUBCOMMANDS_MISC: Fig.Subcommand[] = [
{
name: "publish",
description: `Publishes a package to the registry.
When publishing a package inside a workspace, the LICENSE file from the root of the workspace is packed with the package (unless the package has a license of its own).
You may override some fields before publish, using the publishConfig field in package.json. You also can use the publishConfig.directory to customize the published subdirectory (usually using third party build tools).
When running this command recursively (pnpm -r publish), pnpm will publish all the packages that have versions not yet published to the registry`,
args: {
name: "Branch",
generators: searchBranches,
},
options: [
{
name: "--tag",
description: `Publishes the package with the given tag. By default, pnpm publish updates the latest tag`,
args: {
name: "
},
},
{
name: "--dry-run",
description: `Does everything a publish would do except actually publishing to the registry`,
},
{
name: "--ignore-scripts",
description: `Ignores any publish related lifecycle scripts (prepublishOnly, postpublish, and the like)`,
},
{
name: "--no-git-checks",
description: `Don't check if current branch is your publish branch, clean, and up-to-date`,
},
{
name: "--access",
description: `Tells the registry whether the published package should be public or restricted`,
args: {
name: "Type",
suggestions: ["public", "private"],
},
},
{
name: "--force",
description: `Try to publish packages even if their current version is already found in the registry`,
},
{
name: "--report-summary",
description: `Save the list of published packages to pnpm-publish-summary.json. Useful when some other tooling is used to report the list of published packages`,
},
FILTER_OPTION,
],
},
{
name: ["recursive", "m", "multi", "-r"],
description: `Runs a pnpm command recursively on all subdirectories in the package or every available workspace`,
options: [
{
name: "--link-workspace-packages",
description: `Link locally available packages in workspaces of a monorepo into node_modules instead of re-downloading them from the registry. This emulates functionality similar to yarn workspaces.
When this is set to deep, local packages can also be linked to subdependencies.
Be advised that it is encouraged instead to use npmrc for this setting, to enforce the same behaviour in all environments. This option exists solely so you may override that if necessary`,
args: {
name: "bool or `deep`",
suggestions: ["dee["],
},
},
{
name: "--workspace-concurrency",
description: `Set the maximum number of tasks to run simultaneously. For unlimited concurrency use Infinity`,
args: { name: "
},
{
name: "--bail",
description: `Stops when a task throws an error`,
},
{
name: "--no-bail",
description: `Don't stop when a task throws an error`,
},
{
name: "--sort",
description: `Packages are sorted topologically (dependencies before dependents)`,
},
{
name: "--no-sort",
description: `Disable packages sorting`,
},
{
name: "--reverse",
description: `The order of packages is reversed`,
},
FILTER_OPTION,
],
},
{
name: "server",
description: `Manage a store server`,
subcommands: [
{
name: "start",
description:
"Starts a server that performs all interactions with the store. Other commands will delegate any store-related tasks to this server",
options: [
{
name: "--background",
description: `Runs the server in the background, similar to daemonizing on UNIX systems`,
},
{
name: "--network-concurrency",
description: `The maximum number of network requests to process simultaneously`,
args: { name: "number" },
},
{
name: "--protocol",
description: `The communication protocol used by the server. When this is set to auto, IPC is used on all systems except for Windows, which uses TCP`,
args: {
name: "Type",
suggestions: ["auto", "tcp", "ipc"],
},
},
{
name: "--port",
description: `The port number to use when TCP is used for communication. If a port is specified and the protocol is set to auto, regardless of system type, the protocol is automatically set to use TCP`,
args: { name: "port number" },
},
{
name: "--store-dir",
description: `The directory to use for the content addressable store`,
args: { name: "Path", template: "filepaths" },
},
{
name: "--lock",
description: `Set to make the package store immutable to external processes while the server is running or not`,
},
{
name: "--no-lock",
description: `Set to make the package store mutable to external processes while the server is running or not`,
},
{
name: "--ignore-stop-requests",
description: `Prevents you from stopping the server using pnpm server stop`,
},
{
name: "--ignore-upload-requests",
description: `Prevents creating a new side effect cache during install`,
},
],
},
{
name: "stop",
description: "Stops the store server",
},
{
name: "status",
description: "Prints information about the running server",
},
],
},
{
name: "store",
description: "Managing the package store",
subcommands: [
{
name: "status",
description: `Checks for modified packages in the store.
Returns exit code 0 if the content of the package is the same as it was at the time of unpacking`,
},
{
name: "add",
description: `Functionally equivalent to pnpm add,
except this adds new packages to the store directly without modifying any projects or files outside of the store`,
},
{
name: "prune",
description: `Removes orphan packages from the store.
Pruning the store will save disk space, however may slow down future installations involving pruned packages.
Ultimately, it is a safe operation, however not recommended if you have orphaned packages from a package you intend to reinstall.
Please read the FAQ for more information on unreferenced packages and best practices.
Please note that this is prohibited when a store server is running`,
},
{
name: "path",
description: `Returns the path to the active store directory`,
},
],
},
{
name: "init",
description:
"Creates a basic package.json file in the current directory, if it doesn't exist already",
},
{
name: "doctor",
description: "Checks for known common issues with pnpm configuration",
},
];
const subcommands = [
...SUBCOMMANDS_MANAGE_DEPENDENCIES,
...SUBCOMMANDS_REVIEW_DEPS,
...SUBCOMMANDS_RUN_SCRIPTS,
...SUBCOMMANDS_MISC,
];
const recursiveSubcommandsNames = [
"add",
"exec",
"install",
"list",
"outdated",
"publish",
"rebuild",
"remove",
"run",
"test",
"unlink",
"update",
"why",
];
const recursiveSubcommands = subcommands.filter((subcommand) => {
if (Array.isArray(subcommand.name)) {
return subcommand.name.some((name) =>
recursiveSubcommandsNames.includes(name)
);
}
return recursiveSubcommandsNames.includes(subcommand.name);
});
// RECURSIVE SUBCOMMAND INDEX
SUBCOMMANDS_MISC[1].subcommands = recursiveSubcommands;
// common options
const COMMON_OPTIONS: Fig.Option[] = [
{
name: ["-C", "--dir"],
args: {
name: "path",
template: "folders",
},
isPersistent: true,
description:
"Run as if pnpm was started in
},
{
name: ["-w", "--workspace-root"],
args: {
name: "workspace",
},
isPersistent: true,
description:
"Run as if pnpm was started in the root of the
},
{
name: ["-h", "--help"],
isPersistent: true,
description: "Output usage information",
},
{
name: ["-v", "--version"],
description: "Show pnpm's version",
},
];
// SPEC
const completionSpec: Fig.Spec = {
name: "pnpm",
description: "Fast, disk space efficient package manager",
args: {
name: "Scripts",
filterStrategy: "fuzzy",
generators: npmScriptsGenerator,
isVariadic: true,
},
filterStrategy: "fuzzy",
generateSpec: async (tokens, executeShellCommand) => {
const { script, postProcess } = dependenciesGenerator as Fig.Generator & {
script: string[];
};
if (!postProcess) {
return undefined;
}
const packages = postProcess(
(
await executeShellCommand({
command: script[0],
args: script.slice(1),
})
).stdout,
tokens
)?.map((e: any) => e.name as string);
if (!packages) {
return undefined;
}
const subcommands = packages
.filter((name) => nodeClis.has(name))
.map((name) => ({
name,
loadSpec: name,
icon: "fig://icon?type=package",
}));
return {
name: "pnpm",
subcommands,
} as Fig.Spec;
},
subcommands,
options: COMMON_OPTIONS,
};
export default completionSpec;
ps.tsextensions/terminal-suggest/src/completions/upstream
AddedMark as viewed
const completionSpec: Fig.Spec = {
name: "ps",
description: "Report a snapshot of the current processes",
options: [
{ name: ["-A", "-e"], description: "Select all processes" },
{
name: "-a",
description: "Select all processes except both session leaders",
args: { name: "getsid" },
},
{
name: "-d",
description: "Select all processes except session leaders",
},
{
name: "--deselect",
description:
"Select all processes except those that fulfill the specified conditions",
},
{
name: "-N",
description:
"Select all processes except those that fulfill the specified conditions (negates the selection)",
},
{
name: "--pid",
description: "Select by process ID",
args: { name: "pidlist" },
},
{
name: "--ppid",
description:
"Select by parent process ID. This selects the processes with a parent process ID in pidlist",
args: { name: "pidlist" },
},
{
name: "--sid",
description: "Select by session ID",
args: { name: "sesslist" },
},
{
name: "--tty",
description: "Select by terminal",
args: { name: "ttylist" },
},
{
name: "U",
description: "Select by effective user ID (EUID) or name",
args: { name: "userlist" },
},
{
name: "-U",
description: "Select by real user ID (RUID) or name",
args: { name: "userlist" },
},
{
name: "-u",
description: "Select by effective user ID (EUID) or name",
args: { name: "userlist" },
},
{
name: "--User",
description: "Select by real user ID (RUID) or name",
args: { name: "userlist" },
},
{
name: "--user",
description: "Select by effective user ID (EUID) or name",
args: { name: "userlist" },
},
{
name: "-c",
description: "Show different scheduler information for the -l option",
},
{
name: "--context",
description: "Display security context format (for SE Linux)",
},
{ name: "-f", description: "Do full-format listing" },
{ name: "-F", description: "Extra full format" },
{
name: ["--format", "-o", "o"],
description: "",
args: { name: "format" },
isRepeatable: true,
},
{ name: ["-M", "Z"], description: "(for SE Linux)" },
{ name: ["-y", "-l"], description: "" },
{
name: "--cols",
description: "Set screen width",
args: { name: "n" },
},
{
name: "--columns",
description: "Set screen width",
args: { name: "n" },
},
{
name: "--cumulative",
description:
"Include some dead child process data (as a sum with the parent)",
},
{ name: "--forest", description: "ASCII art process tree" },
{ name: "-H", description: "Show process hierarchy (forest)" },
{
name: "--headers",
description: "Repeat header lines, one per page of output",
},
{
name: "-n",
description: "Set namelist file",
args: { name: "namelist" },
},
{
name: "--lines",
description: "Set screen height",
args: { name: "n" },
},
{
name: ["--no-headers", "--no-heading"],
description: "Print no header line at all",
},
{
name: "--rows",
description: "Set screen height",
args: { name: "n" },
},
{
name: "--sort",
description: "Specify sorting order",
args: { name: "spec" },
},
{
name: "--width",
description: "Set screen width",
args: { name: "n" },
},
{
name: "-L",
description: "Show threads, possibly with LWP and NLWP columns",
},
{
name: "-T",
description: "Show threads, possibly with SPID column",
},
{ name: "--help", description: "Print a help message" },
{ name: "--info", description: "Print debugging info" },
{ name: "--version", description: "Print the procps version" },
],
};
export default completionSpec;
pwd.tsextensions/terminal-suggest/src/completions/upstream
AddedMark as viewed
const completionSpec: Fig.Spec = {
name: "pwd",
description: "Return working directory name",
options: [
{
name: "-L",
description: "Display the logical current working directory",
},
{
name: "-P",
description: "Display the physical current working directory",
},
],
};
export default completionSpec;
python.tsextensions/terminal-suggest/src/completions/upstream
AddedMark as viewed
// import { filepaths } from "@fig/autocomplete-generators";
const completionSpec: Fig.Spec = {
name: "python",
description: "Run the python interpreter",
generateSpec: async (tokens, executeShellCommand) => {
const isDjangoManagePyFilePresentCommand = "cat manage.py | grep -q django";
if (
(
await executeShellCommand({
command: "bash",
args: ["-c", isDjangoManagePyFilePresentCommand],
})
).status === 0
) {
return {
name: "python",
subcommands: [{ name: "manage.py", loadSpec: "django-admin" }],
};
}
},
args: {
name: "python script",
template: "filepaths",
// generators: filepaths({
// extensions: ["py"],
// editFileSuggestions: { priority: 76 },
// }),
},
options: [
{
name: "-c",
insertValue: "-c '{cursor}'",
description:
"Execute the Python code in command. command can be one or more statements separated by newlines, with significant leading whitespace as in normal module code",
args: {
name: "command",
isCommand: true,
},
},
{
name: "-m",
description: "Module",
args: {
name: "python module",
isModule: "python/",
suggestions: ["http.server"],
},
},
{
name: ["-?", "-h", "--help"],
description: "Print a short description of all command line options",
},
{
name: ["-V", "--version"],
description: "Print the Python version number and exit",
},
{
name: "-b",
description:
"Issue a warning when comparing bytes or bytearray with str or bytes with int. Issue an error when the option is given twice (-bb)",
},
{
name: "-B",
description:
"If given, Python wonβt try to write .pyc files on the import of source modules",
},
{
name: "--check-hash-based-pycs",
description:
"Control the validation behavior of hash-based .pyc files. See Cached bytecode invalidation",
args: {
suggestions: [
{ name: "default" },
{ name: "always" },
{ name: "never" },
],
},
},
{
name: "-d",
description:
"Turn on parser debugging output (for expert only, depending on compilation options)",
},
{
name: "-E",
description:
"Ignore all PYTHON* environment variables, e.g. PYTHONPATH and PYTHONHOME, that might be set",
},
{
name: "-i",
description:
"When a script is passed as first argument or the -c option is used, enter interactive mode after executing the script or the command, even when sys.stdin does not appear to be a terminal",
},
{
name: "-I",
description:
"Run Python in isolated mode. This also implies -E and -s. In isolated mode sys.path contains neither the scriptβs directory nor the userβs site-packages directory",
},
{
name: "-O",
description:
"Remove assert statements and any code conditional on the value of __debug__",
},
{
name: "-OO",
description: "Do -O and also discard docstrings",
},
{
name: "-g",
description:
"Donβt display the copyright and version messages even in interactive mode",
},
{
name: "-R",
description:
"Turn on hash randomization. This option only has an effect if the PYTHONHASHSEED environment variable is set to 0, since hash randomization is enabled by default",
},
{
name: "-s",
description: "Donβt add the user site-packages directory to sys.path",
},
{
name: "-S",
description:
"Disable the import of the module site and the site-dependent manipulations of sys.path that it entails",
},
{
name: "-u",
description:
"Force the stdout and stderr streams to be unbuffered. This option has no effect on the stdin stream",
},
{
name: "-v",
description:
"Print a message each time a module is initialized, showing the place (filename or built-in module) from which it is loaded",
},
{
name: "-W",
description:
"Warning control. Pythonβs warning machinery by default prints warning messages to sys.stderr",
args: {},
},
{
name: "-x",
description:
"Skip the first line of the source, allowing use of non-Unix forms of #!cmd. This is intended for a DOS specific hack only",
},
{
name: "-X",
description: "Reserved for various implementation-specific options",
args: {
suggestions: [
{ name: "faulthandler" },
{ name: "showrefcount" },
{ name: "tracemalloc" },
{ name: "showalloccount" },
{ name: "importtime" },
{ name: "dev" },
{ name: "utf8" },
{ name: "pycache_prefix=PATH" },
],
},
},
],
};
export default completionSpec;
scp.tsextensions/terminal-suggest/src/completions/upstream
AddedMark as viewed
import { knownHosts, configHosts } from "./ssh";
const completionSpec: Fig.Spec = {
name: "scp",
description: "Copies files or directories between hosts on a network",
args: [
{
name: "sources",
description: "File or directory, local or remote ([user@]host:[path])",
isVariadic: true,
generators: [
knownHosts,
configHosts,
{ template: ["history", "filepaths", "folders"] },
],
},
{
name: "target",
description: "File or directory, local or remote ([user@]host:[path])",
generators: [
knownHosts,
configHosts,
{ template: ["history", "filepaths", "folders"] },
],
},
],
options: [
{
name: "-3",
description: `Copies between two remote hosts are transferred through the local
host. Without this option the data is copied directly between the
two remote hosts. Note that this option disables the progress
meter and selects batch mode for the second host, since scp cannot
ask for passwords or passphrases for both hosts`,
},
{
name: "-4",
description: "Forces scp to use IPv4 addresses only",
},
{
name: "-6",
description: "Forces scp to use IPv6 addresses only",
},
{
name: "-A",
description:
"Allows forwarding of ssh-agent(1) to the remote system. The default is not to forward an authentication agent",
},
{
name: "-B",
description:
"Selects batch mode (prevents asking for passwords or passphrases)",
},
{
name: "-C",
description:
"Compression enable. Passes the -C flag to ssh(1) to enable compression",
},
{
name: "-c",
description:
"Selects the cipher to use for encrypting the data transfer. This option is directly passed to ssh(1)",
args: {
name: "cipher",
description: "The selected cipher specification",
},
},
{
name: "-F",
description:
"Specifies an alternative per-user configuration file for ssh. This option is directly passed to ssh(1)",
args: {
name: "ssh_config",
description: "The selected ssh config",
},
},
{
name: "-i",
description:
"Selects the file from which the identity (private key) for public key authentication is read. This option is directly passed to ssh(1)",
args: {
name: "identity_file",
description: "Specified identity file",
},
},
{
name: "-J",
description: `Connect to the target host by first making an scp connection to the
jump host described by destination and then establishing a TCP
forwarding to the ultimate destination from there. Multiple jump
hops may be specified separated by comma characters. This is a
shortcut to specify a ProxyJump configuration directive. This
option is directly passed to ssh(1)`,
args: {
name: "destination",
description: "Scp destination",
},
},
{
name: "-l",
description: "Limits the used bandwidth, specified in Kbit/s",
args: {
name: "limit",
description: "Limit bandwidth in Kbit/s",
},
},
{
name: "-o",
description: `Can be used to pass options to ssh in the format used in
ssh_config(5). This is useful for specifying options for which
there is no separate scp command-line flag. For full details of
the options listed below, and their possible values, see
ssh_config(5)`,
args: {
name: "option",
suggestions: [
{ name: "AddressFamily" },
{ name: "BatchMode" },
{ name: "BindAddress" },
{ name: "ChallengeResponseAuthentication" },
{ name: "CheckHostIP" },
{ name: "Cipher" },
{ name: "Ciphers" },
{ name: "ClearAllForwardings" },
{ name: "Compression" },
{ name: "CompressionLevel" },
{ name: "ConnectionAttempts" },
{ name: "ConnectTimeout" },
{ name: "ControlMaster" },
{ name: "ControlPath" },
{ name: "ControlPersist" },
{ name: "DynamicForward" },
{ name: "EscapeChar" },
{ name: "ExitOnForwardFailure" },
{ name: "ForwardAgent" },
{ name: "ForwardX11" },
{ name: "ForwardX11Timeout" },
{ name: "ForwardX11Trusted" },
{ name: "GatewayPorts" },
{ name: "GlobalKnownHostsFile" },
{ name: "GSSAPIAuthentication" },
{ name: "GSSAPIDelegateCredentials" },
{ name: "HashKnownHosts" },
{ name: "Host" },
{ name: "HostbasedAuthentication" },
{ name: "HostKeyAlgorithms" },
{ name: "HostKeyAlias" },
{ name: "HostName" },
{ name: "IdentityFile" },
{ name: "IdentitiesOnly" },
{ name: "IPQoS" },
{ name: "KbdInteractiveAuthentication" },
{ name: "KbdInteractiveDevices" },
{ name: "KexAlgorithms" },
{ name: "LocalCommand" },
{ name: "LocalForward" },
{ name: "LogLevel" },
{ name: "MACs" },
{ name: "NoHostAuthenticationForLocalhost" },
{ name: "NumberOfPasswordPrompts" },
{ name: "PasswordAuthentication" },
{ name: "PermitLocalCommand" },
{ name: "PKCS11Provider" },
{ name: "Port" },
{ name: "PreferredAuthentications" },
{ name: "Protocol" },
{ name: "ProxyCommand" },
{ name: "PubkeyAuthentication" },
{ name: "RekeyLimit" },
{ name: "RequestTTY" },
{ name: "RhostsRSAAuthentication" },
{ name: "RSAAuthentication" },
{ name: "SendEnv" },
{ name: "ServerAliveInterval" },
{ name: "ServerAliveCountMax" },
{ name: "StrictHostKeyChecking" },
{ name: "TCPKeepAlive" },
{ name: "Tunnel" },
{ name: "TunnelDevice" },
{ name: "UsePrivilegedPort" },
{ name: "User" },
{ name: "UserKnownHostsFile" },
{ name: "VerifyHostKeyDNS" },
{ name: "VisualHostKey" },
{ name: "XAuthLocation" },
],
},
},
{
name: "-P",
description: `Specifies the port to connect to on the remote host. Note that
this option is written with a capital βPβ, because -p is already
reserved for preserving the times and modes of the file`,
args: {
name: "port",
},
},
{
name: "-p",
description:
"Preserves modification times, access times, and modes from the original file",
},
{
name: "-q",
description:
"Quiet mode: disables the progress meter as well as warning and diagnostic messages from ssh(1)",
},
{
name: "-r",
description:
"Recursively copy entire directories. Note that scp follows symbolic links encountered in the tree traversal",
},
{
name: "-S",
description:
"Name of program to use for the encrypted connection. The program must understand ssh(1) options",
args: {
name: "program",
},
},
{
name: "-T",
description: `Disable strict filename checking. By default when copying files
from a remote host to a local directory scp checks that the
received filenames match those requested on the command-line to
prevent the remote end from sending unexpected or unwanted files.
Because of differences in how various operating systems and shells
interpret filename wildcards, these checks may cause wanted files
to be rejected. This option disables these checks at the expense
of fully trusting that the server will not send unexpected
filenames`,
},
{
name: "-v",
description:
"Verbose mode. Causes scp and ssh(1) to print debugging messages about their progress. This is helpful in debugging connection, authentication, and configuration problems",
},
],
};
export default completionSpec;
ssh.tsextensions/terminal-suggest/src/completions/upstream
AddedMark as viewed
const knownHostRegex = /(?:[a-zA-Z0-9-]+\.)+[a-zA-Z0-9]+/; // will match numerical IPs as well as domains/subdomains
const resolveAbsolutePath = (
path: string,
basePath: string,
home: string
): string => {
if (path.startsWith("/") || path.startsWith("/") || path === "") {
return path.replace("", home);/") ||
}
if (
basePath.startsWith("/") ||
basePath.startsWith("
basePath === """, home) +
) {
return (
basePath.replace("
(basePath.replace("", home).endsWith("/") ? "" : "/") +/.ssh"
path
);
}
return basePath + (basePath.endsWith("/") ? "" : "/") + path;
};
const getConfigLines = async (
file: string,
executeShellCommand: Fig.ExecuteCommandFunction,
home: string,
basePath: string
) => {
const absolutePath = resolveAbsolutePath(file, basePath, home);
const { stdout } = await executeShellCommand({
command: "cat",
// eslint-disable-next-line @withfig/fig-linter/no-useless-arrays
args: [absolutePath],
});
const configLines = stdout.split("\n").map((line) => line.trim());
// Get list of includes in the config file
const includes = configLines
.filter((line) => line.toLowerCase().startsWith("include "))
.map((line) => line.split(" ")[1]);
// Get the lines of every include file
const includeLines: any = await Promise.all(
includes.map((file) =>
getConfigLines(file, executeShellCommand, home, basePath)
)
);
// Combine config lines with includes config lines
return [...configLines, ...includeLines.flat()];
};
export const knownHosts: Fig.Generator = {
custom: async (tokens, executeCommand, context) => {
const { stdout } = await executeCommand({
command: "cat",
// eslint-disable-next-line @withfig/fig-linter/no-useless-arrays
args: [`${context.environmentVariables["HOME"]}/.ssh/known_hosts`],
});
return stdout
.split("\n")
.map((line) => {
const match = knownHostRegex.exec(line);
if (match) {
return String(match);
}
})
.filter((value, index, self) => value && self.indexOf(value) === index)
.map((knownHost) => ({
name: (tokens[1].endsWith("@") ? tokens[1] : "") + knownHost, // also suggest when user@ is provided
description: "SSH host",
}));
},
trigger: "@",
};
export const configHosts: Fig.Generator = {
custom: async (tokens, executeShellCommand, context) => {
const configLines = await getConfigLines(
"config",
executeShellCommand,
context.environmentVariables["HOME"],
"
);
return configLines
.filter(
(line: any) =>
line.trim().toLowerCase().startsWith("host ") && !line.includes("*")
)
.map((host: any) => ({
name: host.split(" ")[1],
description: "SSH host",
priority: 90,
}));
},
};
const completionSpec: Fig.Spec = {
name: "ssh",
description: "Log into a remote machine",
args: {
name: "user@hostname",
description: "Address of remote machine to log into",
generators: [knownHosts, configHosts, { template: "history" }],
},
options: [
{
name: "-1",
description: "Forces ssh to try protocol version 1 only",
},
{
name: "-2",
description: "Forces ssh to try protocol version 2 only",
},
{
name: "-4",
description: "Forces ssh to use IPv4 addresses only",
},
{
name: "-6",
description: "Forces ssh to use IPv6 addresses only",
},
{
name: "-A",
description: "Enables forwarding of the authentication agent connection",
},
{
name: "-a",
description: "Disables forwarding of the authentication agent connection",
},
{
name: "-b",
description:
"Use bind_address on the local machine as the source address of the connection",
args: {
name: "bind address",
description: "Source address of the connection",
},
},
{
name: "-C",
description:
"Requests compression of all data (including stdin, stdout, stderr, and data for forwarded X11 and TCP connections)",
},
{
name: "-c",
description:
"Selects the cipher specification for encrypting the session",
args: {
name: "cipher spec",
description: "The selected cipher specification",
},
},
{
name: "-D",
description:
"Specifies a local 'dynamic' application-level port forwarding",
args: {
name: "port",
description: "Port of the bind address",
},
},
{
name: "-e",
description:
"Sets the escape character for sessions with a pty (default: '~')",
args: {
name: "escape char",
description: "Specified escape character",
},
},
{
name: "-F",
description: "Specifies an alternative per-user configuration file",
args: {
name: "configfile",
description: "Path to alternative config file",
template: "filepaths",
},
},
{
name: "-f",
description:
"Requests ssh to go to background just before command execution",
},
{
name: "-g",
description: "Allows remote hosts to connect to local forwarded ports",
},
{
name: "-I",
description:
"Specify the PKCS#11 shared library ssh should use to communicate with a PKCS#11 token providing the user's private RSA key",
args: {
name: "pkcs11",
},
},
{
name: "-i",
description:
"Selects a file from which the identity (private key) for public key authentication is read",
isRepeatable: true,
args: {
name: "identity file",
description: "Path to identity (private key)",
template: "filepaths",
},
},
{
name: "-K",
description:
"Enables GSSAPI-based authentication and forwarding (delegation) of GSSAPI credentials to the server",
},
{
name: "-k",
description:
"Disables forwarding (delegation) of GSSAPI credentials to the server",
},
{
name: "-L",
description:
"Specifies that the given port on the local (client) host is to be forwarded to the given host and port on the remote side",
args: {
name: "port:host:hostport",
description: "Local port, followed by host and host port to forward to",
},
},
{
name: "-l",
description: "Specifies the user to log in as on the remote machine",
args: {
name: "login name",
description: "Name of user logging into remote machine",
},
},
{
name: "-M",
description:
"Places the ssh client into ``master'' mode for connection sharing",
isRepeatable: true,
},
{
name: "-m",
description:
"Additionally, for protocol version 2 a comma-separated list of MAC (message authentication code) algorithms can be specified in order of preference",
args: {
name: "mac spec",
},
},
{
name: "-N",
description: "Do not execute a remote command",
},
{
name: "-n",
description:
"Redirects stdin from /dev/null (actually, prevents reading from stdin)",
},
{
name: "-O",
description: "Control an active connection multiplexing master process",
args: {
name: "ctl cmd",
description: "Command that's passed to the master process",
},
},
{
name: "-o",
description:
"Can be used to give options in the format used in the configuration file",
isRepeatable: true,
args: {
name: "option",
description:
"Options that can be specified in the format of the config file",
suggestions: [
{ name: "AddressFamily" },
{ name: "BatchMode" },
{ name: "BindAddress" },
{ name: "ChallengeResponseAuthentication" },
{ name: "CheckHostIP" },
{ name: "Cipher" },
{ name: "Ciphers" },
{ name: "ClearAllForwardings" },
{ name: "Compression" },
{ name: "CompressionLevel" },
{ name: "ConnectionAttempts" },
{ name: "ConnectTimeout" },
{ name: "ControlMaster" },
{ name: "ControlPath" },
{ name: "ControlPersist" },
{ name: "DynamicForward" },
{ name: "EscapeChar" },
{ name: "ExitOnForwardFailure" },
{ name: "ForwardAgent" },
{ name: "ForwardX11" },
{ name: "ForwardX11Timeout" },
{ name: "ForwardX11Trusted" },
{ name: "GatewayPorts" },
{ name: "GlobalKnownHostsFile" },
{ name: "GSSAPIAuthentication" },
{ name: "GSSAPIDelegateCredentials" },
{ name: "HashKnownHosts" },
{ name: "Host" },
{ name: "HostbasedAuthentication" },
{ name: "HostKeyAlgorithms" },
{ name: "HostKeyAlias" },
{ name: "HostName" },
{ name: "IdentityFile" },
{ name: "IdentitiesOnly" },
{ name: "IPQoS" },
{ name: "KbdInteractiveAuthentication" },
{ name: "KbdInteractiveDevices" },
{ name: "KexAlgorithms" },
{ name: "LocalCommand" },
{ name: "LocalForward" },
{ name: "LogLevel" },
{ name: "MACs" },
{ name: "NoHostAuthenticationForLocalhost" },
{ name: "NumberOfPasswordPrompts" },
{ name: "PasswordAuthentication" },
{ name: "PermitLocalCommand" },
{ name: "PKCS11Provider" },
{ name: "Port" },
{ name: "PreferredAuthentications" },
{ name: "Protocol" },
{ name: "ProxyCommand" },
{ name: "PubkeyAuthentication" },
{ name: "RekeyLimit" },
{ name: "RequestTTY" },
{ name: "RhostsRSAAuthentication" },
{ name: "RSAAuthentication" },
{ name: "SendEnv" },
{ name: "ServerAliveInterval" },
{ name: "ServerAliveCountMax" },
{ name: "StrictHostKeyChecking" },
{ name: "TCPKeepAlive" },
{ name: "Tunnel" },
{ name: "TunnelDevice" },
{ name: "UsePrivilegedPort" },
{ name: "User" },
{ name: "UserKnownHostsFile" },
{ name: "VerifyHostKeyDNS" },
{ name: "VisualHostKey" },
{ name: "XAuthLocation" },
],
},
},
{
name: "-p",
description: "Port to connect to on the remote host",
args: {
name: "port",
description: "Port to connect to",
},
},
{
name: "-q",
description:
"Quiet mode. Causes most warning and diagnostic messages to be suppressed",
},
{
name: "-R",
description:
"Specifies that the given port on the remote (server) host is to be forwarded to the given host and port on the local side",
args: {
name: "port:host:hostport",
description: "Local port, followed by host and host port to forward to",
},
},
{
name: "-S",
description:
"Specifies the location of a control socket for connection sharing, or the string 'none' to disable connection sharing",
args: {
name: "ctl_path",
description: "Location of the control socket",
template: "filepaths",
},
},
{
name: "-s",
description:
"May be used to request invocation of a subsystem on the remote system",
},
{
name: "-T",
description: "Disable pseudo-tty allocation",
},
{
name: "-t",
description: "Force pseudo-tty allocation",
isRepeatable: true,
},
{
name: "-V",
description: "Display the version number and exit",
},
{
name: "-v",
description:
"Verbose mode. Causes ssh to print debugging messages about its progress",
isRepeatable: 3,
},
{
name: "-W",
description:
"Requests that standard input and output on the client be forwarded to host on port over the secure channel",
args: {
name: "host:port",
description: "Host and port to forward to",
},
},
{
name: "-w",
description:
"Requests tunnel device forwarding with the specified tun(4) devices between the client (local_tun) and the server (remote_tun)",
args: {
name: "local tun",
description: "Local device to forward to",
},
},
{
name: "-X",
description: "Enables X11 forwarding",
},
{
name: "-x",
description: "Disables X11 forwarding",
},
{
name: "-Y",
description: "Enables trusted X11 forwarding",
},
{
name: "-y",
description: "Send log information using the syslog(3) system module",
},
],
};
export default completionSpec;
tail.tsextensions/terminal-suggest/src/completions/upstream
AddedMark as viewed
const completionSpec: Fig.Spec = {
name: "tail",
description: "Display the last part of a file",
args: {
isVariadic: true,
template: "filepaths",
},
options: [
{
name: "-f",
description: "Wait for additional data to be appended",
},
{
name: "-r",
description: "Display in reverse order",
},
],
};
export default completionSpec;
top.tsextensions/terminal-suggest/src/completions/upstream
AddedMark as viewed
const completionSpec: Fig.Spec = {
name: "top",
description: "Display Linux tasks",
options: [
{
name: ["-h", "-v"],
description: "Show library version and usage prompt",
},
{
name: "-b",
description: "Starts top in Batch mode",
args: {
name: "operation",
},
},
{
name: "-c",
description: "Starts top with last remembered c state reversed",
args: {
name: "toggle",
},
},
{
name: "-i",
description:
"Starts top with the last remembered 'i' state reversed. When this toggle is Off, tasks that are idled or zombied will not be displayed",
args: {
name: "toggle",
},
},
{
name: "-s",
description: "Starts top with secure mode forced",
args: {
name: "delay",
},
},
{
name: "-pid",
description: "Monitor pids",
args: {
name: "process ids",
isVariadic: true,
},
},
],
};
export default completionSpec;
uname.tsextensions/terminal-suggest/src/completions/upstream
AddedMark as viewed
const completionSpec: Fig.Spec = {
name: "uname",
description: "Print operating system name",
options: [
{
name: "-a",
description: "Print all available system information",
},
{
name: "-m",
description: "Print the machine hardware name",
},
{
name: "-n",
description: "Print the system hostname",
},
{
name: "-p",
description: "Print the machine processor architecture name",
},
{
name: "-r",
description: "Print the operating system release",
},
{
name: "-s",
description: "Print the operating system name",
},
{
name: "-v",
description: "Print the operating system version",
},
],
};
export default completionSpec;
vim.tsextensions/terminal-suggest/src/completions/upstream
AddedMark as viewed
const completionSpec: Fig.Spec = {
name: "vim",
description: "Vi IMproved, a programmer's text editor",
args: {
template: "filepaths",
// suggestCurrentToken: true,
},
options: [
{
name: "-v",
description: "Vi mode (like 'vi')",
},
{
name: "-e",
description: "Ex mode (like 'ex')",
},
{
name: "-E",
description: "Improved Ex mode",
},
{
name: "-s",
description:
"Enable silent mode (when in ex mode), or Read Normal mode commands from file",
args: {
name: "scriptin",
template: "filepaths",
isOptional: true,
},
},
{
name: "-d",
description: "Diff mode (like 'vimdiff')",
},
{
name: "-y",
description: "Easy mode (like 'evim', modeless)",
},
{
name: "-R",
description: "Readonly mode (like 'view')",
},
{
name: "-Z",
description: "Restricted mode (like 'rvim')",
},
{
name: "-m",
description: "Modifications (writing files) not allowed",
},
{
name: "-M",
description: "Modifications in text not allowed",
},
{
name: "-b",
description: "Binary mode",
},
{
name: "-l",
description: "Lisp mode",
},
{
name: "-C",
description: "Compatible with Vi: 'compatible'",
},
{
name: "-N",
description: "Not fully Vi compatible: 'nocompatible'",
},
{
name: "-V",
description: "Be verbose [level N] [log messages to fname]",
args: [
{
name: "N",
},
{
name: "fname",
template: "filepaths",
},
],
},
{
name: "-D",
description: "Debugging mode",
},
{
name: "-n",
description: "No swap file, use memory only",
},
{
name: "-r",
description:
"Recover crashed session if filename is specified, otherwise list swap files and exit",
args: {
name: "filename",
isOptional: true,
template: "filepaths",
},
},
{
name: "-L",
description: "Same as -r",
args: {
name: "filename",
template: "filepaths",
},
},
{
name: "-T",
description: "Set terminal type to
args: {
name: "terminal",
},
},
{
name: "--not-a-term",
description: "Skip warning for input/output not being a terminal",
},
{
name: "--ttyfail",
description: "Exit if input or output is not a terminal",
},
{
name: "-u",
description: "Use
args: {
name: "vimrc",
template: "filepaths",
},
},
{
name: "--noplugin",
description: "Don't load plugin scripts",
},
{
name: "-p",
description: "Open N tab pages (default: one for each file)",
args: {
name: "N",
isOptional: true,
},
},
{
name: "-o",
description: "Open N windows (default: one for each file)",
args: {
name: "N",
isOptional: true,
},
},
{
name: "-O",
description: "Like -o but split vertically",
args: {
name: "N",
isOptional: true,
},
},
{
name: "+",
description:
"Start at end of file, if line number is specified, start at that line",
args: {
name: "lnum",
isOptional: true,
},
},
{
name: "--cmd",
description: "Execute
args: {
name: "command",
isCommand: true,
},
},
{
name: "-c",
description: "Execute
args: {
name: "command",
},
},
{
name: "-S",
description: "Source file
args: {
name: "session",
template: "filepaths",
},
},
{
name: "-w",
description: "Append all typed commands to file
args: {
name: "scriptout",
template: "filepaths",
},
},
{
name: "-W",
description: "Write all typed commands to file
args: {
name: "scriptout",
template: "filepaths",
},
},
{
name: "-x",
description: "Edit encrypted files",
},
{
name: "--startuptime",
description: "Write startup timing messages to
args: {
name: "file",
template: "filepaths",
},
},
{
name: "-i",
description: "Use
args: {
name: "viminfo",
template: "filepaths",
},
},
{
name: "--clean",
description: "'nocompatible', Vim defaults, no plugins, no viminfo",
},
{
name: ["-h", "--help"],
description: "Print Help message and exit",
},
{
name: "--version",
description: "Print version information and exit",
},
],
};
export default completionSpec;
wget.tsextensions/terminal-suggest/src/completions/upstream
AddedMark as viewed
const completionSpec: Fig.Spec = {
name: "wget",
description: "A non-interactive network retriever",
args: {
isVariadic: true,
name: "url",
description: "The url(s) to retrieve",
},
options: [
{
name: ["-V", "--version"],
description: "Display the version of Wget and exit",
},
{ name: ["-h", "--help"], description: "Print this help" },
{
name: ["-b", "--background"],
description: "Go to background after startup",
},
{
name: ["-e", "--execute=COMMAND"],
description: "Execute a `.wgetrc'-style command",
},
{ name: ["-o", "--output-file=FILE"], description: "Log messages to FILE" },
{
name: ["-a", "--append-output=FILE"],
description: "Append messages to FILE",
},
{ name: ["-q", "--quiet"], description: "Quiet (no output)" },
{
name: ["-v", "--verbose"],
description: "Be verbose (this is the default)",
},
{
name: ["-nv", "--no-verbose"],
description: "Turn off verboseness, without being quiet",
},
{
name: "--report-speed=TYPE",
description: "Output bandwidth as TYPE. TYPE can be bits",
},
{
name: ["-i", "--input-file=FILE"],
description: "Download URLs found in local or external FILE",
},
{ name: ["-F", "--force-html"], description: "Treat input file as HTML" },
{
name: ["-B", "--base=URL"],
description: "Resolves HTML input-file links (-i -F) relative to URL",
},
{ name: "--config=FILE", description: "Specify config file to use" },
{ name: "--no-config", description: "Do not read any config file" },
{
name: "--rejected-log=FILE",
description: "Log reasons for URL rejection to FILE",
},
{
name: ["-t", "--tries=NUMBER"],
description: "Set number of retries to NUMBER (0 unlimits)",
},
{
name: "--retry-connrefused",
description: "Retry even if connection is refused",
},
{
name: "--retry-on-http-error",
description: "Comma-separated list of HTTP errors to retry",
},
{
name: ["-O", "--output-document=FILE"],
description: "Write documents to FILE",
},
{
name: ["-nc", "--no-clobber"],
description:
"Skip downloads that would download to existing files (overwriting them)",
},
{
name: "--no-netrc",
description: "Don't try to obtain credentials from .netrc",
},
{
name: ["-c", "--continue"],
description: "Resume getting a partially-downloaded file",
},
{
name: "--start-pos=OFFSET",
description: "Start downloading from zero-based position OFFSET",
},
{ name: "--progress=TYPE", description: "Select progress gauge type" },
{
name: "--show-progress",
description: "Display the progress bar in any verbosity mode",
},
{
name: ["-N", "--timestamping"],
description: "Don't re-retrieve files unless newer than local",
},
{ name: ["-S", "--server-response"], description: "Print server response" },
{ name: "--spider", description: "Don't download anything" },
{
name: ["-T", "--timeout=SECONDS"],
description: "Set all timeout values to SECONDS",
},
{
name: "--dns-timeout=SECS",
description: "Set the DNS lookup timeout to SECS",
},
{
name: "--connect-timeout=SECS",
description: "Set the connect timeout to SECS",
},
{
name: "--read-timeout=SECS",
description: "Set the read timeout to SECS",
},
{
name: ["-w", "--wait=SECONDS"],
description: "Wait SECONDS between retrievals",
},
{
name: "--waitretry=SECONDS",
description: "Wait 1..SECONDS between retries of a retrieval",
},
{
name: "--random-wait",
description: "Wait from 0.5*WAIT...1.5*WAIT secs between retrievals",
},
{ name: "--no-proxy", description: "Explicitly turn off proxy" },
{
name: ["-Q", "--quota=NUMBER"],
description: "Set retrieval quota to NUMBER",
},
{
name: "--bind-address=ADDRESS",
description: "Bind to ADDRESS (hostname or IP) on local host",
},
{ name: "--limit-rate=RATE", description: "Limit download rate to RATE" },
{ name: "--no-dns-cache", description: "Disable caching DNS lookups" },
{
name: "--restrict-file-names=OS",
description: "Restrict chars in file names to ones OS allows",
},
{
name: "--ignore-case",
description: "Ignore case when matching files/directories",
},
{
name: ["-4", "--inet4-only"],
description: "Connect only to IPv4 addresses",
},
{
name: ["-6", "--inet6-only"],
description: "Connect only to IPv6 addresses",
},
{
name: "--user=USER",
description: "Set both ftp and http user to USER",
},
{
name: "--password=PASS",
description: "Set both ftp and http password to PASS",
},
{ name: "--ask-password", description: "Prompt for passwords" },
{ name: "--no-iri", description: "Turn off IRI support" },
{
name: "--local-encoding=ENC",
description: "Use ENC as the local encoding for IRIs",
},
{
name: "--remote-encoding=ENC",
description: "Use ENC as the default remote encoding",
},
{ name: "--unlink", description: "Remove file before clobber" },
{
name: "--xattr",
description: "Turn on storage of metadata in extended file attributes",
},
{
name: ["-nd", "--no-directories"],
description: "Don't create directories",
},
{
name: ["-x", "--force-directories"],
description: "Force creation of directories",
},
{
name: ["-nH", "--no-host-directories"],
description: "Don't create host directories",
},
{
name: "--protocol-directories",
description: "Use protocol name in directories",
},
{
name: ["-P", "--directory-prefix=PREFIX"],
description: "Save files to PREFIX/",
},
{
name: "--cut-dirs=NUMBER",
description: "Ignore NUMBER remote directory components",
},
{ name: "--http-user=USER", description: "Set http user to USER" },
{
name: "--http-password=PASS",
description: "Set http password to PASS",
},
{ name: "--no-cache", description: "Disallow server-cached data" },
{
name: ["-E", "--adjust-extension"],
description: "Save HTML/CSS documents with proper extensions",
},
{
name: "--ignore-length",
description: "Ignore 'Content-Length' header field",
},
{
name: "--header=STRING",
description: "Insert STRING among the headers",
},
{
name: "--compression=TYPE",
description:
"Choose compression, one of auto, gzip and none. (default: none)",
},
{
name: "--max-redirect",
description: "Maximum redirections allowed per page",
},
{ name: "--proxy-user=USER", description: "Set USER as proxy username" },
{
name: "--proxy-password=PASS",
description: "Set PASS as proxy password",
},
{
name: "--referer=URL",
description: "Include 'Referer: URL' header in HTTP request",
},
{ name: "--save-headers", description: "Save the HTTP headers to file" },
{
name: ["-U", "--user-agent=AGENT"],
description: "Identify as AGENT instead of Wget/VERSION",
},
{
name: "--no-http-keep-alive",
description: "Disable HTTP keep-alive (persistent connections)",
},
{ name: "--no-cookies", description: "Don't use cookies" },
{
name: "--load-cookies=FILE",
description: "Load cookies from FILE before session",
},
{
name: "--save-cookies=FILE",
description: "Save cookies to FILE after session",
},
{
name: "--keep-session-cookies",
description: "Load and save session (non-permanent) cookies",
},
{
name: "--post-data=STRING",
description: "Use the POST method; send STRING as the data",
},
{
name: "--post-file=FILE",
description: "Use the POST method; send contents of FILE",
},
{
name: "--method=HTTPMethod",
description: 'Use method "HTTPMethod" in the request',
},
{
name: "--body-data=STRING",
description: "Send STRING as data. --method MUST be set",
},
{
name: "--body-file=FILE",
description: "Send contents of FILE. --method MUST be set",
},
{
name: "--content-on-error",
description: "Output the received content on server errors",
},
{
name: "--secure-protocol=PR",
description: "Choose secure protocol, one of auto, SSLv2,",
},
{ name: "--https-only", description: "Only follow secure HTTPS links" },
{
name: "--no-check-certificate",
description: "Don't validate the server's certificate",
},
{ name: "--certificate=FILE", description: "Client certificate file" },
{
name: "--certificate-type=TYPE",
description: "Client certificate type, PEM or DER",
},
{ name: "--private-key=FILE", description: "Private key file" },
{
name: "--private-key-type=TYPE",
description: "Private key type, PEM or DER",
},
{
name: "--ca-certificate=FILE",
description: "File with the bundle of CAs",
},
{
name: "--ca-directory=DIR",
description: "Directory where hash list of CAs is stored",
},
{ name: "--crl-file=FILE", description: "File with bundle of CRLs" },
{
name: "--ciphers=STR",
description:
"Set the priority string (GnuTLS) or cipher list string (OpenSSL) directly",
},
{ name: ["-r", "--recursive"], description: "Specify recursive download" },
{
name: ["-l", "--level=NUMBER"],
description: "Maximum recursion depth (inf or 0 for infinite)",
},
{
name: "--delete-after",
description: "Delete files locally after downloading them",
},
{
name: ["-k", "--convert-links"],
description: "Make links in downloaded HTML or CSS point to local files",
},
{
name: ["-K", "--backup-converted"],
description: "Before converting file X, back up as X.orig",
},
{
name: ["-m", "--mirror"],
description: "Shortcut for -N -r -l inf --no-remove-listing",
},
{
name: ["-p", "--page-requisites"],
description: "Get all images, etc. needed to display HTML page",
},
{
name: ["-A", "--accept=LIST"],
description: "Comma-separated list of accepted extensions",
},
{
name: ["-R", "--reject=LIST"],
description: "Comma-separated list of rejected extensions",
},
{
name: "--accept-regex=REGEX",
description: "Regex matching accepted URLs",
},
{
name: "--reject-regex=REGEX",
description: "Regex matching rejected URLs",
},
{ name: "--regex-type=TYPE", description: "Regex type (posix)" },
{
name: ["-D", "--domains=LIST"],
description: "Comma-separated list of accepted domains",
},
{
name: "--exclude-domains=LIST",
description: "Comma-separated list of rejected domains",
},
{
name: "--follow-ftp",
description: "Follow FTP links from HTML documents",
},
{
name: "--follow-tags=LIST",
description: "Comma-separated list of followed HTML tags",
},
{
name: "--ignore-tags=LIST",
description: "Comma-separated list of ignored HTML tags",
},
{
name: ["-H", "--span-hosts"],
description: "Go to foreign hosts when recursive",
},
{ name: ["-L", "--relative"], description: "Follow relative links only" },
{
name: ["-I", "--include-directories=LIST"],
description: "List of allowed directories",
},
{
name: ["-X", "--exclude-directories=LIST"],
description: "List of excluded directories",
},
{
name: ["-np", "--no-parent"],
description: "Don't ascend to the parent directory",
},
],
};
// GNU Wget 1.20.3, a non-interactive network retriever.
// Usage: wget [OPTION]... [URL]...
// Mandatory arguments to long options are mandatory for short options too.
// Startup:
// -V, --version display the version of Wget and exit
// -h, --help print this help
// -b, --background go to background after startup
// -e, --execute=COMMAND execute a `.wgetrc'-style command
// Logging and input file:
// -o, --output-file=FILE log messages to FILE
// -a, --append-output=FILE append messages to FILE
// -q, --quiet quiet (no output)
// -v, --verbose be verbose (this is the default)
// -nv, --no-verbose turn off verboseness, without being quiet
// --report-speed=TYPE output bandwidth as TYPE. TYPE can be bits
// -i, --input-file=FILE download URLs found in local or external FILE
// -F, --force-html treat input file as HTML
// -B, --base=URL resolves HTML input-file links (-i -F)
// relative to URL
// --config=FILE specify config file to use
// --no-config do not read any config file
// --rejected-log=FILE log reasons for URL rejection to FILE
// Download:
// -t, --tries=NUMBER set number of retries to NUMBER (0 unlimits)
// --retry-connrefused retry even if connection is refused
// --retry-on-http-error=ERRORS comma-separated list of HTTP errors to retry
// -O, --output-document=FILE write documents to FILE
// -nc, --no-clobber skip downloads that would download to
// existing files (overwriting them)
// --no-netrc don't try to obtain credentials from .netrc
// -c, --continue resume getting a partially-downloaded file
// --start-pos=OFFSET start downloading from zero-based position OFFSET
// --progress=TYPE select progress gauge type
// --show-progress display the progress bar in any verbosity mode
// -N, --timestamping don't re-retrieve files unless newer than
// local
// --no-if-modified-since don't use conditional if-modified-since get
// requests in timestamping mode
// --no-use-server-timestamps don't set the local file's timestamp by
// the one on the server
// -S, --server-response print server response
// --spider don't download anything
// -T, --timeout=SECONDS set all timeout values to SECONDS
// --dns-timeout=SECS set the DNS lookup timeout to SECS
// --connect-timeout=SECS set the connect timeout to SECS
// --read-timeout=SECS set the read timeout to SECS
// -w, --wait=SECONDS wait SECONDS between retrievals
// --waitretry=SECONDS wait 1..SECONDS between retries of a retrieval
// --random-wait wait from 0.5*WAIT...1.5*WAIT secs between retrievals
// --no-proxy explicitly turn off proxy
// -Q, --quota=NUMBER set retrieval quota to NUMBER
// --bind-address=ADDRESS bind to ADDRESS (hostname or IP) on local host
// --limit-rate=RATE limit download rate to RATE
// --no-dns-cache disable caching DNS lookups
// --restrict-file-names=OS restrict chars in file names to ones OS allows
// --ignore-case ignore case when matching files/directories
// -4, --inet4-only connect only to IPv4 addresses
// -6, --inet6-only connect only to IPv6 addresses
// --prefer-family=FAMILY connect first to addresses of specified family,
// one of IPv6, IPv4, or none
// --user=USER set both ftp and http user to USER
// --password=PASS set both ftp and http password to PASS
// --ask-password prompt for passwords
// --use-askpass=COMMAND specify credential handler for requesting
// username and password. If no COMMAND is
// specified the WGET_ASKPASS or the SSH_ASKPASS
// environment variable is used.
// --no-iri turn off IRI support
// --local-encoding=ENC use ENC as the local encoding for IRIs
// --remote-encoding=ENC use ENC as the default remote encoding
// --unlink remove file before clobber
// --xattr turn on storage of metadata in extended file attributes
// Directories:
// -nd, --no-directories don't create directories
// -x, --force-directories force creation of directories
// -nH, --no-host-directories don't create host directories
// --protocol-directories use protocol name in directories
// -P, --directory-prefix=PREFIX save files to PREFIX/..
// --cut-dirs=NUMBER ignore NUMBER remote directory components
// HTTP options:
// --http-user=USER set http user to USER
// --http-password=PASS set http password to PASS
// --no-cache disallow server-cached data
// --default-page=NAME change the default page name (normally
// this is 'index.html'.)
// -E, --adjust-extension save HTML/CSS documents with proper extensions
// --ignore-length ignore 'Content-Length' header field
// --header=STRING insert STRING among the headers
// --compression=TYPE choose compression, one of auto, gzip and none. (default: none)
// --max-redirect maximum redirections allowed per page
// --proxy-user=USER set USER as proxy username
// --proxy-password=PASS set PASS as proxy password
// --referer=URL include 'Referer: URL' header in HTTP request
// --save-headers save the HTTP headers to file
// -U, --user-agent=AGENT identify as AGENT instead of Wget/VERSION
// --no-http-keep-alive disable HTTP keep-alive (persistent connections)
// --no-cookies don't use cookies
// --load-cookies=FILE load cookies from FILE before session
// --save-cookies=FILE save cookies to FILE after session
// --keep-session-cookies load and save session (non-permanent) cookies
// --post-data=STRING use the POST method; send STRING as the data
// --post-file=FILE use the POST method; send contents of FILE
// --method=HTTPMethod use method "HTTPMethod" in the request
// --body-data=STRING send STRING as data. --method MUST be set
// --body-file=FILE send contents of FILE. --method MUST be set
// --content-disposition honor the Content-Disposition header when
// choosing local file names (EXPERIMENTAL)
// --content-on-error output the received content on server errors
// --auth-no-challenge send Basic HTTP authentication information
// without first waiting for the server's
// challenge
// HTTPS (SSL/TLS) options:
// --secure-protocol=PR choose secure protocol, one of auto, SSLv2,
// SSLv3, TLSv1, TLSv1_1, TLSv1_2 and PFS
// --https-only only follow secure HTTPS links
// --no-check-certificate don't validate the server's certificate
// --certificate=FILE client certificate file
// --certificate-type=TYPE client certificate type, PEM or DER
// --private-key=FILE private key file
// --private-key-type=TYPE private key type, PEM or DER
// --ca-certificate=FILE file with the bundle of CAs
// --ca-directory=DIR directory where hash list of CAs is stored
// --crl-file=FILE file with bundle of CRLs
// --pinnedpubkey=FILE/HASHES Public key (PEM/DER) file, or any number
// of base64 encoded sha256 hashes preceded by
// 'sha256//' and separated by ';', to verify
// peer against
// --random-file=FILE file with random data for seeding the SSL PRNG
// --ciphers=STR Set the priority string (GnuTLS) or cipher list string (OpenSSL) directly.
// Use with care. This option overrides --secure-protocol.
// The format and syntax of this string depend on the specific SSL/TLS engine.
// HSTS options:
// --no-hsts disable HSTS
// --hsts-file path of HSTS database (will override default)
// FTP options:
// --ftp-user=USER set ftp user to USER
// --ftp-password=PASS set ftp password to PASS
// --no-remove-listing don't remove '.listing' files
// --no-glob turn off FTP file name globbing
// --no-passive-ftp disable the "passive" transfer mode
// --preserve-permissions preserve remote file permissions
// --retr-symlinks when recursing, get linked-to files (not dir)
// FTPS options:
// --ftps-implicit use implicit FTPS (default port is 990)
// --ftps-resume-ssl resume the SSL/TLS session started in the control connection when
// opening a data connection
// --ftps-clear-data-connection cipher the control channel only; all the data will be in plaintext
// --ftps-fallback-to-ftp fall back to FTP if FTPS is not supported in the target server
// WARC options:
// --warc-file=FILENAME save request/response data to a .warc.gz file
// --warc-header=STRING insert STRING into the warcinfo record
// --warc-max-size=NUMBER set maximum size of WARC files to NUMBER
// --warc-cdx write CDX index files
// --warc-dedup=FILENAME do not store records listed in this CDX file
// --no-warc-compression do not compress WARC files with GZIP
// --no-warc-digests do not calculate SHA1 digests
// --no-warc-keep-log do not store the log file in a WARC record
// --warc-tempdir=DIRECTORY location for temporary files created by the
// WARC writer
// Recursive download:
// -r, --recursive specify recursive download
// -l, --level=NUMBER maximum recursion depth (inf or 0 for infinite)
// --delete-after delete files locally after downloading them
// -k, --convert-links make links in downloaded HTML or CSS point to
// local files
// --convert-file-only convert the file part of the URLs only (usually known as the basename)
// --backups=N before writing file X, rotate up to N backup files
// -K, --backup-converted before converting file X, back up as X.orig
// -m, --mirror shortcut for -N -r -l inf --no-remove-listing
// -p, --page-requisites get all images, etc. needed to display HTML page
// --strict-comments turn on strict (SGML) handling of HTML comments
// Recursive accept/reject:
// -A, --accept=LIST comma-separated list of accepted extensions
// -R, --reject=LIST comma-separated list of rejected extensions
// --accept-regex=REGEX regex matching accepted URLs
// --reject-regex=REGEX regex matching rejected URLs
// --regex-type=TYPE regex type (posix)
// -D, --domains=LIST comma-separated list of accepted domains
// --exclude-domains=LIST comma-separated list of rejected domains
// --follow-ftp follow FTP links from HTML documents
// --follow-tags=LIST comma-separated list of followed HTML tags
// --ignore-tags=LIST comma-separated list of ignored HTML tags
// -H, --span-hosts go to foreign hosts when recursive
// -L, --relative follow relative links only
// -I, --include-directories=LIST list of allowed directories
// --trust-server-names use the name specified by the redirection
// URL's last component
// -X, --exclude-directories=LIST list of excluded directories
// -np, --no-parent don't ascend to the parent directory
// Email bug reports, questions, discussions to bug-wget@gnu.org
// and/or open issues at https://savannah.gnu.org/bugs/?func=additem&group=wget.\
export default completionSpec;
yarn.tsextensions/terminal-suggest/src/completions/upstream
AddedMark as viewed
import { npmScriptsGenerator, npmSearchGenerator } from "./npm";
export const yarnScriptParserDirectives: Fig.Arg["parserDirectives"] = {
alias: async (token, executeShellCommand) => {
const npmPrefix = await executeShellCommand({
command: "npm",
// eslint-disable-next-line @withfig/fig-linter/no-useless-arrays
args: ["prefix"],
});
if (npmPrefix.status !== 0) {
throw new Error("npm prefix command failed");
}
const packageJson = await executeShellCommand({
command: "cat",
// eslint-disable-next-line @withfig/fig-linter/no-useless-arrays
args: [`${npmPrefix.stdout.trim()}/package.json`],
});
const script: string = JSON.parse(packageJson.stdout).scripts?.[token];
if (!script) {
throw new Error(`Script not found: '${token}'`);
}
return script;
},
};
export const nodeClis = new Set([
"vue",
"vite",
"nuxt",
"react-native",
"degit",
"expo",
"jest",
"next",
"electron",
"prisma",
"eslint",
"prettier",
"tsc",
"typeorm",
"babel",
"remotion",
"autocomplete-tools",
"redwood",
"rw",
"create-completion-spec",
"publish-spec-to-team",
"capacitor",
"cap",
]);
// generate global package list from global package.json file
const getGlobalPackagesGenerator: Fig.Generator = {
custom: async (tokens, executeCommand, generatorContext) => {
const { stdout: yarnGlobalDir } = await executeCommand({
command: "yarn",
args: ["global", "dir"],
});
const { stdout } = await executeCommand({
command: "cat",
// eslint-disable-next-line @withfig/fig-linter/no-useless-arrays
args: [`${yarnGlobalDir.trim()}/package.json`],
});
if (stdout.trim() == "") return [];
try {
const packageContent = JSON.parse(stdout);
const dependencyScripts = packageContent["dependencies"] || {};
const devDependencyScripts = packageContent["devDependencies"] || {};
const dependencies = [
...Object.keys(dependencyScripts),
...Object.keys(devDependencyScripts),
];
const filteredDependencies = dependencies.filter(
(dependency) => !tokens.includes(dependency)
);
return filteredDependencies.map((dependencyName) => ({
name: dependencyName,
icon: "π¦",
}));
} catch (e) { }
return [];
},
};
// generate package list of direct and indirect dependencies
const allDependenciesGenerator: Fig.Generator = {
script: ["yarn", "list", "--depth=0", "--json"],
postProcess: (out) => {
if (out.trim() == "") return [];
try {
const packageContent = JSON.parse(out);
const dependencies = packageContent.data.trees;
return dependencies.map((dependency: { name: string }) => ({
name: dependency.name.split("@")[0],
icon: "π¦",
}));
} catch (e) { }
return [];
},
};
const configList: Fig.Generator = {
script: ["yarn", "config", "list"],
postProcess: function (out) {
if (out.trim() == "") {
return [];
}
try {
const startIndex = out.indexOf("{");
const endIndex = out.indexOf("}");
let output = out.substring(startIndex, endIndex + 1);
// TODO: fix hacky code
// reason: JSON parse was not working without double quotes
output = output
.replace(/\'/gi, '"')
.replace("lastUpdateCheck", '"lastUpdateCheck"')
.replace("registry", '"lastUpdateCheck"');
const configObject = JSON.parse(output);
if (configObject) {
return Object.keys(configObject).map((key) => ({ name: key }));
}
} catch (e) { }
return [];
},
};
export const dependenciesGenerator: Fig.Generator = {
script: [
"bash",
"-c",
"until [[ -f package.json ]] || [[ $PWD = '/' ]]; do cd ..; done; cat package.json",
],
postProcess: function (out, context = []) {
if (out.trim() === "") {
return [];
}
try {
const packageContent = JSON.parse(out);
const dependencies = packageContent["dependencies"] ?? {};
const devDependencies = packageContent["devDependencies"];
const optionalDependencies = packageContent["optionalDependencies"] ?? {};
Object.assign(dependencies, devDependencies, optionalDependencies);
return Object.keys(dependencies)
.filter((pkgName) => {
const isListed = context.some((current) => current === pkgName);
return !isListed;
})
.map((pkgName) => ({
name: pkgName,
icon: "π¦",
description: dependencies[pkgName]
? "dependency"
: optionalDependencies[pkgName]
? "optionalDependency"
: "devDependency",
}));
} catch (e) {
console.error(e);
return [];
}
},
};
const commonOptions: Fig.Option[] = [
{ name: ["-s", "--silent"], description: "Skip Yarn console logs" },
{
name: "--no-default-rc",
description:
"Prevent Yarn from automatically detecting yarnrc and npmrc files",
},
{
name: "--use-yarnrc",
description:
"Specifies a yarnrc file that Yarn should use (.yarnrc only, not .npmrc) (default: )",
args: { name: "path", template: "filepaths" },
},
{
name: "--verbose",
description: "Output verbose messages on internal operations",
},
{
name: "--offline",
description:
"Trigger an error if any required dependencies are not available in local cache",
},
{
name: "--prefer-offline",
description:
"Use network only if dependencies are not available in local cache",
},
{
name: ["--enable-pnp", "--pnp"],
description: "Enable the Plug'n'Play installation",
},
{
name: "--json",
description: "Format Yarn log messages as lines of JSON",
},
{
name: "--ignore-scripts",
description: "Don't run lifecycle scripts",
},
{ name: "--har", description: "Save HAR output of network traffic" },
{ name: "--ignore-platform", description: "Ignore platform checks" },
{ name: "--ignore-engines", description: "Ignore engines check" },
{
name: "--ignore-optional",
description: "Ignore optional dependencies",
},
{
name: "--force",
description:
"Install and build packages even if they were built before, overwrite lockfile",
},
{
name: "--skip-integrity-check",
description: "Run install without checking if node_modules is installed",
},
{
name: "--check-files",
description: "Install will verify file tree of packages for consistency",
},
{
name: "--no-bin-links",
description: "Don't generate bin links when setting up packages",
},
{ name: "--flat", description: "Only allow one version of a package" },
{
name: ["--prod", "--production"],
description:
"Instruct Yarn to ignore NODE_ENV and take its production-or-not status from this flag instead",
},
{
name: "--no-lockfile",
description: "Don't read or generate a lockfile",
},
{ name: "--pure-lockfile", description: "Don't generate a lockfile" },
{
name: "--frozen-lockfile",
description: "Don't generate a lockfile and fail if an update is needed",
},
{
name: "--update-checksums",
description: "Update package checksums from current repository",
},
{
name: "--link-duplicates",
description: "Create hardlinks to the repeated modules in node_modules",
},
{
name: "--link-folder",
description: "Specify a custom folder to store global links",
args: { name: "path", template: "folders" },
},
{
name: "--global-folder",
description: "Specify a custom folder to store global packages",
args: { name: "path", template: "folders" },
},
{
name: "--modules-folder",
description:
"Rather than installing modules into the node_modules folder relative to the cwd, output them here",
args: { name: "path", template: "folders" },
},
{
name: "--preferred-cache-folder",
description: "Specify a custom folder to store the yarn cache if possible",
args: { name: "path", template: "folders" },
},
{
name: "--cache-folder",
description:
"Specify a custom folder that must be used to store the yarn cache",
args: { name: "path", template: "folders" },
},
{
name: "--mutex",
description: "Use a mutex to ensure only one yarn instance is executing",
args: { name: "type[:specifier]" },
},
{
name: "--emoji",
description: "Enables emoji in output",
args: {
default: "true",
suggestions: ["true", "false"],
},
},
{
name: "--cwd",
description: "Working directory to use",
args: { name: "cwd", template: "folders" },
},
{
name: ["--proxy", "--https-proxy"],
description: "",
args: { name: "host" },
},
{
name: "--registry",
description: "Override configuration registry",
args: { name: "url" },
},
{ name: "--no-progress", description: "Disable progress bar" },
{
name: "--network-concurrency",
description: "Maximum number of concurrent network requests",
args: { name: "number" },
},
{
name: "--network-timeout",
description: "TCP timeout for network requests",
args: { name: "milliseconds" },
},
{
name: "--non-interactive",
description: "Do not show interactive prompts",
},
{
name: "--scripts-prepend-node-path",
description: "Prepend the node executable dir to the PATH in scripts",
},
{
name: "--no-node-version-check",
description:
"Do not warn when using a potentially unsupported Node version",
},
{
name: "--focus",
description:
"Focus on a single workspace by installing remote copies of its sibling workspaces",
},
{
name: "--otp",
description: "One-time password for two factor authentication",
args: { name: "otpcode" },
},
];
export const createCLIsGenerator: Fig.Generator = {
script: function (context) {
if (context[context.length - 1] === "") return undefined;
const searchTerm = "create-" + context[context.length - 1];
return [
"curl",
"-s",
"-H",
"Accept: application/json",
`https://api.npms.io/v2/search?q=${searchTerm}&size=20\`,\
];
},
cache: {
ttl: 100 * 24 * 60 * 60 * 3, // 3 days
},
postProcess: function (out) {
try {
return JSON.parse(out).results.map(
(item: any) =>
({
name: item.package.name.substring(7),
description: item.package.description,
}) as Fig.Suggestion
) as Fig.Suggestion[];
} catch (e) {
return [];
}
},
};
const completionSpec: Fig.Spec = {
name: "yarn",
description: "Manage packages and run scripts",
generateSpec: async (tokens, executeShellCommand) => {
const binaries = (
await executeShellCommand({
command: "bash",
args: [
"-c",
`until [[ -d node_modules/ ]] || [[ $PWD = '/' ]]; do cd ..; done; ls -1 node_modules/.bin/`,
],
})
).stdout.split("\n");
const subcommands = binaries
.filter((name) => nodeClis.has(name))
.map((name) => ({
name: name,
loadSpec: name === "rw" ? "redwood" : name,
icon: "fig://icon?type=package",
}));
return {
name: "yarn",
subcommands,
} as Fig.Spec;
},
args: {
generators: npmScriptsGenerator,
filterStrategy: "fuzzy",
parserDirectives: yarnScriptParserDirectives,
isOptional: true,
isCommand: true,
},
options: [
{
name: "--disable-pnp",
description: "Disable the Plug'n'Play installation",
},
{
name: "--emoji",
description: "Enable emoji in output (default: true)",
args: {
name: "bool",
suggestions: [{ name: "true" }, { name: "false" }],
},
},
{
name: ["--enable-pnp", "--pnp"],
description: "Enable the Plug'n'Play installation",
},
{
name: "--flat",
description: "Only allow one version of a package",
},
{
name: "--focus",
description:
"Focus on a single workspace by installing remote copies of its sibling workspaces",
},
{
name: "--force",
description:
"Install and build packages even if they were built before, overwrite lockfile",
},
{
name: "--frozen-lockfile",
description: "Don't generate a lockfile and fail if an update is needed",
},
{
name: "--global-folder",
description: "Specify a custom folder to store global packages",
args: {
template: "folders",
},
},
{
name: "--har",
description: "Save HAR output of network traffic",
},
{
name: "--https-proxy",
description: "",
args: {
name: "path",
suggestions: [{ name: "https://" }],
},
},
{
name: "--ignore-engines",
description: "Ignore engines check",
},
{
name: "--ignore-optional",
description: "Ignore optional dependencies",
},
{
name: "--ignore-platform",
description: "Ignore platform checks",
},
{
name: "--ignore-scripts",
description: "Don't run lifecycle scripts",
},
{
name: "--json",
description:
"Format Yarn log messages as lines of JSON (see jsonlines.org)",
},
{
name: "--link-duplicates",
description: "Create hardlinks to the repeated modules in node_modules",
},
{
name: "--link-folder",
description: "Specify a custom folder to store global links",
args: {
template: "folders",
},
},
{
name: "--modules-folder",
description:
"Rather than installing modules into the node_modules folder relative to the cwd, output them here",
args: {
template: "folders",
},
},
{
name: "--mutex",
description: "Use a mutex to ensure only one yarn instance is executing",
args: [
{
name: "type",
suggestions: [{ name: ":" }],
},
{
name: "specifier",
suggestions: [{ name: ":" }],
},
],
},
{
name: "--network-concurrency",
description: "Maximum number of concurrent network requests",
args: {
name: "number",
},
},
{
name: "--network-timeout",
description: "TCP timeout for network requests",
args: {
name: "milliseconds",
},
},
{
name: "--no-bin-links",
description: "Don't generate bin links when setting up packages",
},
{
name: "--no-default-rc",
description:
"Prevent Yarn from automatically detecting yarnrc and npmrc files",
},
{
name: "--no-lockfile",
description: "Don't read or generate a lockfile",
},
{
name: "--non-interactive",
description: "Do not show interactive prompts",
},
{
name: "--no-node-version-check",
description:
"Do not warn when using a potentially unsupported Node version",
},
{
name: "--no-progress",
description: "Disable progress bar",
},
{
name: "--offline",
description:
"Trigger an error if any required dependencies are not available in local cache",
},
{
name: "--otp",
description: "One-time password for two factor authentication",
args: {
name: "otpcode",
},
},
{
name: "--prefer-offline",
description:
"Use network only if dependencies are not available in local cache",
},
{
name: "--preferred-cache-folder",
description:
"Specify a custom folder to store the yarn cache if possible",
args: {
template: "folders",
},
},
{
name: ["--prod", "--production"],
description: "",
args: {},
},
{
name: "--proxy",
description: "",
args: {
name: "host",
},
},
{
name: "--pure-lockfile",
description: "Don't generate a lockfile",
},
{
name: "--registry",
description: "Override configuration registry",
args: {
name: "url",
},
},
{
name: ["-s", "--silent"],
description:
"Skip Yarn console logs, other types of logs (script output) will be printed",
},
{
name: "--scripts-prepend-node-path",
description: "Prepend the node executable dir to the PATH in scripts",
args: {
suggestions: [{ name: "true" }, { name: "false" }],
},
},
{
name: "--skip-integrity-check",
description: "Run install without checking if node_modules is installed",
},
{
name: "--strict-semver",
description: "",
},
...commonOptions,
{
name: ["-v", "--version"],
description: "Output the version number",
},
{
name: ["-h", "--help"],
description: "Output usage information",
},
],
subcommands: [
{
name: "add",
description: "Installs a package and any packages that it depends on",
args: {
name: "package",
generators: npmSearchGenerator,
debounce: true,
isVariadic: true,
},
options: [
...commonOptions,
{
name: ["-W", "--ignore-workspace-root-check"],
description: "Required to run yarn add inside a workspace root",
},
{
name: ["-D", "--dev"],
description: "Save package to your `devDependencies`",
},
{
name: ["-P", "--peer"],
description: "Save package to your `peerDependencies`",
},
{
name: ["-O", "--optional"],
description: "Save package to your `optionalDependencies`",
},
{
name: ["-E", "--exact"],
description: "Install exact version",
dependsOn: ["--latest"],
},
{
name: ["-T", "--tilde"],
description:
"Install most recent release with the same minor version",
},
{
name: ["-A", "--audit"],
description: "Run vulnerability audit on installed packages",
},
{
name: ["-h", "--help"],
description: "Output usage information",
},
],
},
{
name: "audit",
description:
"Perform a vulnerability audit against the installed packages",
options: [
{
name: "--summary",
description: "Only print the summary",
},
{
name: "--groups",
description:
"Only audit dependencies from listed groups. Default: devDependencies, dependencies, optionalDependencies",
args: {
name: "group_name",
isVariadic: true,
},
},
{
name: "--level",
description:
"Only print advisories with severity greater than or equal to one of the following: info|low|moderate|high|critical. Default: info",
args: {
name: "severity",
suggestions: [
{ name: "info" },
{ name: "low" },
{ name: "moderate" },
{ name: "high" },
{ name: "critical" },
],
},
},
{
name: ["-h", "--help"],
description: "Output usage information",
},
],
},
{
name: "autoclean",
description:
"Cleans and removes unnecessary files from package dependencies",
options: [
{
name: ["-h", "--help"],
description: "Output usage information",
},
{
name: ["-i", "--init"],
description:
"Creates the .yarnclean file if it does not exist, and adds the default entries",
},
{
name: ["-f", "--force"],
description: "If a .yarnclean file exists, run the clean process",
},
],
},
{
name: "bin",
description: "Displays the location of the yarn bin folder",
options: [
{
name: ["-h", "--help"],
description: "Output usage information",
},
],
},
{
name: "cache",
description: "Yarn cache list will print out every cached package",
options: [
...commonOptions,
{
name: ["-h", "--help"],
description: "Output usage information",
},
],
subcommands: [
{
name: "clean",
description: "Clear global cache",
},
{
name: "dir",
description: "Print yarnβs global cache path",
},
{
name: "list",
description: "Print out every cached package",
options: [
{
name: "--pattern",
description: "Filter cached packages by pattern",
args: {
name: "pattern",
},
},
],
},
],
},
{
name: "config",
description: "Configure yarn",
options: [
{
name: ["-h", "--help"],
description: "Output usage information",
},
],
subcommands: [
{
name: "set",
description: "Sets the config key to a certain value",
options: [
{
name: ["-g", "--global"],
description: "Set global config",
},
],
},
{
name: "get",
description: "Print the value for a given key",
args: {
generators: configList,
},
},
{
name: "delete",
description: "Deletes a given key from the config",
args: {
generators: configList,
},
},
{
name: "list",
description: "Displays the current configuration",
},
],
},
{
name: "create",
description: "Creates new projects from any create-* starter kits",
args: {
name: "cli",
generators: createCLIsGenerator,
loadSpec: async (token) => ({
name: "create-" + token,
type: "global",
}),
isCommand: true,
},
options: [
...commonOptions,
{
name: ["-h", "--help"],
description: "Output usage information",
},
],
},
{
name: "exec",
description: "",
options: [
{
name: ["-h", "--help"],
description: "Output usage information",
},
],
},
{
name: "generate-lock-entry",
description: "Generates a lock file entry",
options: [
{
name: "--use-manifest",
description:
"Specify which manifest file to use for generating lock entry",
args: {
template: "filepaths",
},
},
{
name: "--resolved",
description: "Generate from <*.tgz>#
args: {
template: "filepaths",
},
},
{
name: ["-h", "--help"],
description: "Output usage information",
},
],
},
{
name: "global",
description: "Manage yarn globally",
subcommands: [
{
name: "add",
description: "Install globally packages on your operating system",
args: {
name: "package",
generators: npmSearchGenerator,
debounce: true,
isVariadic: true,
},
},
{
name: "bin",
description: "Displays the location of the yarn global bin folder",
},
{
name: "dir",
description:
"Displays the location of the global installation folder",
},
{
name: "ls",
description: "List globally installed packages (deprecated)",
},
{
name: "list",
description: "List globally installed packages",
},
{
name: "remove",
description: "Remove globally installed packages",
args: {
name: "package",
filterStrategy: "fuzzy",
generators: getGlobalPackagesGenerator,
isVariadic: true,
},
options: [
...commonOptions,
{
name: ["-W", "--ignore-workspace-root-check"],
description:
"Required to run yarn remove inside a workspace root",
},
{
name: ["-h", "--help"],
description: "Output usage information",
},
],
},
{
name: "upgrade",
description: "Upgrade globally installed packages",
options: [
...commonOptions,
{
name: ["-S", "--scope"],
description: "Upgrade packages under the specified scope",
args: { name: "scope" },
},
{
name: ["-L", "--latest"],
description: "List the latest version of packages",
},
{
name: ["-E", "--exact"],
description:
"Install exact version. Only used when --latest is specified",
dependsOn: ["--latest"],
},
{
name: ["-P", "--pattern"],
description: "Upgrade packages that match pattern",
args: { name: "pattern" },
},
{
name: ["-T", "--tilde"],
description:
"Install most recent release with the same minor version. Only used when --latest is specified",
},
{
name: ["-C", "--caret"],
description:
"Install most recent release with the same major version. Only used when --latest is specified",
dependsOn: ["--latest"],
},
{
name: ["-A", "--audit"],
description: "Run vulnerability audit on installed packages",
},
{ name: ["-h", "--help"], description: "Output usage information" },
],
},
{
name: "upgrade-interactive",
description:
"Display the outdated packages before performing any upgrade",
options: [
{
name: "--latest",
description: "Use the version tagged latest in the registry",
},
],
},
],
options: [
...commonOptions,
{
name: "--prefix",
description: "Bin prefix to use to install binaries",
args: {
name: "prefix",
},
},
{
name: "--latest",
description: "Bin prefix to use to install binaries",
},
{
name: ["-h", "--help"],
description: "Output usage information",
},
],
},
{
name: "help",
description: "Output usage information",
},
{
name: "import",
description: "Generates yarn.lock from an npm package-lock.json file",
},
{
name: "info",
description: "Show information about a package",
},
{
name: "init",
description: "Interactively creates or updates a package.json file",
options: [
...commonOptions,
{
name: ["-y", "--yes"],
description: "Use default options",
},
{
name: ["-p", "--private"],
description: "Use default options and private true",
},
{
name: ["-i", "--install"],
description: "Install a specific Yarn release",
args: {
name: "version",
},
},
{
name: "-2",
description: "Generates the project using Yarn 2",
},
{
name: ["-h", "--help"],
description: "Output usage information",
},
],
},
{
name: "install",
description: "Install all the dependencies listed within package.json",
options: [
...commonOptions,
{
name: ["-A", "--audit"],
description: "Run vulnerability audit on installed packages",
},
{
name: ["-h", "--help"],
description: "Output usage information",
},
],
},
{
name: "licenses",
description: "",
subcommands: [
{
name: "list",
description: "List licenses for installed packages",
},
{
name: "generate-disclaimer",
description: "List of licenses from all the packages",
},
],
},
{
name: "link",
description: "Symlink a package folder during development",
args: {
isOptional: true,
name: "package",
},
options: [
...commonOptions,
{
name: ["-h", "--help"],
description: "Output usage information",
},
],
},
{
name: "list",
description: "Lists all dependencies for the current working directory",
options: [
{
name: "--depth",
description: "Restrict the depth of the dependencies",
},
{
name: "--pattern",
description: "Filter the list of dependencies by the pattern",
},
],
},
{
name: "login",
description: "Store registry username and email",
},
{
name: "logout",
description: "Clear registry username and email",
},
{
name: "node",
description: "",
},
{
name: "outdated",
description: "Checks for outdated package dependencies",
options: [
...commonOptions,
{
name: ["-h", "--help"],
description: "Output usage information",
},
],
},
{
name: "owner",
description: "Manage package owners",
subcommands: [
{
name: "list",
description: "Lists all of the owners of a package",
args: {
name: "package",
},
},
{
name: "add",
description: "Adds the user as an owner of the package",
args: {
name: "package",
},
},
{
name: "remove",
description: "Removes the user as an owner of the package",
args: [
{
name: "user",
},
{
name: "package",
},
],
},
],
},
{
name: "pack",
description: "Creates a compressed gzip archive of package dependencies",
options: [
{
name: "--filename",
description:
"Creates a compressed gzip archive of package dependencies and names the file filename",
},
],
},
{
name: "policies",
description: "Defines project-wide policies for your project",
subcommands: [
{
name: "set-version",
description: "Will download the latest stable release",
options: [
{
name: "--rc",
description: "Download the latest rc release",
},
],
},
],
},
{
name: "publish",
description: "Publishes a package to the npm registry",
args: { name: "Tarball or Folder", template: "folders" },
options: [
...commonOptions,
{ name: ["-h", "--help"], description: "Output usage information" },
{
name: "--major",
description: "Auto-increment major version number",
},
{
name: "--minor",
description: "Auto-increment minor version number",
},
{
name: "--patch",
description: "Auto-increment patch version number",
},
{
name: "--premajor",
description: "Auto-increment premajor version number",
},
{
name: "--preminor",
description: "Auto-increment preminor version number",
},
{
name: "--prepatch",
description: "Auto-increment prepatch version number",
},
{
name: "--prerelease",
description: "Auto-increment prerelease version number",
},
{
name: "--preid",
description: "Add a custom identifier to the prerelease",
args: { name: "preid" },
},
{
name: "--message",
description: "Message",
args: { name: "message" },
},
{ name: "--no-git-tag-version", description: "No git tag version" },
{
name: "--no-commit-hooks",
description: "Bypass git hooks when committing new version",
},
{ name: "--access", description: "Access", args: { name: "access" } },
{ name: "--tag", description: "Tag", args: { name: "tag" } },
],
},
{
name: "remove",
description: "Remove installed package",
args: {
filterStrategy: "fuzzy",
generators: dependenciesGenerator,
isVariadic: true,
},
options: [
...commonOptions,
{
name: ["-W", "--ignore-workspace-root-check"],
description: "Required to run yarn remove inside a workspace root",
},
{
name: ["-h", "--help"],
description: "Output usage information",
},
],
},
{
name: "run",
description: "Runs a defined package script",
options: [
...commonOptions,
{ name: ["-h", "--help"], description: "Output usage information" },
],
args: [
{
name: "script",
description: "Script to run from your package.json",
generators: npmScriptsGenerator,
filterStrategy: "fuzzy",
parserDirectives: yarnScriptParserDirectives,
isCommand: true,
},
{
name: "env",
suggestions: ["env"],
description: "Lists environment variables available to scripts",
isOptional: true,
},
],
},
{
name: "tag",
description: "Add, remove, or list tags on a package",
},
{
name: "team",
description: "Maintain team memberships",
subcommands: [
{
name: "create",
description: "Create a new team",
args: {
name: "scope:team",
},
},
{
name: "destroy",
description: "Destroys an existing team",
args: {
name: "scope:team",
},
},
{
name: "add",
description: "Add a user to an existing team",
args: [
{
name: "scope:team",
},
{
name: "
},
],
},
{
name: "remove",
description: "Remove a user from a team they belong to",
args: {
name: "scope:team
},
},
{
name: "list",
description:
"If performed on an organization name, will return a list of existing teams under that organization. If performed on a team, it will instead return a list of all users belonging to that particular team",
args: {
name: "
},
},
],
},
{
name: "unlink",
description: "Unlink a previously created symlink for a package",
},
{
name: "unplug",
description: "",
},
{
name: "upgrade",
description:
"Upgrades packages to their latest version based on the specified range",
args: {
name: "package",
generators: dependenciesGenerator,
filterStrategy: "fuzzy",
isVariadic: true,
isOptional: true,
},
options: [
...commonOptions,
{
name: ["-S", "--scope"],
description: "Upgrade packages under the specified scope",
args: { name: "scope" },
},
{
name: ["-L", "--latest"],
description: "List the latest version of packages",
},
{
name: ["-E", "--exact"],
description:
"Install exact version. Only used when --latest is specified",
dependsOn: ["--latest"],
},
{
name: ["-P", "--pattern"],
description: "Upgrade packages that match pattern",
args: { name: "pattern" },
},
{
name: ["-T", "--tilde"],
description:
"Install most recent release with the same minor version. Only used when --latest is specified",
},
{
name: ["-C", "--caret"],
description:
"Install most recent release with the same major version. Only used when --latest is specified",
dependsOn: ["--latest"],
},
{
name: ["-A", "--audit"],
description: "Run vulnerability audit on installed packages",
},
{ name: ["-h", "--help"], description: "Output usage information" },
],
},
{
name: "upgrade-interactive",
description: "Upgrades packages in interactive mode",
options: [
{
name: "--latest",
description: "Use the version tagged latest in the registry",
},
],
},
{
name: "version",
description: "Update version of your package",
options: [
...commonOptions,
{ name: ["-h", "--help"], description: "Output usage information" },
{
name: "--new-version",
description: "New version",
args: { name: "version" },
},
{
name: "--major",
description: "Auto-increment major version number",
},
{
name: "--minor",
description: "Auto-increment minor version number",
},
{
name: "--patch",
description: "Auto-increment patch version number",
},
{
name: "--premajor",
description: "Auto-increment premajor version number",
},
{
name: "--preminor",
description: "Auto-increment preminor version number",
},
{
name: "--prepatch",
description: "Auto-increment prepatch version number",
},
{
name: "--prerelease",
description: "Auto-increment prerelease version number",
},
{
name: "--preid",
description: "Add a custom identifier to the prerelease",
args: { name: "preid" },
},
{
name: "--message",
description: "Message",
args: { name: "message" },
},
{ name: "--no-git-tag-version", description: "No git tag version" },
{
name: "--no-commit-hooks",
description: "Bypass git hooks when committing new version",
},
{ name: "--access", description: "Access", args: { name: "access" } },
{ name: "--tag", description: "Tag", args: { name: "tag" } },
],
},
{
name: "versions",
description:
"Displays version information of the currently installed Yarn, Node.js, and its dependencies",
},
{
name: "why",
description: "Show information about why a package is installed",
args: {
name: "package",
filterStrategy: "fuzzy",
generators: allDependenciesGenerator,
},
options: [
...commonOptions,
{
name: ["-h", "--help"],
description: "Output usage information",
},
{
name: "--peers",
description:
"Print the peer dependencies that match the specified name",
},
{
name: ["-R", "--recursive"],
description:
"List, for each workspace, what are all the paths that lead to the dependency",
},
],
},
{
name: "workspace",
description: "Manage workspace",
filterStrategy: "fuzzy",
generateSpec: async (_tokens, executeShellCommand) => {
const version = (
await executeShellCommand({
command: "yarn",
// eslint-disable-next-line @withfig/fig-linter/no-useless-arrays
args: ["--version"],
})
).stdout;
const isYarnV1 = version.startsWith("1.");
const getWorkspacesDefinitionsV1 = async () => {
const { stdout } = await executeShellCommand({
command: "yarn",
args: ["workspaces", "info"],
});
const startJson = stdout.indexOf("{");
const endJson = stdout.lastIndexOf("}");
return Object.entries(
JSON.parse(stdout.slice(startJson, endJson + 1)) as Record<
string,
{ location: string }\
).map(([name, { location }]) => ({
name,
location,
}));
};
// For yarn >= 2.0.0
const getWorkspacesDefinitionsVOther = async () => {
// yarn workspaces list --json
const out = (
await executeShellCommand({
command: "yarn",
args: ["workspaces", "list", "--json"],
})
).stdout;
return out.split("\n").map((line) => JSON.parse(line.trim()));
};
try {
const workspacesDefinitions = isYarnV1
? // transform Yarn V1 output to array of workspaces like Yarn V2
await getWorkspacesDefinitionsV1()
: // in yarn v>=2.0.0, workspaces definitions are a list of JSON lines
await getWorkspacesDefinitionsVOther();
const subcommands: Fig.Subcommand[] = workspacesDefinitions.map(
({ name, location }: { name: string; location: string }) => ({
name,
description: "Workspaces",
args: {
name: "script",
generators: {
cache: {
strategy: "stale-while-revalidate",
ttl: 60_000, // 60s
},
script: ["cat", `${location}/package.json`],
postProcess: function (out: string) {
if (out.trim() == "") {
return [];
}
try {
const packageContent = JSON.parse(out);
const scripts = packageContent["scripts"];
if (scripts) {
return Object.keys(scripts).map((script) => ({
name: script,
}));
}
} catch (e) { }
return [];
},
},
},
})
);
return {
name: "workspace",
subcommands,
};
} catch (e) {
console.error(e);
}
return { name: "workspaces" };
},
},
{
name: "workspaces",
description: "Show information about your workspaces",
options: [
{
name: "subcommand",
description: "",
args: {
suggestions: [{ name: "info" }, { name: "run" }],
},
},
{
name: "flags",
description: "",
},
],
},
{
name: "set",
description: "Set global Yarn options",
subcommands: [
{
name: "resolution",
description: "Enforce a package resolution",
args: [
{
name: "descriptor",
description:
"A descriptor for the package, in the form of 'lodash@npm:^1.2.3'",
},
{
name: "resolution",
description: "The version of the package to resolve",
},
],
options: [
{
name: ["-s", "--save"],
description:
"Persist the resolution inside the top-level manifest",
},
],
},
{
name: "version",
description: "Lock the Yarn version used by the project",
args: {
name: "version",
description:
"Use the specified version, which can also be a Yarn 2 build (e.g 2.0.0-rc.30) or a Yarn 1 build (e.g 1.22.1)",
template: "filepaths",
suggestions: [
{
name: "from-sources",
insertValue: "from sources",
},
"latest",
"canary",
"classic",
"self",
],
},
options: [
{
name: "--only-if-needed",
description:
"Only lock the Yarn version if it isn't already locked",
},
],
},
],
},
],
};
export default completionSpec;
\
4Register New Specs in Constants\
0 / 1
constants.tsextensions/terminal-suggest/src
Mark as viewed
export const upstreamSpecs = [
'echo',
'ls',
'echo',
'mkdir',
'rm',
'rmdir',
'touch',
'git'
'pwd',
'brew',
'cp',
'mv',
'cat',
'less',
'more',
'head',
'tail',
'nano',
'vim',
'chmod',
'chown',
'uname',
'top',
'df',
'du',
'ps',
'kill',
'killall',
'curl',
'wget',
'ssh',
'scp',
'apt',
'grep',
'find',
'git',
'npm',
'yarn',
'python',
'pnpm',
'node',
'nvm',
'npx',
];
End of changesChat about this PR
InfoChat
\
7 Potential bugs\
kill generator can throw on trailing empty ps output line (path is undefined)
Bugkill.ts:19
npm dependenciesGenerator can throw when devDependencies is missing
Bugnpm.ts:170
yarn dependenciesGenerator can throw when devDependencies is missing
Bugyarn.ts:148
apt installed/upgradable package generators can produce empty suggestion names
Bugapt.ts:39
brew spec typo uses --cash instead of --cask
Bugbrew.ts:360
brew list/ls defines --pinned option twice
Bugbrew.ts:133
pnpm recursive option suggests malformed value "dee["
Bugpnpm.ts:771
\
6 Flags\
node.ts uses incorrect template value for script files
Investigatenode.ts:6-14
Function-based script generators may not execute in current implementation
InvestigateterminalSuggestMain.ts:252-285
Generators execute shell commands that could be expensive or slow
InvestigateterminalSuggestMain.ts:252-261
Yarn configList generator uses fragile string replacement hack
Investigateyarn.ts:119-125
ssh.ts getConfigLines uses recursion without depth limit
ssh.ts:23-54
Inconsistent error logging across generators
upstream
\
ChecksPassed0/0\
All checks passed
\
Reviewers1\
MEmeganrogge
\
Assignees1\
TYTyriar
\
Labels\
No labels assigned
\
Introducing Devin Review\
Devin Review is an intelligent PR review tool that helps you better understand your team's code before you ship it.
1
Intelligently organizes your diff
Groups changes into logical sections with clear explanations
β
2
Detects moved or copied code
Keeps the diff clean by highlighting copy-pasted or moved code
3
Analyzes your PR
Highlights potential bugs and flags areas that deserve extra careful review
Ask questions or request edits in the chat.
Ask Devin anything about this PR (Ctrl+I)
Authorization Response