Anydocs Documents
CLI Commands

init - Initialize Project

Create a new Anydocs docs project with the CLI.

`init` creates a new docs project root. For user-site delivery and AI-assisted delivery alike, the first step is to create a clean project root rather than repeatedly initializing inside an existing directory.

Shortest Path

npx @anydocs/cli init ./my-docs

After initialization, open `./my-docs`, edit pages, set the target page to `published`, and then use `preview` to inspect the reader result.

AI Delivery Mode

If AI will participate from the start, choose an agent at init time so the CLI generates the matching project-local guide.

npx @anydocs/cli init ./my-docs --agent codex
npx @anydocs/cli init ./my-docs --agent claude-code

If you do not pass `--agent`, the default guide file is `skill.md`.

What `init` Creates

  • `anydocs.config.json`
  • `anydocs.workflow.json`
  • starter pages such as `pages/<lang>/welcome.json`
  • `navigation/<lang>.json`
  • default guide: `skill.md`
  • `--agent codex`: `AGENTS.md`
  • `--agent claude-code`: `CLAUDE.md` and `.claude/commands/`

When Not to Run `init` Again

If the target directory already has `anydocs.config.json`, it is already a docs project. Open it, edit content, or run `preview` / `build` instead of initializing again.