# CLI and deno.json quick reference

## 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

```json title="deno.json"
{
  "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](https://docs.deno.com/runtime/reference/deno_json/) and required by the repository.

## Troubleshooting order

1. Record `deno --version`, OS, and architecture.
2. Identify the effective `deno.json(c)` and workspace root. Use `deno info <entry>` and `deno task` to observe actual resolution and tasks instead of guessing merged configuration.
3. Inspect `deno task` and `deno info <entry>`; do not guess the entry or graph.
4. Separate permission denial, module resolution, type error, runtime exception, and platform failure.
5. Build a minimal reproduction, then query current official docs and issues.

Official references: [CLI](https://docs.deno.com/runtime/reference/cli/) and [`deno.json`](https://docs.deno.com/runtime/reference/deno_json/).
