Documentation Index
Fetch the complete documentation index at: https://mintlify.com/alineacms/alinea/llms.txt
Use this file to discover all available pages before exploring further.
alinea init bootstraps a new Alinea project in your current working directory. It writes a starter cms.ts configuration file, creates the initial content directory structure, and patches your package.json scripts so that dev and build automatically invoke the Alinea CLI alongside your existing tooling.
Usage
Initialize a project
What Gets Created
When you runalinea init, the following actions take place:
1. Content directories
Two directories are created if they don’t already exist:
content/pages/— stores your page content as JSON filescontent/media/— stores media asset metadata
content/pages/welcome.json is written with a starter Page entry so the dashboard has something to display on first launch.
2. cms.ts configuration file
The config file is written to the project root, or to src/cms.ts if a src/ directory is detected. When Alinea detects a Next.js project (via a next dependency in package.json), it imports from alinea/next instead of alinea/core.
The generated file looks like this:
cms.ts
src/app/(alinea)/api/cms/route.ts (or app/(alinea)/api/cms/route.ts without a src/ dir):
app/(alinea)/api/cms/route.ts
package.json script patching
Alinea prepends its CLI commands to your existing dev and build scripts:
"dev"becomes"alinea dev -- <previous command>""build"becomes"alinea build -- <previous command>"
Package Manager Detection
alinea init detects your package manager by looking for lockfiles in the following order: bun.lockb, pnpm-lock.yaml, yarn.lock, package-lock.json. The detected runner (npx, pnpm, yarn, or bun) is used in the success message printed after initialization.
Next Steps
After runningalinea init:
- Start the dashboard — run
npx alinea dev(or your patcheddevscript) to open the local CMS athttp://localhost:4500. - Customize
cms.ts— add your own content types, fields, and workspaces. - Configure
baseUrl— update the production URL incms.tsto match your deployed site.
alinea init only needs to be run once per project. After the initial setup, modify cms.ts directly to evolve your schema. Running alinea init a second time in the same directory will exit with an error because Alinea detects the existing config file.