diff --git a/cli/args/flags.rs b/cli/args/flags.rs index 706f6d86c3dbc7..c1f58f31478e3b 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -4022,7 +4022,24 @@ fn deno_x_shim_name_parser(value: &str) -> Result { fn x_subcommand() -> Command { command( "x", - cstr!("Execute a binary from npm or jsr, like npx"), + cstr!("Execute a binary from npm or jsr, like npx. + + deno x npm:create-vite my-app + deno x jsr:@std/http/file-server + +JSR packages do not use the package.json bin field. When you run +deno x jsr:<>, Deno resolves the JSR specifier through the +package's exports field in deno.json or jsr.json, then runs the resolved module. + +To make a JSR package runnable with deno x, publish a module that can run +as a script and expose it from exports. For example, a package with +\"exports\": { \"./cli\": \"./cli.ts\" } can be run with: + + deno x jsr:@scope/tool/cli + +If the package is only meant to be used as a command, point the root export at +the CLI module instead, for example \"exports\": \"./cli.ts\", so +deno x jsr:@scope/tool runs that module."), UnstableArgsConfig::ResolutionAndRuntime, ) .defer(|cmd| {