ai/index.md
This page is a short entrypoint for LLMs and AI agents consuming the Deno documentation.
Deno is a secure JavaScript and TypeScript runtime built on V8 and Rust that
ships as a single binary with batteries included: TypeScript transpilation,
bundling, formatting, linting, testing, and a rich standard library all work out
of the box. Its explicit permission model (--allow-net, --allow-read, etc.)
keeps programs sandboxed by default, which is especially useful for AI agents
that need predictable side effects when running untrusted code snippets.
Deno is fundamentally a command-line program. Most workflows boil down to learning a handful of subcommands and flags.
Common starting points:
deno run main.ts
deno test
deno fmt
deno lint
deno task <name>
By default, deno run executes in a sandbox. If code needs the network or filesystem, you grant it explicitly with --allow-* flags (or accept an interactive prompt, when applicable).
Example:
# Allow network + read access (common for servers that read local files)
deno run --allow-net --allow-read server.ts
# Restrict read access to a specific path
deno run --allow-read=./data main.ts
# Allow everything (convenient for local experiments, not a great default)
deno run -A main.ts
A deno.json (or deno.jsonc) file configures the runtime and tooling: TypeScript
settings, lint/format behavior, import maps, tasks, and more. Deno will
auto-detect it up the directory tree. Deno also supports package.json and will
run node projects with deno run without modification.
Deno projects prefer imports from jsr or npm with the correct specifiers.
Two fields in the deno.json matter constantly:
Tasks: lightweight “scripts” you run with deno task:
{
"tasks": {
"dev": "deno run --watch --allow-net main.ts",
"test": "deno test",
"lint": "deno lint",
"fmt": "deno fmt"
}
}
Tasks are the easiest way to standardize permissions and flags so users don’t have to remember them.
Imports: an import map that lets you use clean “bare specifiers”:
{
"imports": {
"@std/assert": "jsr:@std/assert@^1.0.0",
"chalk": "npm:chalk@5"
}
}
Then in code:
import { assertEquals } from "@std/assert";
import chalk from "chalk";
Dependencies can be added with the deno add command. Deno uses ES modules and
can import from multiple sources:
Deno can run lots of Node-targeted code, but there are a couple of “Deno-isms” to know:
Node built-ins are imported with the node: prefix:
import * as os from "node:os";
npm packages can be imported with an npm: specifier (and often mapped to bare names via deno.json imports).
This is why Deno can often use npm packages without a traditional install step or a node_modules workflow.
Deno’s standard workflow expects you to lean on the CLI:
deno test finds and runs tests by convention
deno fmt formats code
deno lint lints code
For agents: when someone asks “how do I run this?” in Deno, the answer is usually a combination of (a) the right permissions and (b) the right built-in command.
To start a project, Deno provides templates via deno init, including library scaffolding and a simple server setup.
deno init my_project
# or
deno init --lib
# or
deno init --serve
llms.txt for a curated overview of all documentation sections.llms-full-guide.txt for a self-contained quick reference with CLI
commands, permissions, configuration, and code examples.llms-summary.txt for a compact, scored selection of the most important
pages.llms-full.txt is large; only fetch it when you need full-text extraction.