Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bun exec --help prints help for bun run #16359

Closed
fel1x-developer opened this issue Jan 12, 2025 · 0 comments · Fixed by #16391
Closed

bun exec --help prints help for bun run #16359

fel1x-developer opened this issue Jan 12, 2025 · 0 comments · Fixed by #16391
Labels
bug Something isn't working cli Something to do with CLI arguments

Comments

@fel1x-developer
Copy link
Contributor

What version of Bun is running?

1.1.43+76800b049

What platform is your computer?

Linux 6.12.8-WSL2-LTS+ x86_64 x86_64

What steps can reproduce the bug?

$ bun exec --help

What is the expected behavior?

\\<b>Usage: bun exec <r><cyan>\<script\><r>
\\
\\Execute a shell script directly from Bun.
\\
\\<b><red>Note<r>: If executing this from a shell, make sure to escape the string!
\\
\\<b>Examples<d>:<r>
\\  <b>bun exec "echo hi"<r>
\\  <b>bun exec "echo \"hey friends\"!"<r>
\\

as written in

bun/src/cli.zig

Lines 2703 to 2717 in 36ad297

Command.Tag.ExecCommand => {
Output.pretty(
\\<b>Usage: bun exec <r><cyan>\<script\><r>
\\
\\Execute a shell script directly from Bun.
\\
\\<b><red>Note<r>: If executing this from a shell, make sure to escape the string!
\\
\\<b>Examples<d>:<r>
\\ <b>bun exec "echo hi"<r>
\\ <b>bun exec "echo \"hey friends\"!"<r>
\\
, .{});
Output.flush();
},

What do you see instead?

$ bun exec --help
Usage: bun run [flags] <file or script>

Flags:
      --silent                    Don't print the script command
      --elide-lines               Number of lines of script output shown when using --filter (default: 10). Set to 0 to show all lines.
  -F, --filter                    Run a script in all workspace packages matching the pattern
  -b, --bun                       Force a script or package to use Bun's runtime instead of Node.js (via symlinking node)
      --shell                     Control the shell used for package.json scripts. Supports either 'bun' or 'system'
      --watch                     Automatically restart the process on file change
      --hot                       Enable auto reload in the Bun runtime, test runner, or bundler
      --no-clear-screen           Disable clearing the terminal screen on reload when --hot or --watch is enabled
      --smol                      Use less memory, but run garbage collection more often
  -r, --preload                   Import a module before other modules are loaded
      --inspect                   Activate Bun's debugger
      --inspect-wait              Activate Bun's debugger, wait for a connection before executing
      --inspect-brk               Activate Bun's debugger, set breakpoint on first line of code and wait
      --if-present                Exit without an error if the entrypoint does not exist
      --no-install                Disable auto install in the Bun runtime
      --install                   Configure auto-install behavior. One of "auto" (default, auto-installs when no node_modules), "fallback" (missing packages only), "force" (always).
  -i                              Auto-install dependencies during execution. Equivalent to --install=fallback.
  -e, --eval                      Evaluate argument as a script
      --print                     Evaluate argument as a script and print the result
      --prefer-offline            Skip staleness checks for packages in the Bun runtime and resolve from disk
      --prefer-latest             Use the latest matching versions of packages in the Bun runtime, always checking npm
  -p, --port                      Set the default port for Bun.serve
      --conditions                Pass custom conditions to resolve
      --fetch-preconnect          Preconnect to a URL while code is loading
      --max-http-header-size      Set the maximum size of HTTP headers in bytes. Default is 16KiB
      --expose-internals          Expose internals used for testing Bun itself. Usage of these APIs are completely unsupported.
      --expose-gc                 Expose gc() on the global object. Has no effect on Bun.gc().
      --no-deprecation            Suppress all reporting of the custom deprecation.
      --throw-deprecation         Determine whether or not deprecation warnings result in errors.
      --title                     Set the process title
      --main-fields               Main fields to lookup in package.json. Defaults to --target dependent
      --extension-order           Defaults to: .tsx,.ts,.jsx,.js,.json
      --tsconfig-override         Specify custom tsconfig.json. Default <d>$cwd<r>/tsconfig.json
  -d, --define                    Substitute K:V while parsing, e.g. --define process.env.NODE_ENV:"development". Values are parsed as JSON.
      --drop                      Remove function calls, e.g. --drop=console removes all console.* calls.
  -l, --loader                    Parse files with .ext:loader, e.g. --loader .js:jsx. Valid loaders: js, jsx, ts, tsx, json, toml, text, file, wasm, napi
      --no-macros                 Disable macros from being executed in the bundler, transpiler and runtime
      --jsx-factory               Changes the function called when compiling JSX elements using the classic JSX runtime
      --jsx-fragment              Changes the function called when compiling JSX fragments
      --jsx-import-source         Declares the module specifier to be used for importing the jsx and jsxs factory functions. Default: "react"
      --jsx-runtime               "automatic" (default) or "classic"
      --ignore-dce-annotations    Ignore tree-shaking annotations such as @__PURE__
      --env-file                  Load environment variables from the specified file(s)
      --cwd                       Absolute path to resolve files & entry points from. This just changes the process' cwd.
  -c, --config                    Specify path to Bun config file. Default <d>$cwd<r>/bunfig.toml
  -h, --help                      Display this menu and exit

Examples:
  Run a JavaScript or TypeScript file
  bun run ./index.js
  bun run ./index.tsx

  Run a package.json script
  bun run dev
  bun run lint

Full documentation is available at https://bun.sh/docs/cli/run

Additional information

No response

@fel1x-developer fel1x-developer added bug Something isn't working needs triage labels Jan 12, 2025
@RiskyMH RiskyMH added cli Something to do with CLI arguments and removed needs triage labels Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cli Something to do with CLI arguments
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants