> ## Documentation Index
> Fetch the complete documentation index at: https://context7.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Preview and publish a Docs7 site

## 1. Add your docs

In a new folder, create a `docs.json` file:

> [!TIP]
>
> You can skip this step if your project already has a `docs.json` or `mint.json` file.

```json docs.json theme={null}
{
  "$schema": "https://context7.com/schema/docs7.json",
  "name": "My docs",
  "colors": {
    "primary": "#16A34A"
  },
  "navigation": {
    "groups": [
      {
        "group": "Guide",
        "pages": ["index"]
      }
    ]
  }
}
```

`name`, `colors.primary`, and `navigation` are required. `theme` is optional: Docs7 renders every site with the `mint` theme. The dev server reports a missing field as `docs.json is invalid`.

Then add the first page:

```mdx index.mdx theme={null}
---
title: Introduction
description: Welcome to my docs
---

Hello, world.
```

## 2. Install the CLI

Use Node.js 20.19 or newer. Install the package globally:

```bash theme={null}
npm install -g @upstash/docs7
```

This adds the `docs7` command to your terminal.

## 3. Start the dev server

Run this from the folder that contains `docs.json`:

```bash theme={null}
docs7 dev
```

Open [http://localhost:3000](http://localhost:3000), or the address that the command prints. The page reloads when you edit a file.

The first run downloads the renderer and caches it for later. You can also pass a project folder or use another port:

```bash theme={null}
docs7 dev ./docs --port 4000
```

> [!NOTE]
>
> You can also run the CLI without installing it: `npx @upstash/docs7 dev`.

## 4. Publish

### With the CLI

Run these commands from your documentation folder:

```bash theme={null}
docs7 login
docs7 deploy
```

The login command shows a one-time code and an approval link. Press Enter to open the browser, then approve access with your Context7 account.

`docs7 deploy` publishes to production without a GitHub repository. It shows the site overview link and prints the public URL when the build is ready.

Run `docs7 deploy` again after you edit your docs to update the same site. Keep `.docs7/project.json`, which stores the site link. See the [CLI reference](https://context7.com/docs/docs7/cli.md) for login options, previews, and upload exclusions.

### With GitHub

1. Push the project to GitHub.
2. Open the **Docs7** tab in your Context7 teamspace.
3. Click **Add New Site** and choose the repository.
4. Set the production branch and the folder that contains `docs.json`.
5. Click **Publish Site**.

![Publish a site in Docs7](https://mintcdn.com/context7/5U3bU4WBaie41tqk/images/docs7/publish-a-site.png?fit=max\&auto=format\&n=5U3bU4WBaie41tqk\&q=85\&s=0bad66dfa328e06c8028e3d4eb3e83cb)

Every push to the production branch creates a new deployment. Pull requests get a preview site.

Next, learn [how production and preview builds work](https://context7.com/docs/docs7/builds.md) or browse the [MDX components](https://context7.com/docs/docs7/components/callouts.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.