Installation

Getting started with Lito is straightforward and fast. Whether you want to try it out immediately or integrate it into your project, we’ve got you covered.

Prerequisites

  • Node.js: Version 18.0.0 or higher
  • npm, yarn, or pnpm package manager

Installation Methods

Global Installation

Install Lito globally to use it across multiple projects:

Terminal window
npm install -g @litodocs/cli
# or
pnpm add -g @litodocs/cli

Then use it anywhere:

Terminal window
lito build -i ./my-docs -o ./dist
lito dev -i ./my-docs

Method 1: The Quickest Way (npx)

If you just want to spin up a docs site from an existing folder of markdown files without installing anything:

Terminal window
npx @litodocs/cli dev -i ./my-docs-folder

This command will:

  1. Scaffold a temporary Astro project
  2. Copy your docs into it
  3. Start a local development server at http://localhost:4321

Method 2: Adding to an Existing Project

If you want to keep your docs versioned with your code:

  1. Create a docs folder in your repository
  2. Add a docs-config.json file inside it
  3. Add Markdown or MDX files
  4. Run from your root:
Terminal window
npx @litodocs/cli dev -i ./docs

Method 3: Using a Custom Template

You can use custom templates from GitHub or local paths:

Terminal window
npx @litodocs/cli dev -i ./docs -t github:owner/template-repo
# or
npx @litodocs/cli dev -i ./docs -t ./path/to/local/template

Next Steps

After installation, explore these resources: