Skip to main content

Local development setup

This guide covers running the docs site locally so you can preview changes before submitting a pull request.

Prerequisites​

ToolVersionInstall
Node.js20.x or highernodejs.org
npm10.x or higherIncluded with Node 20
GitAny recent versiongit-scm.com

Verify your versions:

node --version   # should print v20.x.x or higher
npm --version # should print 10.x.x or higher

Clone the repository​

This is a private repository. Clone with your access credentials:

git clone <repo-url>
cd agentlux

Install dependencies​

From the monorepo root (this installs dependencies for all packages including docs):

npm ci

This installs Docusaurus and all its dependencies into apps/docs/node_modules. It uses the lockfile for deterministic installs.

Workspace-aware installs

The repo uses npm workspaces. Running npm ci from the root handles all packages. You don't need to cd into apps/docs for installation.

Start the dev server​

npm run start --workspace=@agentlux/docs

Or from the apps/docs directory directly:

cd apps/docs
npm run start

The docs site starts at http://localhost:3000.

What you'll see​

  • Dark theme with AgentLux brand colors by default
  • Full search (powered by @easyops-cn/docusaurus-search-local — requires a build for search to work)
  • All three sidebars: Docs, Agent SDK, API Reference

Live reload​

Docusaurus watches for file changes and hot-reloads automatically. You'll see changes in your browser within a second of saving a file.

Changes to docusaurus.config.ts or sidebars.ts require restarting the dev server.

Build for production​

npm run build --workspace=@agentlux/docs

This generates a static site in apps/docs/build/. You can serve it locally:

npm run serve --workspace=@agentlux/docs

The build validates all internal links — broken links cause the build to fail (onBrokenLinks: 'throw' in the config). Always run a build before opening a PR for significant changes.

File structure walkthrough​

Adding a new page​

  1. Create a new .md file in the appropriate docs/ subdirectory
  2. Add frontmatter (see Style guide for required fields)
  3. Add the page to sidebars.ts in the correct location
  4. Run the dev server and verify it appears in the nav

Editing an existing page​

Just edit the .md file. Live reload handles the rest.

Adding images​

Place images in apps/docs/static/img/. Reference them in markdown:

![Alt text for the image](/img/my-screenshot.webp)

Images in static/ are served at the root path. Use descriptive filenames with kebab-case.

Modifying the sidebar​

Edit apps/docs/sidebars.ts. The structure is self-documenting — look at existing entries to understand the doc, category, and link item types.

Turbo build​

If you want to run the docs build within the Turborepo pipeline:

npx turbo build --filter=@agentlux/docs

This respects the turbo cache and only rebuilds when inputs change.