@shapio/cms
v0.5.15
Published
Self-hosted headless CMS: model content live, deliver it over REST and GraphQL.
Readme

@shapio/cms is the Shapio server and its shapio CLI. Start a project with:
npx create-shapio@latest my-cms --database-url sqlite:./shapio.db
cd my-cms
npm run startThen open http://localhost:4300/admin/ and create your account. The
repository has the full tour and the
documentation.
Extensions
A project's shapio.config.ts (or .mts, .js, .mjs; SHAPIO_CONFIG_PATH to point elsewhere) adds code
to Shapio: lifecycle hooks, custom routes under /api/ext/<prefix>, shared services, background jobs and
custom field editors. Types and helpers come from @shapio/cms/config:
import { defineConfig } from '@shapio/cms/config';
export const config = defineConfig({
hooks: { article: { beforePublish: ({ data, reject }) => void (data?.cover || reject('Needs a cover')) } },
editors: [],
});before*hooks run inside the write's transaction; rejecting answers 422HOOK_REJECTEDand nothing is written.after*hooks run after commit as jobs, exactly once per change for their database work.- Extensions are code: changing them needs a restart, never a rebuild. Content models change live.
npx shapio extensions checkvalidates the config (no database needed) and exits 1 on any problem.
The full guide is documentation/extensions.md.
