elements buildState: OkElapsed: 0.000006sj/k: down/up G/g: bottom/top y: copy q: quit
The build server for web apps.
Built for humans, and their AI agents.
Elements is a build server, app framework, Postgres database and deployment, engineered as one system.
curl -fsSL https://elements.dev/install | sh Need help getting set up? Read the getting started guide.
Tools
Every command connects to the build server that is already running, so no command starts from nothing. Every command takes -json for your agent.
- Config
- Install
- Build
- Migrate
- Test
- Deploy
Build server
Holds one build state in memory, as one source graph, for every client. Builds in milliseconds and answers in microseconds.
Phases of a build
- Sync
- Config
- Install
- Crawl
- Check
- Emit
- Test
- Migrate
- Release
Infrastructure
- File watcher
- File tree
- Resolver
- Source graph
- Type checker
- Program analysis
- Hot reload
- LSP
App framework
HTML and TypeScript, type checked as one program. The browser calls a server function directly, and server code cannot reach the browser.
- HTML
- Routing
- RPC
- Sessions
- SQL
- Transactions
- Live tables
- Channels
- Jobs
- Cron
- Payments
Postgres
The database for your app, already running. A migration is a SQL file, and the build server applies it when you save it, to the test database first.
Deployment
One command deploys to servers you control. The tests pass on the server before the release goes live, and only the changed files are sent.
- SSH
- Clusters
- Load balancer
- TLS certificates
- Domains
- Maintenance page
Build server
The build server stays running and holds the build state in memory, as one source graph. Your terminal, your editor and your agents all connect to the same build server and read the same build. It watches your files and automatically runs a build when a file or a package changes. A build of one saved file takes milliseconds.
A second elements build -json against an unchanged project answers in microseconds.
elements build -json{"path": "/Users/cmather/elements/projects/myapp","ok": true,"errorCount": 0,"warningCount": 0,"message": "The build is ok.","buildGen": 15,"buildRanAt": "2026-09-21T12:08:15.74752-07:00","started": "2026-09-21T12:09:41.121451-07:00","finished": "2026-09-21T12:09:41.121457-07:00","elapsedSeconds": 0.000006}
When code in the browser can reach a database call, the build is in the error state. The error names the file, the line and the fix.
elements buildState: ErrorElapsed: 0.000010sERRORS:You have 1 error:1. app/pages/home/template.ehtml:6:10Security error: cannot call server code from the browser without going through an rpcfunction.Try:Put the server code inside a function with an @rpc build tag. For example:/*** @rpc*/export function fn() {}Then call fn().5: function onSignIn(email: string) {6: return sql(`select id from users where email = ${email}`).first();7: }Call stack:2. app/pages/home/template.ehtml:6:10 sql1. app/pages/home/template.ehtml:32:49 onSignInj/k: down/up G/g: bottom/top y: copy q: quit
- One source graph. Every phase, your editor, your terminal and your agents read one source graph, in memory. Each file is read once and parsed once. The graph has four views of those files: server runtime, server types, browser runtime and browser types. The disk is one layer, and each editor has a layer for its unsaved text.
- Tests pass before the app database changes. The Test phase migrates the test database and runs the tests. The Migrate phase changes the app database, and it runs only if the tests pass.
- Already built when you ask. The build has run by the time you or your agent asks for the result: type check, program analysis, migrations and tests.
- One set of diagnostics. Your editor, your terminal and your agents read the same diagnostics from the build server.
- Server code cannot reach the browser. A database call that the browser can reach is a build error, and a build with an error is never released.
- Tests are part of the build. A test file is rerun when its code or its imports change, and each test runs in a transaction that rolls back.
App framework
A page is one .ehtml file: standard HTML with TypeScript expressions. The build server type checks the page. The page is reactive: it renders on the server and updates in the browser when the data changes.
app/pages/users/template.ehtml<html ( title: string, users: User[], )> <h1>{title}</h1> <ul> <li e:for={user of users}> {user.name} ({user.age}) </li> </ul> <p e:if={users.length === 0}>no users yet</p> <p e:else>{users.length} users</p> </html>
A function with the @rpc build tag runs on the server, and the browser calls it by name.
app/shared/services/users.ts/** @rpc */ export function createUser(form: UserForm): User { return sql<User>(` insert into users ( name, email ) values ( ${form.name}, ${form.email} ) returning * `).firstOrThrow("insert returned no row"); }
Postgres
Postgres is the database for your app. A migration is a SQL file. Save the file and the build server applies it to the database.
app/migrations/20260509120000-add-comments-table.migration.sqlcreate table comments ( id uuid primary key default uuidGenerateV7(), createdAt timestamptz not null default now(), updatedAt timestamptz not null default now() );
elements db migrateState: OkElapsed: 0.035618sMIGRATIONS:node_modules/@elements/app/migrations/2026-07-11-000000-app-baseline.migration.sql [ok]The application framework baseline migrations.app/migrations/20260915155829-add-chat.migration.sql [ok]add chatj/k: down/up G/g: bottom/top y: copy q: quit
- A migration is a .sql file. There is no ORM and no migration language to learn.
- Applied on save. The build server applies a migration to the test database before the tests run, and to the app database after.
- Edit a migration and save again. In development, Elements restores the database to its state before that migration and applies the new version.
- SQL in your code. Each value you put in a
sqltemplate becomes a query parameter at build time.
Deploy
One command deploys to servers you control, peer to peer over SSH. A deploy copies only the files that changed.
elements deployState: OkElapsed: 0.720184s
- Tested before it goes live. On every deploy, Elements migrates the test database and runs the tests on the deploy machine. A failing test or migration stops the deploy, and the previous release keeps serving.
- Only the files that changed. Your build server sends each machine a list of file hashes, and only the changed files are uploaded.
- No restart. The running app hot reloads the changed modules, and every connected browser reloads with it.
- Add a machine. Add a machine to
config.jsocand deploy. The machine joins the cluster with its own load balancer. - TLS certificates. Elements issues each certificate through Let's Encrypt and renews it.
No lock-in
You pay for the tooling. The code of your app is yours, and the Elements runtime packages are MIT licensed.
- MIT licensed runtime packages. The tooling is the build server, the build, the test runner and deploy.
@elements/appis MIT licensed, and it has the runtime your Elements HTML runs on.@elements/uiis MIT licensed too. A built app runs on plain Node.js. - Standard languages. Elements HTML is standard HTML with TypeScript expressions and a few attributes. Logic is TypeScript, queries and migrations are SQL on Postgres, and styles are CSS.
- Any agent, any model. Elements works with any agent and any model. Use the agent you have today and switch when a better one comes out.
- One subscription for the tooling. The price is not based on traffic, requests or revenue, and you deploy to servers you control.