# Quick start

Silen turns a directory of Markdown and MDX into a server-rendered static site,
local search, and deterministic AI-readable output. Use Node.js `^20.19.0 || >=22.12.0`.

## Install and activate

From your project root, install Silen, then activate a `docs` directory:

```sh
pnpm add -D @aicode-nexus/silen
pnpm silen init docs
```

Silen installs its required `react` and `react-dom` runtime, including MDX's
`react/jsx-runtime`, automatically.

`init` creates `docs/.silen/config.ts` and `docs/index.mdx`. It is safe for a
new or existing directory: if either target already exists, Silen reports the
collision instead of overwriting authored content.

## Develop

```sh
pnpm silen dev docs
```

Edit `docs/index.mdx` or add another `.md` or `.mdx` file. File routes are
created from the directory tree, and client navigation updates without a full
page reload. Local search stays on the site; no hosted search account is
required.

## Build and inspect

```sh
pnpm silen build docs
pnpm silen preview docs
```

The default output directory is `docs/.silen/dist`. A build emits complete
HTML plus AI artifacts such as `llms.txt`, `llms-full.txt`, `ai-index.json`,
and clean Markdown routes. Draft pages and pages with `ai: false` remain out of
those AI-facing artifacts.

## Make the first decision explicit

Set `base` when the site will live below a host subpath, and set `siteUrl` to
the origin when canonical metadata is required:

```ts
export default defineConfig({
  base: '/handbook/',
  siteUrl: 'https://docs.example.com',
  onBrokenLinks: 'error',
})
```

Continue with [project structure](/silen/guide/project-structure/),
[configuration](/silen/guide/configuration/), or inspect the
[live AI output](/silen/ai/).
