Every content group in the sidebar (Commands, Runbooks, Incidents, Gotchas, My docs, Guide) has a + button,
and tool pages / index pages have an Add command / New … button. It opens a form with the template,
title prefix and today’s date already filled in. Save to GitHub commits the file to
the repo (the repo is the database), and the deploy
publishes it within a couple of minutes. Unsaved drafts are kept in your browser if you close the form.
Preview before saving
Both dialogs have Write / Preview tabs (or press Ctrl/⌘+Shift+P). Preview renders
the page (title, tags, Markdown, code blocks, tables, :::note boxes) or the command card, and lists anything
that would stop the save.
Edit existing pages from the site
Every page has an Edit button under its title, and every command card has a pencil button. It loads the
file from GitHub (frontmatter + Markdown, or the command’s YAML), you change it, and Save changes commits it.
The same checks as the content lint run first. If the file changed on GitHub since you opened it, saving stops
and your text is kept, so nothing is overwritten. Unsaved edits survive closing the dialog.
One-time setup: GitHub token in Cloudflare
The GitHub token lives in Cloudflare as a secret, never in a browser. The site’s Worker (worker/index.js)
uses it to commit, but only after you unlock saving with an editor password (also a Cloudflare secret).
Create a GitHub fine-grained token: GitHub → Settings → Developer settings → Personal access tokens →
Fine-grained tokens → Generate. Only select repositories → My_DevOps_Playbook;
Repository permissions → Contents: Read and write.
In the project folder run npm run setup:editor. It asks for two values and stores them in Cloudflare:
GITHUB_TOKEN: paste the token from step 1
EDITOR_PASSWORD: choose a long passphrase
On the site, click any +, open Saving locked at the bottom, enter the editor password, click Unlock.
Each browser asks once. Lock forgets it.
To rotate: run the same command again (new token or new password). The site can only create new files in the
content folders and edit existing pages and commands. Nothing else in the repo (workflows, code, config) can be
read or written through it.
Without the Cloudflare secrets (for example in npm run dev) the form falls back to asking for a GitHub token
directly, stored only in that browser.
The form checks the same rules as npm run lint:content (title prefix, lowercase tags, required fields)
before saving. For editing existing pages, use Edit page at the bottom of each page (opens GitHub’s editor)
or the full editor at /admin/.
npm run new -- command "Kubernetes: Show pod restarts"
runbook
src/content/docs/runbooks/
npm run new -- runbook "Fix pod stuck in ImagePullBackOff"
incident
src/content/docs/incidents/
npm run new -- incident "Expired TLS cert on api gateway"
gotcha
src/content/docs/gotchas/
npm run new -- gotcha "Helm --wait ignores Jobs"
howto
src/content/docs/my-docs/how-to/
npm run new -- howto "Rotate AWS IAM access keys"
note
src/content/docs/my-docs/notes/
npm run new -- note "Staging VPN setup"
It adds the prefix if you leave it out (incidents get today’s date), generates the slug file name,
pre-fills type, tags, aliases and created from the title, and copies the matching file from templates/.
Options: --tags a,b, --aliases "x,y", --tool <tool> (commands), --force.