cli
@farming-labs/docs CLI — scaffold and upgrade docs. Use when running init, upgrade, or using flags like --template, --name, --theme, --entry, --framework, --latest, --beta. Covers npm, pnpm, yarn, bun commands and framework detection.
Installation
Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.
View source ↗GuidesSkill instructions
@farming-labs/docs — CLI
The @farming-labs/docs CLI scaffolds and upgrades documentation projects. Use this skill when the user asks about CLI commands, init, upgrade, or scaffolding.
Init (add docs or bootstrap project)
Add docs to an existing app: Run from the project root. The CLI detects the framework from package.json (next, @sveltejs/kit, astro, nuxt) and scaffolds config, routes, CSS, and sample pages.
# npm
npx @farming-labs/docs@latest init
# pnpm
pnpm dlx @farming-labs/docs@latest init
# yarn
yarn dlx @farming-labs/docs@latest init
# bun
bunx @farming-labs/docs@latest init
If the CLI cannot auto-detect the framework, it will prompt you to choose one.
Bootstrap a new project from scratch: Use --template and --name. The CLI creates the project folder, installs dependencies, and can start the dev server.
npx @farming-labs/docs@latest init --template next --name my-docs
npx @farming-labs/docs@latest init --template nuxt --name my-docs
npx @farming-labs/docs@latest init --template sveltekit --name my-docs
npx @farming-labs/docs@latest init --template astro --name my-docs
Replace my-docs with the desired folder name. Same pattern with pnpm dlx, yarn dlx, or bunx.
Init flags
| Flag | Description |
|---|---|
--template <name> |
Bootstrap a project: next, nuxt, sveltekit, astro. Use with --name. |
--name <project> |
Project folder name when using --template (e.g. my-docs). |
--theme <name> |
Skip theme prompt. Values: e.g. fumadocs, greentree, pixel-border, darksharp, colorful, darkbold, shiny. |
--entry <path> |
Skip entry path prompt. Default is docs. |
Example (non-interactive bootstrap with theme):
npx @farming-labs/docs@latest init --template next --name my-docs --theme pixel-border
Upgrade
Upgrade all @farming-labs/* docs packages to the latest version. Run from the project root. The CLI auto-detects the framework from package.json and upgrades the correct packages.
# npm
npx @farming-labs/docs@latest upgrade
# pnpm
pnpm dlx @farming-labs/docs@latest upgrade
# yarn
yarn dlx @farming-labs/docs@latest upgrade
# bun
bunx @farming-labs/docs@latest upgrade
| Framework | Packages upgraded |
|---|---|
| Next.js | @farming-labs/docs, @farming-labs/theme, @farming-labs/next |
| Nuxt | @farming-labs/docs, @farming-labs/nuxt, @farming-labs/nuxt-theme |
| SvelteKit | @farming-labs/docs, @farming-labs/svelte, @farming-labs/svelte-theme |
| Astro | @farming-labs/docs, @farming-labs/astro, @farming-labs/astro-theme |
Upgrade flags
Explicit framework (e.g. in a monorepo or when auto-detect fails):
npx @farming-labs/docs@latest upgrade --framework astro
# or
npx @farming-labs/docs@latest upgrade astro
Valid values: next, nuxt, sveltekit, astro.
Version channel:
npx @farming-labs/docs@latest upgrade # latest stable (default)
npx @farming-labs/docs@latest upgrade --latest # same
npx @farming-labs/docs@latest upgrade --beta # beta versions
What init does (per framework)
-
Next.js: Detects
nextin dependencies; generatesdocs.config.ts,next.config.ts,app/global.css,app/layout.tsx,app/docs/layout.tsx, sample MDX pages; installs@farming-labs/docs,@farming-labs/theme,@farming-labs/next; can start dev server. -
SvelteKit: Detects
@sveltejs/kit; generatessrc/lib/docs.config.ts,src/lib/docs.server.ts,src/routes/docs/*,src/app.css,docs/*.md; installs svelte + svelte-theme packages. -
Astro: Detects
astro; generatessrc/lib/docs.config.ts,src/lib/docs.server.ts,src/pages/**, API route,docs/*.md; installs astro + astro-theme packages. -
Nuxt: Detects
nuxt; generatesdocs.config.ts,nuxt.config.ts,server/api/docs.ts,pages/docs/[...slug].vue,docs/*.md; installs nuxt + nuxt-theme packages.
Edge cases
-
Monorepo — Run
initfrom the app package root (wherepackage.jsonwith the framework dependency lives). Forupgrade, use--frameworkif auto-detect picks the wrong one. -
No package.json / wrong directory — Init and upgrade must run in a directory that has (or will have) a
package.jsonwith the framework dependency. -
Beta — Use
upgrade --betato get beta versions of the docs packages.
Resources
- Full CLI docs: docs.farming-labs.dev/docs/cli
-
Getting started: use the
getting-startedskill in this repo for install and theme CSS.
Examples
Read the usage examples in the source repository.
View source ↗Source history
- Indexed on
- 2026-03-11
- Index updated
- 2026-03-11
- Branch
- main
Index and sync dates describe this directory. View the source repository for code history.
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!