CLI and deno.json quick reference
Common Deno commands, configuration ownership, tasks, imports, and troubleshooting order
Command map
| Goal | Command |
|---|---|
| Version / help | deno --version / deno help <command> |
| Initialize | deno init / deno init --serve |
| Run an entry | deno run [permissions] main.ts |
| Run a task | deno task <name> |
| Add / remove dependency | deno install <pkg> / deno uninstall <pkg> |
| Reproducible CI install | deno ci / deno ci --prod |
| List / audit dependencies | deno list / deno audit |
| Inspect module graph | deno info main.ts |
| Format / lint | deno fmt / deno lint |
| Type-check | deno check main.ts |
| Test / coverage | deno test / deno test --coverage |
| Generate docs | deno doc |
| Compile / bundle | deno compile / deno bundle |
| Build a desktop app | deno desktop (2.9+) |
| Deploy to Deno Deploy | deno deploy |
| Publish to JSR | deno publish --dry-run / deno publish |
| Upgrade Deno | deno upgrade |
Minimal configuration
{
"tasks": {
"dev": "deno run --watch --allow-net --allow-env=PORT main.ts",
"check": "deno fmt --check && deno lint && deno check **/*.ts && deno test"
},
"imports": {
"@std/assert": "jsr:@std/assert@^1.0.0"
},
"lint": { "rules": { "tags": ["recommended"] } },
"fmt": { "lineWidth": 100 }
}
Add only keys verified against the current deno.json reference and required by the repository.
Troubleshooting order
- Record
deno --version, OS, and architecture. - Identify the effective
deno.json(c)and workspace root. Usedeno info <entry>anddeno taskto observe actual resolution and tasks instead of guessing merged configuration. - Inspect
deno taskanddeno info <entry>; do not guess the entry or graph. - Separate permission denial, module resolution, type error, runtime exception, and platform failure.
- Build a minimal reproduction, then query current official docs and issues.