Sidebar

Displays the mobile sidebar.

Search the docs

Search the docs

charter
charter
What charter is
See it running
Where to go
What an app made with charter looks like
Getting started
Getting started
Working on it
Before a push
Shipping it
Tools
Every command
The commands, and what each one proves
The commands, and what each one proves
What is checked, and when you find out
What no compiler checks
create
dev
add
check
test
deploy
pack
run
The rest
An app's layout
An app's layout
What the Worker is bound to
main.go
What is generated
What is never in git
Pages
Pages
With the commands
The tree
A page declares what it needs
A region that changes by itself
The page being shown
A fragment opened as a page
What a page calls
Links
A link shows the next page with no page load
Which pages search engines get
A page that is the same for every reader
The head
The API
The API
With the commands
An operation
Who may call
Limits
SDKs
MCP
The live feed
The live feed
With the commands
Writing
Three ways out, one feed
A page's stream holds no Go
Resuming
The database
The database
With the commands
Changing it
Queries
Every statement is checked
One definition
Seeding
A deployed database
Reads near the reader
By hand
Signing in, and who may do what
Signing in, and who may do what
With the commands
One caller
Saying what is needed
Roles
The first admin, and inviting people
Signing in
Another device
An address to get back in by
Testing it
The clients
What is left to you
Languages and search engines
Languages and search engines
With the commands
Languages
Search engines
Agents
Screens and themes
Screens and themes
With the commands
The interface is gsxui's
Screens
The layout
What a page is made of
Themes
The editor, in your app
A style
While developing
Light and dark
What is checked, and what is not
Docs
Docs
With the commands
Groups, and the order
What you write, and what charter writes
Links are checked
Showing them
What comes with them
What the pages have
Code taken from a real file
Tests
Tests
A page, as plain Go
The whole app, on a real Worker
A page, in a real browser
What to test, and what not to
The API, through its own SDK
Where a test runs
A test leaves the Worker as it found it
Secrets a test needs
What else charter test does
Deploying
Deploying
Two Workers
With the commands
The plan
Nothing of your account in the repository
Credentials
Secrets
Resources
Taking an app away
Your own domain
Email
After a deploy
Environments
Everything Cloudflare gives a Worker
The admin screen
The admin screen
The pages
The app's own facts
From a program
What it does not do
Watching a deployed Worker
Watching a deployed Worker
Is it well?
Three numbers
Cloudflare's limits
Under load
A first hit
Every data centre, by country
What happened?
A failure has a reference
Memory
What charter leaves to Cloudflare
Upgrading
Upgrading
0.82
0.81
0.80
0.79
0.78
0.77
0.76
0.75
0.74
0.73
0.72
0.71
0.69
0.65
0.64
A binding, a variable, a secret's name
A scope
Screens
0.63
When upgrade stops
For your coding agent
For your coding agent
The plugins
In an app made with charter
Anywhere else
One set of commands
What an agent can ask
What a language model reads
What the Worker is bound to
What the Worker is bound to

Getting started

You need mise, once. It brings everything else, at the versions each app pins.

brew install mise      # once. Linux: curl https://mise.run | sh   Windows: winget install jdx.mise
mise exec go@latest -- go run github.com/joeblew999/charter/cmd/charter@latest create my-app
cd my-app
go tool charter dev

Put mise activate in your shell's profile, once (mise's guide): then in an app's folder go and node are the app's.

create copies the example under your name, gives it the tools charter is built with (its own mise.toml), installs what it pins and writes its specs.

Working on it

dev runs the app on the real runtime: workers-go on wrangler dev, with the bindings of wrangler.jsonc. The first time, it makes the local database and fills it with the app's seed. Leave it running and run everything else beside it.

You saveWhat happensOn the page after about
A .gsx or .go filegsx regenerates, the Wasm is built, the running Worker takes it1.5 s
A catalog (locales/*.toml)the messages are compiled and handed to the running Worker: no Wasm is built1.3 s
A page of the docs (docs/*.md)the same: the pages are data beside the Wasm1.3 s
db/schema.sqlthe local database follows, its migration and the queries' Go are written2 s
wrangler.jsoncwrangler reloads the Worker0.6 s
A file of web/, CSSVite replaces it in the open pageat once

The Worker is started once and never restarted: each build is handed to it. A mistake, in any of these files, shows in the browser in gsx's overlay, and the last page that worked stays up. Cmd-D (Ctrl-D) opens gsx's dev panel, with the Worker's log.

go tool charter env says where the loop is running and where its log is, for a second terminal or a coding agent.

go tool charter install puts gsx's language server where your editor's gsx extension finds it. The app's .vscode/ recommends the extension and formats a gsx file when it is saved.

Before a push

go tool charter check
go tool charter test

check says everything that can be said without running the app: formatting, go vet and structpages' linter (for the machine and for the Worker's build), the API's contract, the database's schema, the languages, and charter's screens. check --fix writes what it can. check --json is the same as one JSON document, each part with what it said, for a script or a coding agent. test runs the Worker on wrangler dev and asks it: the pages in a real browser, the API through its own SDK, and the search-engine audit.

Shipping it

go tool charter deploy
go tool charter test --deployed

The first deploy makes the database, the KV namespace, the bucket and the queue that wrangler.jsonc names. The same tests then ask the deployed Worker.

Tools

ForToolPinned byBrought by
Everything belowmiseyou, once
BuildingGomise.tomlmise
Vite and wranglerNodemise.tomlmise
Secretsfnoxmise.tomlmise
Vite, wrangler, gsx's pluginnpm packagespackage-lock.jsoncharter install
ContainersKiricharter, the first time charter pack generates SDKs
Skills for your coding agentClaude Code plugins for charter, gsx, gsxui and structpagescharter install

mise.toml is the app's, and so is mise.lock, which says what each download must be: commit both. Every machine and CI then build with the same Go and the same Node.

[tools]
go = "1.27.4"
node = "26.13.1"
"github:jdx/fnox" = "1.50.0"

go tool charter check holds the app to it:

  • What runs is what is pinned. A shell whose PATH mise has not set for this folder runs another Go or Node, and what it builds is not what CI builds: check fails and says what runs and what is pinned. An interactive shell with mise activate follows the folder by itself. A shell that does not run its hook (an editor's task, an agent's) gets it with eval "$(mise hook-env)".
  • At least what charter was tested with. An app pins no less than charter's own mise.toml. After go tool charter upgrade, check --fix raises the app's pins and installs them; it never lowers one. What a release changed in how an app is written is on the upgrading page.

go.mod's go line is something else: the oldest Go the module may be built with. Leave it where it is until you need something newer.

In CI, mise's action installs the tools from mise.lock (charter's own workflows use it through .github/actions/tools). Renovate reads mise.toml and mise.lock and keeps them current; Dependabot does not read them.

The first command that talks to Cloudflare says, in three steps, how to put your token and account id into fnox, once. go tool charter env says whether they are there.

Every command

The commands are Vite+'s verbs. The commands, and what each one proves goes through them in the order you meet them: what each does, what it checks of your code, and what it leaves for the next one. go tool charter lists them, and go tool charter run lists the tasks that are no verb: intl:translate, seo:audit, db:status, ui:list and the rest.