Learn Brim.js
Everything you need to build an editable site, from the first command to content types and the site MCP.
npm create @brimsites/brim@latest my-site
Then npm install, npx brim user add you@example.com and npm run dev. The editor is at /admin/edit.
Build me a website with Brim.js, the web framework where every site is editable. It is built on Astro. The docs are at brimjs.org/docs.
- Run npm create @brimsites/brim@latest my-site, then cd my-site and npm install. Read AGENTS.md and README.md before you write anything.
- Build the pages I describe below in src/pages and src/components. Every visible text, image, link and button is a Brim component (Text, RichText, Image, Link, Button) with a stable, unique nodeId.
- Design freely: any layout, CSS, animation, island or npm package. Theme colors go in the --brim-theme-* variables.
- Put repeatable content (projects, articles, team) in src/content-types, pages I will add later in src/page-templates, forms in src/forms.ts and contact details in src/site-settings.ts.
- Put the starting items in seed/ and add them with npx brim seed while npm run dev is running.
- Run npx brim check, create my login with npx brim user add, then look at the site and at the editor (/admin/edit) on desktop and on mobile.
- When I say it is ready, put it online with Brimsites (brimsites.com), or on my own server with npm run build and npm start. Then save the live site's MCP (/admin/mcp), so you can change its content later.
My site: [describe it here: what it is, who it is for, the pages and the look you want]
Works with Claude Code, Codex, Cursor and any agent that can run commands. Every Brim site also serves its own MCP for content edits later.
Start
- Getting started
Create a Brim.js site, sign in to its editor and change your first text.
- Project structure
A Brim.js site is your own Astro code plus a few declaration files and one database file.
- Editing and handover
How the owner edits, with drafts, roles the API enforces and 90 days of history to take anything back.
Build
- Components and nodeId
Brim components make one piece of a page editable. The nodeId is the contract between your code and the owner's content.
- Blocks
Blocks are richer components. You set their starting content in code and style them in your CSS; the owner changes the content in the side panel.
- Galleries and carousels
Gallery and Carousel keep a list of images the owner manages. Your markup and CSS decide what they look like.
- Navigation
Navbar and Footer hold the site's logo, name and links, saved once for the whole site, and hand them to your markup.
- Forms
Form and Newsletter keep what visitors send in the site's database and email it to the people who run the site.
- Media
Pictures of the design live in public/, pictures of the content are uploads in the media library, and videos go through a video host.
- Site settings and identity
Contact details the owner keeps up to date, and who the site is, its colors and icons, set once in code.
- Server code
A Brim.js site runs as a server, so it can have endpoints of its own next to the pages.
Content
- Content types
Repeatable content, such as articles, projects or products, is declared in code and filled in by the owner.
- Vocabularies
Lists the owner keeps, such as categories, brands or rooms, that other items point at.
- Listings and search
Listing shows the items of a content type, with filters, search and pages for visitors. Search searches the whole site.
- Starting content
Keep a site's starting items in git as a seed, and add them to any copy of the site without touching what the owner wrote.
- Page templates
The pages an owner adds later, like one per service or event, are content made from templates you write.
- Languages
A site has several languages when its Astro config says so. The editor then switches, copies and translates pages and items.
- SEO, pages and feeds
Page Settings, redirects, the sitemap and RSS feeds, managed by the owner and written by Seo.
Run
- Users and tokens
Users and access tokens are managed from the command line in the site's folder, where its database is.
- Site MCP
Every Brim.js site serves its own MCP at /admin/mcp, so AI agents can read and change content with the same checks as the editor.
- Command line
The brim command, in every site's folder, checks the code, seeds content, reads what the owner saved and opens the editor.
- Deploy
A Brim.js site is one Node server and one database file. Run it on your own server, as static files, or on Brimsites.
- Versions and license
How Brim.js versions change, how a site's database moves forward, and what the license allows.
Guides
- Convert an Astro site
Make an Astro site you already have editable, one element at a time, by hand or with your coding agent.
These pages are the docs folder of the Brim.js repository, shown as they are on main.