---
title: "Installation"
description: "Start from an official template or add the layer to an existing Nuxt project. Compare setups and requirements."
canonical_url: "https://docs.mhaibaraai.me/en/docs/getting-started/installation"
---
# Installation

> Start from an official template or add the layer to an existing Nuxt project. Compare setups and requirements.

## Requirements

- Node.js 22.22.3+ (22.x), 24.15.0+ (24.x), or 26+. The content database uses the built-in `node:sqlite`, so `better-sqlite3` is not needed
- Nuxt 4.6.1+ (4.x), Tailwind CSS 4 and `@nuxt/content` 3, all peer dependencies installed in your project

## Create from a template

All three templates come with `extends`, a landing page and sample docs already set up:

| Template | Best for | Includes |
| --- | --- | --- |
| `default` | General documentation sites | Landing page, docs pages, ESLint and type checking |
| `i18n` | Multilingual sites | `default` plus `@nuxtjs/i18n`, with Simplified Chinese and English content |
| `module` | npm package or Nuxt module docs | `default` plus a `releases.yml` release notes page |

Replace `default` in the command with the template you need:

```bash [pnpm]
pnpm dlx nuxi init -t gh:mhaibaraai/movk-nuxt-docs/templates/default my-docs
cd my-docs
pnpm dev
```

```bash [npm]
npx nuxi init -t gh:mhaibaraai/movk-nuxt-docs/templates/default my-docs
cd my-docs
npm run dev
```

```bash [yarn]
yarn dlx nuxi init -t gh:mhaibaraai/movk-nuxt-docs/templates/default my-docs
cd my-docs
yarn dev
```

```bash [bun]
bunx nuxi init -t gh:mhaibaraai/movk-nuxt-docs/templates/default my-docs
cd my-docs
bun dev
```

`nuxi init` asks whether to install dependencies after creating the project. Then open [http://localhost:3000](http://localhost:3000).

The `.env.example` file in each template lists the available environment variables. Copy it to `.env` and fill in what you need:

```bash [.env]
# Reads GitHub commits and releases; required in production
NUXT_GITHUB_TOKEN=
# Enables AI Chat when set
AI_API_KEY=
# Optional: OpenAI-compatible endpoint; leave empty to use AI Gateway
AI_BASE_URL=
```

> [!NOTE]
> 
> The templates do not include the AI Chat dependencies. Install them as described in 
> 
> AI Chat
> 
>  before setting 
> 
> AI_API_KEY
> 
> , otherwise the build fails with the install command to run.

## Add to an existing project

### Install dependencies

```bash [pnpm]
pnpm add @movk/nuxt-docs @nuxt/content tailwindcss
```

```bash [npm]
npm install @movk/nuxt-docs @nuxt/content tailwindcss
```

```bash [yarn]
yarn add @movk/nuxt-docs @nuxt/content tailwindcss
```

```bash [bun]
bun add @movk/nuxt-docs @nuxt/content tailwindcss
```

> [!NOTE]
> 
> @nuxt/content
> 
>  must be a dependency of your application. The generated collection types only work when it resolves from the application scope; otherwise server-side 
> 
> queryCollection
> 
>  and friends are inferred as 
> 
> never
> 
> .

### Extend the layer

```ts [nuxt.config.ts]
export default defineNuxtConfig({
  extends: ['@movk/nuxt-docs']
})
```

### Write your first page

Docs must live in `content/docs/`, and the route prefix is always `/docs`:

```md [content/docs/1.getting-started/1.index.md]
---
title: Introduction
description: My first documentation page.
---

## Getting started

Write your content in Markdown.
```

Numeric prefixes in file names only control ordering, so the route above is `/docs/getting-started`. The landing page is rendered from `content/index.md`, or from `app/pages/index.vue` if you prefer a Vue page. See [Project Structure](https://docs.mhaibaraai.me/en/docs/getting-started/project-structure) for more conventions.

## Optional dependencies

Features that are off by default need extra dependencies. If you enable one without them, the build fails and prints the install command:

| Feature | Dependencies |
| --- | --- |
| AI Chat | `ai` `@ai-sdk/openai` `@ai-sdk/vue` `@comark/vue` `@shikijs/engine-javascript` `@shikijs/langs` `@shikijs/themes` |
| Component docs | `nuxt-component-meta` `vue-component-meta` `prettier` |
| Mermaid | `mermaid` `dompurify` |
| Accessibility checks | `@nuxt/a11y` |
| Internationalization | `@nuxtjs/i18n` |

See [Feature Flags](https://docs.mhaibaraai.me/en/docs/guide/features) for how to enable each one.

## Let an AI assistant help

The Agent Skills published by this site can be installed into AI assistants such as Claude Code or Cursor, so they generate pages that follow the theme's conventions:

```bash [Terminal]
npx skills add https://docs.mhaibaraai.me
```

Your own site publishes its `skills/` directory the same way, see [Agent Skills](https://docs.mhaibaraai.me/en/docs/ai/skills).


## Sitemap

See the full [sitemap](https://docs.mhaibaraai.me/sitemap.md) for all pages.
