create-tenoncms
create-tenoncms creates a project with Tenon from a starter. It asks where the site runs and which database, storage, image provider, email and sign-in methods to use, and writes a project that runs with those choices. This page lists every question, what each answer writes, and how to run it without questions.
Usage
npm create tenoncms@latest
pnpm create tenoncms
yarn create tenoncms
bun create tenoncms
It needs Node 24 or newer. It asks one question at a time. The first answer of each question is the default. A question with only one answer is skipped.
At the end, it prints the next steps and the variables you still need to set. Then:
- Fill in the variables in
.env. - Run
dev. - Open
/adminand create the first admin.
Questions
| Question | Flag | Answers |
|---|---|---|
| Where should we put your new project? | the first argument | A folder. Default: ./tenon-cms |
| What should the site be called? | --site-name | Written to site.name. Default: Tenon |
| Which framework would you like to work with? | --framework | astro, nuxt, tanstack, standalone |
| Do you want a starter template? | --template | minimal: one collection and two pages |
| Where will it run? | --target | node, vercel, cloudflare |
| Which database should we use? | --database | Depends on the target. See What works where |
| Where should media files go? | --storage | Depends on the target |
| How should images be resized? | --images | Depends on the target |
| How should the CMS send email? | --email | none, smtp, cloudflare. Default: none |
| How should people sign in to the admin? | --auth | A list of password, passkey, magic-link, email-otp. Default: password |
| Which package manager? | --pm | npm, pnpm, yarn, bun. Default: the one that runs it |
| Install dependencies? | --install, --no-install | Default: yes |
| Initialize a git repository? | --git, --no-git | Default: yes |
If the folder has files, it asks whether to delete them, keep them or cancel. Without a terminal, the folder MUST be empty.
- If the install fails, the project stays. Run the install yourself.
- The git repository gets a first commit,
chore: initial commit. Without a git name and email, it stays without one. --helpor-hlists every flag.
What works where
The database, storage, image and email questions offer only what works on the target. The first one is the default:
| Target | Database | Storage | |
|---|---|---|---|
node: a server you run | libsql, postgres, pglite, sqlite | local, s3, r2 | none, smtp, cloudflare |
vercel: serverless functions | libsql, postgres | s3, r2 | none, smtp, cloudflare |
cloudflare: Workers, Astro only | durable-object | r2 | none, cloudflare, smtp |
| Database | What it is |
|---|---|
libsql | SQLite in a local file, or Turso by URL. On Vercel, Turso |
postgres | Postgres, for example Neon or your own server |
pglite | Postgres in a folder, without a server |
sqlite | Node's built-in node:sqlite, in a file, without a native package |
durable-object | SQLite inside a Cloudflare Durable Object |
| Storage | What it is |
|---|---|
local | A folder on the server, ./.uploads |
s3 | Any S3-compatible bucket: AWS, R2, MinIO and others |
r2 | Cloudflare R2. A binding on Cloudflare, API keys elsewhere |
See Databases and Media storage to choose.
Images
--images picks how Tenon resizes images. The first one of the target is the default:
| Target | Image providers |
|---|---|
node | ipx, none, cloudflare-url, netlify, imgix, cloudinary, imagekit, bunny, imgproxy, thumbor |
vercel | none, vercel, ipx, cloudflare-url, imgix, cloudinary, imagekit, bunny, imgproxy, thumbor |
cloudflare | cloudflare, cloudflare-url, none, imgix, cloudinary, imagekit, bunny, imgproxy, thumbor |
ipxrenders WebP variants with sharp on your server, and adds theipxpackage.noneserves the originals.vercelneedsimagesin the Vercel config.
See Image providers.
Sign-in methods
--auth takes any mix of methods. At least one is required.
passwordalone writes nothing, because it is the default. Without it, the config turns passwords off.passkeyadds@better-auth/passkeyand its plugin.magic-linkandemail-otpaddmagicLink()andemailOTP(). They need email. Without email,npx tenon users recover <email>prints a sign-in link until you add it.
Without password, the first admin signs up without one. See Authentication.
Run without questions
Every question has a flag, so the command also runs in a script:
npm create tenoncms@latest my-site -- --site-name "My Site" --framework nuxt --target node --database postgres --storage s3 --images imgix --email smtp --auth passkey,magic-link --pm pnpm --yes
--yesor-ytakes the default for every question without a flag.- Without a terminal, it takes the defaults too.
- An answer that does not fit the target fails with the list of valid answers.
--templates <source> takes the starters from another place: a giget source or a local folder. TENON_TEMPLATES does the same.
What it writes
The project has the files of the starter, with your choices filled in:
tenon.config.tswith the database, the storage, the image provider, the email and the sign-in methods.- The framework config with the Tenon adapter. In Astro,
astro.config.tsalso gets the env schema. package.jsonwith the packages your choices need, and the current version oftenoncms. Offline, it keepslatest. The package is named after the folder..env.examplewith every variable the config reads, one block per choice..env, a copy of.env.examplewith a randomTENON_SECRET. On Cloudflare, these are.dev.vars.exampleand.dev.vars.
Variables
Each choice adds its variables. Fill them in before you start the project:
| Choice | Variables |
|---|---|
| Every project | TENON_SECRET, TENON_SITE_URL |
standalone | TENON_CMS_URL, the CMS origin when a site on another origin reads it |
libsql | DATABASE_URL (default file:./cms.db), DATABASE_AUTH_TOKEN for Turso |
postgres | DATABASE_URL |
pglite | DATABASE_DIR (default ./.pglite) |
sqlite | DATABASE_PATH (default ./cms.db) |
s3 | S3_BUCKET, AWS_ENDPOINT_URL_S3, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION, and S3_PREFIX if you like |
r2, outside Cloudflare | CLOUDFLARE_ACCOUNT_ID, R2_BUCKET, R2_ACCESS_KEY_ID, R2_SECRET_ACCESS_KEY, and R2_PREFIX if you like |
smtp | SMTP_HOST, SMTP_PORT (default 465), SMTP_USER, SMTP_PASSWORD, EMAIL_FROM |
cloudflare email | CLOUDFLARE_ACCOUNT_ID, CLOUDFLARE_EMAIL_API_TOKEN, EMAIL_FROM. On Cloudflare, EMAIL_FROM only |
| A hosted image provider | Its URL, like IMGIX_URL or CLOUDINARY_BASE_URL |
- In Nuxt, every variable has the
NUXT_prefix, likeNUXT_DATABASE_URL. TENON_SITE_URLstays commented out in development, so the adapter uses the URL of the dev server. Set it in production to the public origin of the site.TENON_CMS_URLstays commented out too. Set it together withTENON_SITE_URLwhen the site runs on another origin. See Headless.S3_PREFIXandR2_PREFIXkeep every file in one folder of the bucket, so several sites can share it.- A bucket MUST allow
PUTfrom the site in its CORS rules and exposeETag, for uploads from the browser. - On Vercel, set the variables in the project settings. With
libsql,DATABASE_URLMUST be a Turso URL there. - On Cloudflare, run
typesonce after the install. The Worker and the bucket<name>-mediaare named after the project.
Related resources
- Quick start: your first project, step by step.
- Configuration: what the generated
tenon.config.tsholds. - Deployment: run the project on Node, Vercel or Cloudflare.