You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
set-l bun_install_boolean_flags yarn production optional development no-save dry-run force no-cache silent verbose global
54
36
set-l bun_install_boolean_flags_descriptions "Write a yarn.lock file (yarn v1)""Don't install devDependencies""Add dependency to optionalDependencies""Add dependency to devDependencies""Don't install devDependencies""Don't install anything""Always request the latest versions from the registry & reinstall all dependencies""Ignore manifest cache entirely""Don't output anything""Excessively verbose logging""Use global folder"
55
37
56
-
set-l bun_builtin_cmds dev create help bun upgrade discord run install remove add init linkunlink pm x
57
38
set-l bun_builtin_cmds_without_run dev create help bun upgrade discord install remove add init pm x
58
-
set-l bun_builtin_cmds_without_bun dev create help upgrade run discord install remove add init pm x
59
-
set-l bun_builtin_cmds_without_create dev help bun upgrade discord run install remove add init pm x
60
-
set-l bun_builtin_cmds_without_install create dev help bun upgrade discord run remove add init pm x
61
-
set-l bun_builtin_cmds_without_remove create dev help bun upgrade discord run install add init pm x
62
-
set-l bun_builtin_cmds_without_add create dev help bun upgrade discord run remove install init pm x
63
-
set-l bun_builtin_cmds_without_pm create dev help bun upgrade discord run init pm x
64
-
65
-
# clear
39
+
set-l bun_builtin_cmds_accepting_flags create help bun upgrade discord run init linkunlink pm x
40
+
41
+
function __bun_complete_bins_scripts --inherit-variable bun_builtin_cmds_without_run -d"Emit bun completions for bins and scripts"
42
+
# Do nothing if we already have a builtin subcommand,
# Emit binaries and JS files (but only if we're doing `bun run`).
64
+
if__fish_seen_subcommand_from run
65
+
for bin in$bins
66
+
echo"$bin"\t"package bin"
67
+
end
68
+
forfilein (__fish__get_bun_bun_js_files)
69
+
echo"$file"\t"Bun.js"
70
+
end
71
+
end
72
+
end
73
+
74
+
75
+
# Clear existing completions
66
76
complete-e-c bun
67
77
78
+
# Dynamically emit scripts and binaries
79
+
complete-c bun -f-a"(__bun_complete_bins_scripts)"
80
+
81
+
# Complete flags if we have no subcommand or a flag-friendly one.
82
+
set-l flag_applies "__fish_use_subcommand; or __fish_seen_subcommand_from $bun_builtin_cmds_accepting_flags"
68
83
complete-c bun \
69
-
-n"not __fish_seen_subcommand_from $bun_builtin_cmds_without_run; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_use_subcommand"-a'(__fish__get_bun_scripts)'-d'script'
70
-
complete-c bun \
71
-
-n"not __fish_seen_subcommand_from $bun_builtin_cmds_without_run; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from run"-a'(__fish__get_bun_bins)'-d'package bin'
72
-
complete-c bun \
73
-
-n"not __fish_seen_subcommand_from $bun_builtin_cmds_without_run; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from run"-a'(__fish__get_bun_scripts)'-d'script'
74
-
complete-c bun \
75
-
-n"not __fish_seen_subcommand_from $bun_builtin_cmds_without_run; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from run"-a'(__fish__get_bun_bun_js_files)'-d'Bun.js'
76
-
complete-c bun \
77
-
-n"bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __fish_use_subcommand"-a'run'-f-d'Run a script or bin'
-n"not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) install remove add;"--no-files-s'p'-l'port'-r-d'Port number to start server from'
86
+
-n$flag_applies--no-files-s'p'-l'port'-r-d'Port number to start server from'
82
87
complete-c bun \
83
-
-n"not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) install remove add;"--no-files-s'd'-l'define'-r-d'Substitute K:V while parsing, e.g. --define process.env.NODE_ENV:\"development\"'
88
+
-n$flag_applies--no-files-s'd'-l'define'-r-d'Substitute K:V while parsing, e.g. --define process.env.NODE_ENV:\"development\"'
84
89
complete-c bun \
85
-
-n"not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) install remove add;"--no-files-s'e'-l'external'-r-d'Exclude module from transpilation (can use * wildcards). ex: -e react'
90
+
-n$flag_applies--no-files-s'e'-l'external'-r-d'Exclude module from transpilation (can use * wildcards). ex: -e react'
-n$flag_applies--no-files-l'use'-r-d'Use a framework (ex: next)'
88
93
complete-c bun \
89
-
-n"not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) install remove add;"--no-files-l'hot'-r-d'Enable hot reloading in Bun\'s JavaScript runtime'
90
-
94
+
-n$flag_applies--no-files-l'hot'-r-d'Enable hot reloading in Bun\'s JavaScript runtime'
95
+
96
+
# Complete dev and create as first subcommand.
91
97
complete-c bun \
92
-
-n"bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __fish_use_subcommand"-a'dev'-d'Start dev server'
98
+
-n"__fish_use_subcommand"-a'dev'-d'Start dev server'
93
99
complete-c bun \
94
-
-n"bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __bun_command_count 1 and __fish_use_subcommand"-a'create'-f-d'Create a new project from a template'
100
+
-n"__fish_use_subcommand"-a'create'-f-d'Create a new project from a template'
95
101
102
+
# Complete "next" and "react" if we've seen "create".
96
103
complete-c bun \
97
-
-n"not __fish_seen_subcommand_from $bun_builtin_cmds_without_create next react; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from create;"-a'next'-d'new Next.js project'
-n"not __fish_seen_subcommand_from $bun_builtin_cmds_without_create next react; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from create;"-a'react'-d'new React project'
-n"not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_use_subcommand"-a'upgrade'-d'Upgrade bun to the latest version'-x
111
+
-n"__fish_use_subcommand"-a'upgrade'-d'Upgrade bun to the latest version'-x
112
+
# Complete "-h/--help" unconditionally.
104
113
complete-c bun \
105
-
-n"not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_use_subcommand"-a'--help'-d'See all commands and flags'-x
114
+
-s"h"-l"help"-d'See all commands and flags'-x
106
115
116
+
# Complete "-v/--version" if we have no subcommand.
107
117
complete-c bun \
108
-
-n"not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_use_subcommand"-l"version"-s"v"-a'--version'-d'Bun\'s version'-x
-n"not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_use_subcommand"-a'discord'-d'Open bun\'s Discord server'-x
-n"not __fish_seen_subcommand_from $bun_builtin_cmds_without_bun; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); __fish_use_subcommand"-a'bun'-d'Generate a new bundle'
126
+
-n"__fish_use_subcommand"-a'bun'-d'Generate a new bundle'
115
127
116
128
117
129
complete-c bun \
118
-
-n"not __fish_seen_subcommand_from $bun_builtin_cmds_without_bun; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from bun"-F-d'Bundle this'
-n"not __fish_seen_subcommand_from $bun_builtin_cmds_without_create; and not __fish_seen_subcommand_from (__fish__get_bun_bins); and not __fish_seen_subcommand_from (__fish__get_bun_scripts); and __fish_seen_subcommand_from react; or __fish_seen_subcommand_from next"-F-d"Create in directory"
133
+
-n"__fish_seen_subcommand_from create; and __fish_seen_subcommand_from react next"-F-d"Create in directory"
122
134
123
135
124
136
complete-c bun \
125
-
-n"bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __bun_command_count 1 and __fish_use_subcommand"-a'init'-F-d'Start an empty Bun project'
137
+
-n"__fish_use_subcommand"-a'init'-F-d'Start an empty Bun project'
126
138
127
139
complete-c bun \
128
-
-n"bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __bun_command_count 1 and __fish_use_subcommand"-a'install'-f-d'Install packages from package.json'
140
+
-n"__fish_use_subcommand"-a'install'-f-d'Install packages from package.json'
129
141
130
142
complete-c bun \
131
-
-n"bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __bun_command_count 1 and __fish_use_subcommand"-a'add'-F-d'Add a package to package.json'
132
-
133
-
complete-c bun \
134
-
-n"bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __bun_command_count 1 and __fish_use_subcommand"-a'remove'-F-d'Remove a package from package.json'
143
+
-n"__fish_use_subcommand"-a'add'-F-d'Add a package to package.json'
135
144
136
145
complete-c bun \
137
-
-n"bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __bun_command_count 1 and __fish_use_subcommand add remove"-F
146
+
-n"__fish_use_subcommand"-a'remove'-F-d'Remove a package from package.json'
147
+
138
148
139
-
140
149
for i in (seq (count$bun_install_boolean_flags))
141
150
complete-c bun \
142
-
-n"not __fish_seen_subcommand_from $bun_builtin_cmds_without_pm; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from install add remove;"-l"$bun_install_boolean_flags[$i]"-d"$bun_install_boolean_flags_descriptions[$i]"
-n"not __fish_seen_subcommand_from $bun_builtin_cmds_without_pm; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from install add remove;"-l'cwd'-d'Change working directory'
155
+
-n"__fish_seen_subcommand_from install add remove"-l'cwd'-d'Change working directory'
147
156
148
157
complete-c bun \
149
-
-n"not __fish_seen_subcommand_from $bun_builtin_cmds_without_pm; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from install add remove;"-l'cache-dir'-d'Choose a cache directory (default: $HOME/.bun/install/cache)'
158
+
-n"__fish_seen_subcommand_from install add remove"-l'cache-dir'-d'Choose a cache directory (default: $HOME/.bun/install/cache)'
150
159
151
160
complete-c bun \
152
-
-n"not __fish_seen_subcommand_from $bun_builtin_cmds_without_pm; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from add;"-d'Popular'-a'(__fish__get_bun_packages)'
-n"not __fish_seen_subcommand_from $bun_builtin_cmds_without_pm; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from add;"-d'History'-a'(__history_completions)'
-n"__fish_seen_subcommand_from pm; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) cache;"-a'bin ls cache hash hash-print hash-string'-f
159
168
160
169
complete-c bun \
161
170
-n"__fish_seen_subcommand_from pm; and __fish_seen_subcommand_from cache; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts);"-a'rm'-f
162
171
163
-
complete-c bun -n"not __fish_seen_subcommand_from $bun_builtin_cmds (__fish__get_bun_bins) (__fish__get_bun_scripts)"-a"$bun_builtin_cmds"-f
172
+
# Add built-in subcommands with descriptions.
173
+
complete-c bun -n"__fish_use_subcommand"-a"create"-f-d"Create a new project from a template"
174
+
complete-c bun -n"__fish_use_subcommand"-a"build bun"--require-parameter-F-d"Transpile and bundle one or more files"
175
+
complete-c bun -n"__fish_use_subcommand"-a"upgrade"-d"Upgrade Bun"
176
+
complete-c bun -n"__fish_use_subcommand"-a"run"-d"Run a script or package binary"
177
+
complete-c bun -n"__fish_use_subcommand"-a"install"-d"Install dependencies from package.json"-f
178
+
complete-c bun -n"__fish_use_subcommand"-a"remove"-d"Remove a dependency from package.json"-f
179
+
complete-c bun -n"__fish_use_subcommand"-a"add"-d"Add a dependency to package.json"-f
180
+
complete-c bun -n"__fish_use_subcommand"-a"init"-d"Initialize a Bun project in this directory"-f
181
+
complete-c bun -n"__fish_use_subcommand"-a"link"-d"Register or link a local npm package"-f
182
+
complete-c bun -n"__fish_use_subcommand"-a"link"-d"Unregister a local npm package"-f
183
+
complete-c bun -n"__fish_use_subcommand"-a"pm"-d"Additional package management utilities"-f
184
+
complete-c bun -n"__fish_use_subcommand"-a"x"-d"Execute a package binary, installing if needed"-f
0 commit comments