Learn NTNT
From install to verified app in four prompts.
Step 1: Your First App
Pick your tool and copy the prompt. Your agent handles the install, the syntax, and the demo.
Install NTNT (curl -sSf https://raw.githubusercontent.com/ntntlang/ntnt/main/install.sh | bash), then run `ntnt learn claude-code` and read the generated rules before writing any code. Build a web app in server.tnt: a GET / that returns a greeting and a GET /api/status that returns JSON. Add a requires contract on one handler. Make the app look good. Write a server.intent file with scenarios for both routes. Run `ntnt intent check server.tnt` until all pass, then `ntnt run server.tnt`. Respond with the URL of the running app.
Install NTNT (curl -sSf https://raw.githubusercontent.com/ntntlang/ntnt/main/install.sh | bash), then run `ntnt learn codex` and read the generated rules before writing any code. Build a web app in server.tnt: a GET / that returns a greeting and a GET /api/status that returns JSON. Add a requires contract on one handler. Make the app look good. Write a server.intent file with scenarios for both routes. Run `ntnt intent check server.tnt` until all pass, then `ntnt run server.tnt`. Respond with the URL of the running app.
Install NTNT (curl -sSf https://raw.githubusercontent.com/ntntlang/ntnt/main/install.sh | bash), then run `ntnt learn cursor` and read the generated rules before writing any code. Build a web app in server.tnt: a GET / that returns a greeting and a GET /api/status that returns JSON. Add a requires contract on one handler. Make the app look good. Write a server.intent file with scenarios for both routes. Run `ntnt intent check server.tnt` until all pass, then `ntnt run server.tnt`. Respond with the URL of the running app.
Install NTNT (curl -sSf https://raw.githubusercontent.com/ntntlang/ntnt/main/install.sh | bash), then run `ntnt learn` and read the generated rules before writing any code. Build a web app in server.tnt: a GET / that returns a greeting and a GET /api/status that returns JSON. Add a requires contract on one handler. Make the app look good. Write a server.intent file with scenarios for both routes. Run `ntnt intent check server.tnt` until all pass, then `ntnt run server.tnt`. Respond with the URL of the running app.
ntnt learn generates platform-native config files so your agent loads the rules every session. One command, permanent knowledge.
Four prompts. You’ve got a full-stack web app with a database, auth, templates, middleware, and file-based routing. You didn’t write any NTNT. Your agent did, and ntnt intent check checked the scenarios at every step.
Advanced Demo Prompts
Installation
macOS / Linux:
curl -sSf https://raw.githubusercontent.com/ntntlang/ntnt/main/install.sh | bash
Windows (PowerShell):
irm https://raw.githubusercontent.com/ntntlang/ntnt/main/install.ps1 | iex
Hello World
echo 'print("Hello, World!")' > hello.tnt
ntnt run hello.tntA Web API
// api.tnt import { json } from "std/http/server" fn home(req) { return json(map { "message": "Hello!" }) } fn get_user(req) { return json(map { "id": req.params["id"] }) } get("/", home) get("/users/{id}", get_user) listen(3000)
ntnt run api.tnt # Visit http://localhost:3000
Hot-reload: HTTP servers automatically reload when you edit the source file.
Intent-Driven Development
Write .intent files describing features, link code with @implements, and verify everything matches.
# server.intent ## Glossary | Term | Means | |------|-------| | a user visits {path} | GET {path} | | the home page | / | | the page loads | status 200 | | they see {text} | body contains {text} | --- Feature: User Greeting id: feature.greeting Scenario: Greet by name When a user visits /?name=Alice → the page loads → they see "Hello, Alice" Scenario: Default greeting When a user visits the home page → the page loads → they see "Hello, World"
// server.tnt import { html } from "std/http/server" // @implements: feature.greeting fn home(req) { let name = req.query_params["name"] ?? "World" return html("<h1>Hello, #{name}!</h1>") } get("/", home) listen(8080)
ntnt intent lint server.intent catches unresolved phrases before anything runs. Then:
$ ntnt intent check server.tnt ✓ User Greeting 2 scenarios === Summary === Features: 1 total, 1 passed, 0 failed Scenarios: 2 passed, 0 failed, 0 skipped Assertions: 4 passed, 0 failed
Design by Contract
fn withdraw(balance: Int, amount: Int) -> Int requires amount > 0 requires amount <= balance ensures result >= 0 { return balance - amount } // In HTTP handlers: // requires fails → 400 Bad Request // ensures fails → 500 Internal Server Error
A failed contract reports the expression and the runtime values that broke it, so an agent can fix the cause instead of guessing.
Put it to work
Once your first app runs, the recipes cover building a website with templates, form validation, passwordless sign-in, sending email from a background job, and testing a function without a server. Browse the recipes →
Standard Library
Everything ships in the binary: 554 documented functions across 28 modules. No package manager.
| Web | std/http/server, std/http, std/url | Routing, middleware, static files, response builders; fetch with SSRF protection and safe redirects |
| Auth & security | std/auth, std/crypto, std/secrets | OAuth/OIDC, sessions, CSRF, TOTP, magic links; SHA-256, AES-GCM, Argon2, UUIDs; redacted secret values |
| Input & mail | std/validate, std/email | Declarative schemas for forms and APIs; SMTP with batches and a dev log transport |
| Data | std/postgres, std/sqlite, std/kv | Pooled PostgreSQL and SQLite with transactions; KV over Redis, Valkey, SQLite, or memory |
| Formats | std/json, std/csv, std/markdown | Parse and serialize; markdown rendering and source-mapped block parsing |
| Jobs | std/jobs | Language-native job DSL: priority queues, cron, unique jobs, retries, dead letters, crash-safe leases. Memory, PostgreSQL, and Redis backends |
| Concurrency | std/concurrent, std/process | Tasks, channels, select, parallel, race; supervised child processes (off by default) |
| Network | std/net, std/netmon | CIDR math, TCP, DNS; ping, persistent probes, SNMP |
| Files & env | std/fs, std/path, std/env | File and binary I/O, atomic writes, paths, environment |
| Utilities | std/string, std/collections, std/time, std/math, std/log | Text and collection helpers; dates and durations; math; structured logging |
CLI Commands
ntnt run app.tnt | Run a program; HTTP servers hot-reload on save |
ntnt lint app.tnt | Lint for errors and style issues (JSON output) |
ntnt validate app.tnt | Validate with machine-readable errors, several per pass |
ntnt inspect app.tnt | Every route, function, and contract as JSON |
ntnt check app.tnt | Quick syntax check |
ntnt test app.tnt --get /health | Start the server, make requests, stop |
ntnt intent check app.tnt | Verify code matches its intent file |
ntnt intent lint app.intent | Statically validate glossary and scenarios |
ntnt intent coverage app.tnt | Feature coverage report |
ntnt intent init app.intent | Generate scaffolding from an intent file |
ntnt intent studio app.intent | Visual workspace with live results |
ntnt learn <platform> | Agent config for claude-code, codex, cursor, or copilot |
ntnt docs std/string | Look up module and function docs |
ntnt worker app.tnt | Start background workers for jobs in a file |
ntnt jobs status | list | inspect | retry | Inspect and manage the job queue |
ntnt workers status | scale | Live worker status and runtime scaling |
ntnt migrate . | Migrate old {expr} interpolation to #{expr} |
ntnt completions | Shell completions for bash, zsh, and fish |
ntnt repl | Interactive REPL |
Documentation
- AI Agent Guide
The guide your agent reads — syntax rules, patterns, gotchas
- Language Specification
Complete syntax, types, contracts, and features
- Standard Library Reference
Every function across all stdlib modules
- Intent Assertion Language
Every standard term, glossary rules, and intent file format
- IDD Design Document
Intent-Driven Development philosophy and workflow
- Whitepaper
Technical motivation and design decisions
- GitHub
Source code, examples, issues, and roadmap