For coding agents

This page is written for you, the coding agent. A person asked you to add Zine, a blog or a CMS to their Next.js or Astro project. Follow these steps in order.

You need no Zine account and no keys. You install and check everything yourself. The person signs in once, at the end, after they have seen the result.

What Zine is

Zine stores and serves the content: posts, pages, newsletters and forms. The person’s project renders the blog with its own layout and stays in their repository. A small runtime package, @tryzine/blog-runtime, reads published content from Zine’s API.

Before you start

  • Work from the repository root, with a clean git tree, so the person can review one diff.
  • Use Node 22.12 or newer.
  • Next.js needs the App Router and React 19. Astro can build static pages or render on request through an adapter.
  • Do not write Zine’s files yourself or guess at its setup. The CLI scans the project and writes every file. It is the source of truth.

1. Scan the project

This reads files and changes nothing.

npx -y @tryzine/cli@latest detect --json

It prints one line of JSON, {"type":"profile", ...}. Tell the person what it found: the framework, the router, the package manager, and anything listed in ambiguities. Ask them about each ambiguity. Do not invent answers.

2. Show the plan

npx -y @tryzine/cli@latest init --agent --no-login --dry-run --yes

With --agent, the CLI prints one JSON event per line. With --dry-run, it writes nothing. Read the events:

  • warning: something the person should know, such as a static Astro site that needs a deploy hook. Pass each one on.
  • applied with "dryRun": true: one change it would make. write adds a file, insert and patch edit one, install adds packages and env adds keys to .env.local.
  • done: the end. "ok": false means it stopped; read the error event before it.

Summarize the changes for the person as a short list and ask them to approve.

3. Install

Only after the person approves:

npx -y @tryzine/cli@latest init --agent --no-login --yes

The same events arrive without dryRun. The install adds the blog pages, an RSS feed and a blog sitemap, installs @tryzine/blog-runtime, and writes placeholder keys to .env.local. It also makes git ignore every env file except .env.example. If done reports "ok": false, stop and tell the person what the error event says.

4. Check it

Start the dev server and open /blog, or the path the plan named. Until the site is connected, the blog shows a short note that it is not connected yet instead of posts. That is the expected result at this point.

If something looks wrong, run:

npx -y @tryzine/cli@latest doctor

5. Hand over the one step you cannot do

Connecting the site needs the person. Tell them to run this in their terminal:

npx @tryzine/cli@latest login

It shows a code and opens a browser. The person signs in, or creates a Zine account, approves the code and picks a site. The CLI then writes the real keys to .env.local. After that, published posts appear on /blog.

Never ask the person to paste keys into the chat, and never commit .env.local. The secret key stays on the server.

Rules

  • Ask before you apply anything. The dry run in step 2 is how.
  • Leave the files the CLI writes as they are unless the person asks for a change.
  • Report the CLI’s warnings and errors in plain words. Do not hide one to finish faster.

More for agents

  • An index of every page on this site: https://tryzine.ai/llms.txt. Any page here also answers Accept: text/markdown.
  • Search the site: https://tryzine.ai/.well-known/search?q={query} answers in markdown.
  • The CLI package includes an install skill, skills/zine-install/SKILL.md, with the same steps.
  • Every command and flag: CLI.