id = "bun" name = "Bun" homepage = "https://bun.com" description = "Bun is an all-in-one toolkit for JavaScript and TypeScript apps." icon = "SimpleIcons:bun" executables = ["bun", "bunx"] [dotfiles] # https://bun.com/docs/runtime/bunfig — "Bun will search for a global bunfig at # $HOME/.bunfig.toml" (also $XDG_CONFIG_HOME/.bunfig.toml when that variable is # set). Everything else under ~/.bun is the installer's own store, not config. paths = ["~/.bunfig.toml"] # ~/.bun holds the globally installed packages, their bin shims and the install # cache — a machine-local package store that `bun install -g` rebuilds. exclude = [ "~/.bun/install/cache/", "~/.bun/install/global/", "~/.bun/bin/", ] # bunfig.toml is worth syncing whole: registry hosts, scopes, test and runtime # options. Only the auth fields inside it come out. secret = [] # Read at the start of each command, so a rewrite between runs is harmless. side_effect = false # The registry token and the per-scope token / password documented under # "install.registry" and "install.scopes" are npm credentials. [[dotfiles.secret_paths]] file = "~/.bunfig.toml" match = { key_path = ["install.registry.token", "install.scopes.*.token", "install.scopes.*.password"] } [commands] format = 1 label = "Run a file with Bun" description = "Run a script or file with Bun's runtime. Use the subcommand tabs for run, install, add, test, build and init; debugger, JSX and loader options are left out." quality = "ai-draft" base = "fig:bun" parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false } [[commands.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/bun.ts" license = "MIT" [[commands.field]] id = "file" label = "File or script" description = "Entry file to run." type = "path" position = 0 path = { kind = "file", role = "input" } sources = ["fig"] [[commands.field]] id = "hot" label = "Hot reload" description = "Auto reload in the runtime, test runner or bundler." type = "boolean" option = ["--hot"] sources = ["fig"] [[commands.field]] id = "watch" label = "Restart on change" description = "Automatically restart the process on file change." type = "boolean" option = ["--watch"] sources = ["fig"] [[commands.task]] id = "watch" label = "Run and restart on change" fields = ["file", "watch"] required = ["file"] set = { watch = [true] } [[commands.group]] id = "basic" label = "Basic" fields = ["file", "hot", "watch"] [[commands.subcommand]] path = ["run"] label = "Run script" description = "Run a package.json script or executable. Flags are not in the completion data." parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false } [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/bun.ts" license = "MIT" [[commands.subcommand.field]] id = "script" label = "Script" type = "string" position = 0 suggestions = [{ value = "dev", label = "dev" }, { value = "build", label = "build" }, { value = "start", label = "start" }, { value = "test", label = "test" }] sources = ["fig"] [[commands.subcommand.task]] id = "dev" label = "Run dev" fields = ["script"] required = ["script"] set = { script = ["dev"] } [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["script"] [[commands.subcommand]] path = ["i"] label = "Install dependencies" description = "Install dependencies from package.json (bun i)." parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false } [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/bun.ts" license = "MIT" [[commands.subcommand.field]] id = "production" label = "Production only" description = "Do not install devDependencies." type = "boolean" option = ["--production", "-p"] sources = ["fig"] [[commands.subcommand.field]] id = "frozen_lockfile" label = "Frozen lockfile" description = "Disallow changes to the lockfile." type = "boolean" option = ["--frozen-lockfile"] sources = ["fig"] [[commands.subcommand.field]] id = "dry_run" label = "Dry run" description = "Do not install anything." type = "boolean" option = ["--dry-run"] sources = ["fig"] [[commands.subcommand.field]] id = "force" label = "Force reinstall" type = "boolean" option = ["--force", "-f"] sources = ["fig"] [[commands.subcommand.field]] id = "global" label = "Global" type = "boolean" option = ["--global", "-g"] sources = ["fig"] [[commands.subcommand.field]] id = "ignore_scripts" label = "Skip lifecycle scripts" type = "boolean" option = ["--ignore-scripts"] sources = ["fig"] [[commands.subcommand.field]] id = "cwd" label = "Working directory" type = "path" option = ["--cwd"] path = { kind = "directory", role = "input" } sources = ["fig"] [[commands.subcommand.task]] id = "ci" label = "Reproducible install" fields = ["frozen_lockfile", "production"] required = [] set = { frozen_lockfile = [true] } [[commands.subcommand.task]] id = "dry" label = "Dry run" fields = ["dry_run"] required = [] set = { dry_run = [true] } [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["production", "frozen_lockfile", "dry_run"] [[commands.subcommand.group]] id = "advanced" label = "Advanced" fields = ["force", "global", "ignore_scripts", "cwd"] [[commands.subcommand]] path = ["a"] label = "Add packages" description = "Add dependencies to package.json (bun a)." parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false } [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/bun.ts" license = "MIT" [[commands.subcommand.field]] id = "package" label = "Packages" type = "string" position = 0 multiple = true sources = ["fig"] [[commands.subcommand.field]] id = "dev" label = "As devDependency" type = "boolean" option = ["--dev", "-d"] sources = ["fig"] [[commands.subcommand.field]] id = "optional" label = "As optionalDependency" type = "boolean" option = ["--optional"] sources = ["fig"] [[commands.subcommand.field]] id = "exact" label = "Exact version" type = "boolean" option = ["--exact"] sources = ["fig"] [[commands.subcommand.field]] id = "global" label = "Global" type = "boolean" option = ["--global", "-g"] sources = ["fig"] [[commands.subcommand.field]] id = "dry_run" label = "Dry run" type = "boolean" option = ["--dry-run"] sources = ["fig"] [[commands.subcommand.task]] id = "add" label = "Add dependency" fields = ["package", "exact"] required = ["package"] [[commands.subcommand.task]] id = "add-dev" label = "Add dev dependency" fields = ["package", "dev"] required = ["package"] set = { dev = [true] } [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["package", "dev", "exact"] [[commands.subcommand.group]] id = "advanced" label = "Advanced" fields = ["optional", "global", "dry_run"] [[commands.subcommand]] path = ["test"] label = "Run tests" description = "Run unit tests with Bun." parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false } [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/bun.ts" license = "MIT" [[commands.subcommand.field]] id = "files" label = "Test files or filters" type = "string" position = 0 multiple = true sources = ["fig"] [[commands.subcommand.field]] id = "test_name_pattern" label = "Test name pattern" description = "Run only tests whose name matches this regex." type = "string" option = ["--test-name-pattern", "-t"] sources = ["fig"] [[commands.subcommand.field]] id = "timeout" label = "Per-test timeout (ms)" type = "integer" option = ["--timeout"] sources = ["fig"] [[commands.subcommand.field]] id = "only" label = "Only test.only()" type = "boolean" option = ["--only"] sources = ["fig"] [[commands.subcommand.field]] id = "coverage" label = "Coverage" type = "boolean" option = ["--coverage"] sources = ["fig"] [[commands.subcommand.field]] id = "update_snapshots" label = "Update snapshots" description = "Rewrites snapshot files." type = "boolean" option = ["--update-snapshots"] effect = "overwrite" sources = ["fig"] [[commands.subcommand.field]] id = "watch" label = "Watch" type = "boolean" option = ["--watch"] sources = ["fig"] [[commands.subcommand.field]] id = "rerun_each" label = "Re-run each file N times" type = "integer" option = ["--rerun-each"] sources = ["fig"] [[commands.subcommand.task]] id = "coverage" label = "Tests with coverage" fields = ["files", "coverage"] required = [] set = { coverage = [true] } [[commands.subcommand.task]] id = "watch" label = "Watch mode" fields = ["files", "watch"] required = [] set = { watch = [true] } [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["files", "test_name_pattern", "only", "coverage"] [[commands.subcommand.group]] id = "advanced" label = "Advanced" fields = ["timeout", "update_snapshots", "watch", "rerun_each"] [[commands.subcommand]] path = ["build"] label = "Bundle files" description = "Bundle entry points with Bun's bundler." parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false } [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/bun.ts" license = "MIT" [[commands.subcommand.field]] id = "entrypoints" label = "Entry points" description = "Several entry points require an output directory." type = "path" position = 0 multiple = true path = { kind = "file", role = "input" } sources = ["fig"] [[commands.subcommand.field]] id = "outdir" label = "Output directory" type = "path" option = ["--outdir"] path = { kind = "directory", role = "output" } sources = ["fig"] [[commands.subcommand.field]] id = "outfile" label = "Output file" type = "path" option = ["--outfile"] path = { kind = "file", role = "output" } sources = ["fig"] [[commands.subcommand.field]] id = "minify" label = "Minify" type = "boolean" option = ["--minify"] sources = ["fig"] [[commands.subcommand.field]] id = "target" label = "Target environment" type = "string" option = ["--target"] suggestions = [{ value = "browser", label = "browser" }, { value = "bun", label = "bun" }, { value = "node", label = "node" }] sources = ["fig"] [[commands.subcommand.field]] id = "splitting" label = "Code splitting" type = "boolean" option = ["--splitting"] sources = ["fig"] [[commands.subcommand.field]] id = "sourcemap" label = "Sourcemap" type = "string" option = ["--sourcemap"] suggestions = [{ value = "inline", label = "inline" }, { value = "external", label = "external" }, { value = "none", label = "none" }] sources = ["fig"] [[commands.subcommand.field]] id = "watch" label = "Watch" type = "boolean" option = ["--watch"] sources = ["fig"] [[commands.subcommand.task]] id = "bundle" label = "Minified bundle" fields = ["entrypoints", "outdir", "minify"] required = ["entrypoints"] set = { minify = [true] } [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["entrypoints", "outdir", "outfile", "minify", "target"] [[commands.subcommand.group]] id = "advanced" label = "Advanced" fields = ["splitting", "sourcemap", "watch"] [[commands.subcommand]] path = ["init"] label = "New project" description = "Initialize a new Bun project in the current directory." parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false } [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/bun.ts" license = "MIT" [[commands.subcommand.field]] id = "yes" label = "Accept defaults" description = "Answer yes to all prompts." type = "boolean" option = ["--yes", "-y"] sources = ["fig"] [[commands.subcommand.task]] id = "init" label = "Init with defaults" fields = ["yes"] required = [] set = { yes = [true] } [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["yes"]