Reference

admin.json

On this page

After this page you can write the settings of a site yourself, or let your AI coding assistant write them.

admin.json lives in the root of your repository. Siteshare always reads it from main, never from the client’s draft. Every field is optional: without the file, or with a field left out, Siteshare uses what it found when it checked the site.

{
  "start": "npm run dev -- --host 0.0.0.0 --port {port}",
  "build": "npm run build",
  "protected": ["src/components/Footer.astro"],
  "open": ["src/components/cards/**"],
  "instructions": "Write the bakery's name in full: Bakkerij De Korst.",
  "folder": "apps/web"
}

The fields

start

The command that starts the site’s development server, as text. {port} is filled in with the port Siteshare uses. The command runs as words, never through a shell: no &&, pipes or variables. Without it, Siteshare uses the usual command for the kind of site.

build

The command that builds the site, as your host would. Siteshare builds before every publication, so a client can never publish a site that does not build. Without it: npm run build, or what the kind of site uses.

protected

Paths or patterns your clients may never change, on top of what is protected already. A pattern uses * for one level, ** for any depth, and {a,b} for either. Example: ["src/components/Footer.astro", "src/layouts/**"]. At most 200 lines.

open

Paths or patterns you release from what is protected by default, such as a folder of components whose text clients may change. admin.json itself can never be opened. At most 200 lines.

instructions

Text for the assistant your client talks to, at most 4000 characters: the tone of the site, words to use or avoid, what to leave alone. Write it as you would to a new colleague.

folder

The folder the site stands in, when it is not at the top of the repository, such as "apps/web" in a monorepo. "." means the top. Without it, Siteshare uses the folder it finds.

When the file has a mistake

A mistake never holds a site back. Siteshare uses its own settings for what it cannot read, and the site’s page and Log say what was wrong, in plain words. A file that is not valid JSON counts as no file at all.

What Siteshare checks

  • admin.json is always protected: a client or the assistant can never change it.
  • When you save settings in Settings, Siteshare writes admin.json as one commit on main, marked [skip ci], and only what it would read itself.
  • A change to protected or open gives a line in the site’s Log, with who made it.
View as plain text, for an AI assistant.