There are multiple ways of viewing the main help text:

    Deno’s CLI is subcommand-based. The above commands should show you a list of subcommands supported, such as . To see subcommand-specific help, for example for bundle, you can similarly run one of:

    1. deno help bundle
    2. deno bundle -h

    Detailed guides for each subcommand can be found .

    Deno can grab the scripts from multiple sources, a filename, a url, and ‘-‘ to read the file from stdin. The latter is useful for integration with other applications.

    1. deno run main.ts
    2. deno run https://mydomain.com/main.ts
    3. cat main.ts | deno run -

    Script arguments

    Separately from the Deno runtime flags, you can pass user-space arguments to the script you are running by specifying them after the script name:

    1. // main.ts
    2. console.log(Deno.args); // [ "a", "b", "-c", "--quiet" ]
    1. # Good. We grant net permission to net_client.ts.
    2. deno run --allow-net net_client.ts
    3. # Bad! --allow-net was passed to Deno.args, throws a net permission error.
    4. deno run net_client.ts --allow-net

    Some see it as unconventional that:

    However:

    1. This is, in fact, the same behaviour as that of any other popular runtime.
      • Try node -c index.js and node index.js -c. The first will only do a syntax check on as per Node’s -c flag. The second will execute index.js with -c passed to require("process").argv.

    There exist logical groups of flags that are shared between related subcommands. We discuss these below.

    You can supply the --watch flag to deno run, deno test, deno bundle, and deno fmt to enable the built in file watcher. The files that are watched depend on the subcommand used:

    • for deno run, deno test, and deno bundle the entrypoint, and all local files the entrypoint(s) statically import(s) will be watched.
    • for deno fmt all local files and directories specified as command line arguments (or the working directory if no specific files/directories is passed) are watched.

    Integrity flags (lock files)

    Affect commands which can download resources to the cache: deno cache, deno run, deno test, , deno doc, and deno compile.

    1. --lock <FILE> Check the specified lock file
    2. --lock-write Write lock file. Use with --lock.

    Find out more about these here.

    Affect commands which can populate the cache: deno cache, deno run, deno test, deno bundle, deno doc, and deno compile. As well as the flags above, this includes those which affect module resolution, compilation configuration etc.

    1. --config <FILE> Load configuration file
    2. --import-map <FILE> Load import map file
    3. --no-remote Do not resolve remote modules
    4. --reload=<CACHE_BLOCKLIST> Reload source code cache (recompile TypeScript)

    Runtime flags

    Affect commands which execute user code: deno run and . These include all of the above as well as the following.

    Permission flags

    These are listed .

    Other runtime flags