---
title: Getting Started
description: Set up your Syntext documentation site in under 5 minutes.
icon: rocket
---

# Getting Started

This guide walks you through creating your first Syntext documentation site. By the end, you'll have a live docs site with hot-reload development and production deployment.

## Prerequisites

- **Node.js 18+** or **Bun** installed
- A code editor (VS Code recommended)
- A terminal

## Installation

Install the Syntext CLI globally:

<CodeGroup>

```bash title="curl (Recommended)"
curl -fsSL https://get.syntext.dev | sh
```

```bash title="Homebrew"
brew install syntext-dev/tap/stx
```

```bash title="npm"
npm install -g @syntext/cli
```

</CodeGroup>

Verify the installation:

```bash
stx --version
```

## Create Your First Docs Site

### Step 1: Initialize

Navigate to your project directory and run:

```bash
cd my-project
stx init --name "My Docs" --create
```

<Note>
The `--create` flag creates a project on Syntext and links it automatically. If you prefer to do this manually, omit the flag and use `stx connect` later.
</Note>

This creates the following structure:

```
my-project/
├── syntext.json   # Site configuration
├── docs/
│   ├── index.mdx         # Home page
│   └── guides/
│       └── getting-started.mdx
└── public/               # Static assets
```

### Step 2: Start Development

```bash
stx dev
```

This deploys a preview build and outputs your URL:

```
✓ Preview: https://dev--my-project.syntext.dev
```

The preview updates automatically as you save files.

### Step 3: Edit Your First Page

Open `docs/index.mdx` and make changes. The browser updates instantly.

```mdx
---
title: Welcome to My Docs
description: Get started with our product.
---

# Welcome

This is my documentation site powered by Syntext.

<Note>
Edit this file at `docs/index.mdx` to customize your home page.
</Note>
```

### Step 4: Deploy to Production

When you're ready to publish:

```bash
stx deploy
```

Your docs are now live at `your-project-docs.syntext.dev`.

<Tip>
Set up a custom domain like `docs.yourcompany.com` in the [dashboard](https://syntext.dev/dashboard).
</Tip>

## Project Layouts

Syntext supports two project layouts:

### Standalone Docs Repo

Configuration at the repository root:

```
my-docs/
├── syntext.json
├── docs/
├── public/
└── openapi.json
```

### Embedded in App Repo

Documentation inside `.syntext/` or `.stx/`:

```
my-api/
├── src/
├── package.json
└── .syntext/
    ├── syntext.json
    ├── docs/
    └── public/
```

The CLI auto-detects which layout is in use. Commands like `stx dev` and `stx deploy` work identically in both cases.

## Next Steps

<CardGroup cols={2}>
  <Card title="Project Structure" href="/guides/project-structure">
    Learn how to organize your documentation
  </Card>
  <Card title="Writing Content" href="/guides/writing-content">
    Master MDX syntax and components
  </Card>
  <Card title="CLI Reference" href="/cli/overview">
    Explore all CLI commands
  </Card>
  <Card title="Components" href="/components/overview">
    Discover available MDX components
  </Card>
</CardGroup>
