Skip to content

Commit fd6b601

Browse files
committed
docs: tighten CLI overview page
- Bump last_modified. - Replace four-paragraph intro with two that get to the point and stop presupposing the reader followed the docs in order. - Rename 'An example subcommand - deno run' to 'Running scripts', which is what the section actually covers. - Rewrite the verb-fragment intros on the lock-file and cache sections ('Affect commands...') into proper sentences with a subject. - Drop the empty 'Runtime flags' meta-heading; its sub-sections now sit directly under 'Common flags'. - Replace bare '>' shell prompts in the type-checking examples with unprefixed commands to match the rest of the page. - Expand the one-line 'Permission flags' section into a short summary that names the major flags and their short forms. - Rename 'Other runtime flags' to 'Inspector and environment flags' so the heading describes the table. - Fix two 'here' anchor texts.
1 parent f5292d2 commit fd6b601

1 file changed

Lines changed: 29 additions & 40 deletions

File tree

runtime/getting_started/command_line_interface.md

Lines changed: 29 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
last_modified: 2025-11-05
2+
last_modified: 2026-05-28
33
title: Command line interface
44
description: "A comprehensive guide to using Deno's command-line interface (CLI). Learn about running scripts, managing permissions, using watch mode, and configuring Deno's runtime behavior through command-line flags and options."
55
oldUrl:
@@ -9,26 +9,15 @@ oldUrl:
99
- /runtime/manual/tools/
1010
---
1111

12-
Deno is a command line program. The Deno command line interface (CLI) can be
13-
used to run scripts, manage dependencies, and even compile your code into
14-
standalone executables. You may be familiar with some simple commands having
15-
followed the examples thus far. This page will provide a more detailed overview
16-
of the Deno CLI.
12+
The Deno CLI runs scripts, manages dependencies, and compiles code into
13+
standalone executables. Each subcommand (`run`, `test`, `compile`, etc.) has its
14+
own flags; run `deno help` or `deno <subcommand> --help` to see them.
1715

18-
The Deno CLI has a number of subcommands (like `run`, `init` and `test`, etc.).
19-
They are used to perform different tasks within the Deno runtime environment.
20-
Each subcommand has its own set of flags and options (eg --version) that can be
21-
used to customize its behavior.
16+
For the complete list of subcommands and flags, see the
17+
[CLI reference](/runtime/reference/cli/). The rest of this page walks through
18+
the most useful flags in more detail.
2219

23-
You can view all of the available commands and flags by running the `deno help`
24-
subcommand in your terminal, or using the `-h` or `--help` flags.
25-
26-
Check out the [CLI reference guide](/runtime/reference/cli/) for a further
27-
documentation on all the subcommands and flags available. We'll take a look at a
28-
few commands in a bit more detail below to see how they can be used and
29-
configured.
30-
31-
## An example subcommand - `deno run`
20+
## Running scripts
3221

3322
You can run a local TypeScript or JavaScript file by specifying its path
3423
relative to the current working directory:
@@ -166,22 +155,23 @@ running browser page on its own.
166155

167156
### Integrity flags (lock files)
168157

169-
Affect commands which can download resources to the cache: `deno install`,
170-
`deno run`, `deno test`, `deno doc`, and `deno compile`.
158+
These flags apply to commands that download resources to the cache
159+
(`deno install`, `deno run`, `deno test`, `deno doc`, `deno compile`):
171160

172161
| Flag | Description |
173162
| ---------------------- | ------------------------------------ |
174163
| `--lock <FILE>` | Check the specified lock file |
175164
| `--frozen[=<BOOLEAN>]` | Error out if lockfile is out of date |
176165

177-
Find out more about these
178-
[here](/runtime/fundamentals/modules/#integrity-checking-and-lock-files).
166+
See
167+
[lockfiles and integrity checking](/runtime/fundamentals/modules/#integrity-checking-and-lock-files)
168+
for the full picture.
179169

180170
### Cache and compilation flags
181171

182-
Affect commands which can populate the cache: `deno install`, `deno run`,
183-
`deno test`, `deno doc`, and `deno compile`. As well as the flags above, this
184-
includes those which affect module resolution, compilation configuration etc.
172+
These flags apply to commands that populate the cache (`deno install`,
173+
`deno run`, `deno test`, `deno doc`, `deno compile`) and influence module
174+
resolution and compilation:
185175

186176
| Flag | Description |
187177
| ---------------------------- | ----------------------------------------------- |
@@ -190,25 +180,18 @@ includes those which affect module resolution, compilation configuration etc.
190180
| `--no-remote` | Do not resolve remote modules |
191181
| `--reload=<CACHE_BLOCKLIST>` | Reload source code cache (recompile TypeScript) |
192182

193-
### Runtime flags
194-
195-
The flags in the sections below affect commands which execute user code, namely
196-
`deno run` and `deno test`. They include all of the flags listed above, plus
197-
type-checking, permission, and execution-environment flags.
198-
199183
### Type checking flags
200184

201-
You can type-check your code (without executing it) using the command:
185+
You can type-check your code without executing it:
202186

203187
```shell
204-
> deno check main.ts
188+
deno check main.ts
205189
```
206190

207-
You can also type-check your code before execution by using the `--check`
208-
argument to deno run:
191+
You can also type-check before execution by passing `--check` to `deno run`:
209192

210193
```shell
211-
> deno run --check main.ts
194+
deno run --check main.ts
212195
```
213196

214197
This flag affects `deno run` and `deno eval`. The following table describes the
@@ -229,11 +212,17 @@ for all modules, use `--check=all`.)
229212

230213
### Permission flags
231214

232-
These are listed [here](/runtime/fundamentals/security/).
215+
Deno runs in a sandbox by default. To grant access to OS resources, pass
216+
permission flags such as `--allow-read`, `--allow-write`, `--allow-net`, and
217+
`--allow-env`. Most have short forms (`-R`, `-W`, `-N`, `-E`); `-A` grants all
218+
permissions. Each `--allow-*` flag also accepts a comma-separated allowlist (for
219+
example `--allow-net=example.com,deno.land`), and a matching `--deny-*` flag
220+
overrides allows. See [security](/runtime/fundamentals/security/) for the full
221+
list.
233222

234-
### Other runtime flags
223+
### Inspector and environment flags
235224

236-
More flags which affect the execution environment.
225+
Miscellaneous flags that adjust the execution environment:
237226

238227
| Flag | Description |
239228
| ---------------------------- | ------------------------------------------------------- |

0 commit comments

Comments
 (0)