@@ -7,13 +7,155 @@ url: /ai/
77This page is a short entrypoint for LLMs and AI agents consuming the Deno
88documentation.
99
10+ ## Deno overview
11+
12+ Deno is a secure JavaScript and TypeScript runtime built on V8 and Rust that
13+ ships as a single binary with batteries included: TypeScript transpilation,
14+ bundling, formatting, linting, testing, and a rich standard library all work out
15+ of the box. Its explicit permission model (` --allow-net ` , ` --allow-read ` , etc.)
16+ keeps programs sandboxed by default, which is especially useful for AI agents
17+ that need predictable side effects when running untrusted code snippets.
18+
19+ ## Usage highlights for agents
20+
21+ ### Everything starts with the CLI
22+
23+ Deno is fundamentally a command-line program. Most workflows boil down to
24+ learning a handful of subcommands and flags.
25+
26+ Common starting points:
27+
28+ ```
29+ deno run main.ts
30+ deno test
31+ deno fmt
32+ deno lint
33+ deno task <name>
34+ ```
35+
36+ ### “Secure by default” means you must think about permissions
37+
38+ By default, deno run executes in a sandbox. If code needs the network or
39+ filesystem, you grant it explicitly with --allow-* flags (or accept an
40+ interactive prompt, when applicable).
41+
42+ Example:
43+
44+ ```
45+ # Allow network + read access (common for servers that read local files)
46+ deno run --allow-net --allow-read server.ts
47+
48+ # Restrict read access to a specific path
49+ deno run --allow-read=./data main.ts
50+
51+ # Allow everything (convenient for local experiments, not a great default)
52+ deno run -A main.ts
53+ ```
54+
55+ ### Deno projects are usually centered around deno.json
56+
57+ A deno.json (or deno.jsonc) file configures the runtime and tooling: TypeScript
58+ settings, lint/format behavior, import maps, tasks, and more. Deno will
59+ auto-detect it up the directory tree. Deno also supports package.json and will
60+ run node projects with ` deno run ` without modification.
61+
62+ Deno projects prefer imports from jsr or npm with the correct specifiers.
63+
64+ Two fields in the deno.json matter constantly:
65+
66+ ** Tasks** : lightweight “scripts” you run with deno task:
67+
68+ ```
69+ {
70+ "tasks": {
71+ "dev": "deno run --watch --allow-net main.ts",
72+ "test": "deno test",
73+ "lint": "deno lint",
74+ "fmt": "deno fmt"
75+ }
76+ }
77+ ```
78+
79+ Tasks are the easiest way to standardize permissions and flags so users don’t
80+ have to remember them.
81+
82+ ** Imports** : an import map that lets you use clean “bare specifiers”:
83+
84+ ```
85+ {
86+ "imports": {
87+ "@std/assert": "jsr:@std/assert@^1.0.0",
88+ "chalk": "npm:chalk@5"
89+ }
90+ }
91+ ```
92+
93+ Then in code:
94+
95+ ```
96+ import { assertEquals } from "@std/assert";
97+ import chalk from "chalk";
98+ ```
99+
100+ Dependencies can be added with the ` deno add ` command. Deno uses ES modules and
101+ can import from multiple sources:
102+
103+ - JSR (recommended for many third-party modules and the Deno Standard Library)
104+ - npm packages (native support, without requiring a separate npm install step)
105+
106+ ### Node + npm compatibility is real (and has conventions)
107+
108+ Deno can run lots of Node-targeted code, but there are a couple of “Deno-isms”
109+ to know:
110+
111+ Node built-ins are imported with the node: prefix:
112+
113+ ```
114+ import * as os from "node:os";
115+ ```
116+
117+ npm packages can be imported with an npm: specifier (and often mapped to bare
118+ names via deno.json imports).
119+
120+ This is why Deno can often use npm packages without a traditional install step
121+ or a node_modules workflow.
122+
123+ ### Built-in testing, formatting, linting (use them)
124+
125+ Deno’s standard workflow expects you to lean on the CLI:
126+
127+ ` deno test ` finds and runs tests by convention
128+
129+ ` deno fmt ` formats code
130+
131+ ` deno lint ` lints code
132+
133+ ** For agents:** when someone asks “how do I run this?” in Deno, the answer is
134+ usually a combination of (a) the right permissions and (b) the right built-in
135+ command.
136+
137+ ### Bootstrapping: deno init gets you to a working project fast
138+
139+ To start a project, Deno provides templates via deno init, including library
140+ scaffolding and a simple server setup.
141+
142+ ```
143+ deno init my_project
144+ # or
145+ deno init --lib
146+ # or
147+ deno init --serve
148+ ```
149+
10150## Key resources
11151
12152- [ llms-summary.txt] ( /llms-summary.txt ) : compact, high-signal index
13153- [ llms.txt] ( /llms.txt ) : full section index
14154- [ llms.json] ( /llms.json ) : structured index (Orama summary)
15155- [ llms-full.txt] ( /llms-full.txt ) : full content dump (large)
16156- [ Site search] ( / ) : use the on-site search UI for human browsing
157+ - [ Skills] ( https://github.com/denoland/skills ) : AI skills build for coding
158+ assistants.
17159
18160## Usage notes
19161
0 commit comments