---
title: Use the CLI
description: Start a local preview while editing Radiant docs from source files.
---

Use the Radiant CLI when you want to edit docs locally and preview changes
before you push them.

You do not need the CLI for dashboard editing or writing-agent changes. Use it
when your docs live in a repository you can clone and edit on your machine.

## Before you start

You need:

- A local copy of the repository that contains your docs.
- Node.js and npm available in your terminal.
- A docs root folder that contains `docs.json`.

If your docs are in a monorepo, change into the folder that contains
`docs.json` before running the CLI.

## Start local preview

From the docs root, run:

```bash
npx radiant-docs
```

The CLI starts a local preview and prints the local URL. Use the URL shown in
your terminal. It is usually:

```txt
http://localhost:4321
```

Open that URL in your browser.

## Edit and review

While the CLI is running, edit `.mdx` files, assets, or `docs.json`. When you
save, the CLI syncs the change into the local preview.

The terminal shows changed files as they are synced. Keep the CLI running while
you review changes in the browser.

## Stop the preview

Press `Ctrl+C` in the terminal.

## What to expect

The first run can take longer because the CLI prepares the local preview and
installs preview dependencies. Later runs are faster.

When the preview starts, the CLI watches your docs folder. Save a page, asset,
or `docs.json` change and refresh the browser if the page does not update
automatically.

## What the CLI does not do

The CLI does not publish your docs, commit files, or push changes. After you
review local changes, commit and push them through your normal Git workflow.

Radiant deploys the updated docs after changes reach the connected repository.

## Common terminal messages

<AccordionGroup>
  <Accordion title="No docs.json found">
    Run the CLI from the docs root: the folder that contains `docs.json`.
  </Accordion>

  <Accordion title="Invalid JSON in docs.json">
    Fix the JSON syntax in `docs.json`, then run the CLI again.
  </Accordion>

  <Accordion title="Installing dependencies">
    This is expected on the first run or after the preview framework updates.
  </Accordion>
</AccordionGroup>

## Next steps

<Columns columns={3}>
  <Column>

  <Card title="Format text" href="/edit-markdown/format-text" icon="lucide:type">
    Edit page source confidently.
  </Card>

  </Column>
  <Column>

  <Card title="Configure with docs.json" href="/configure-with-docs-json/overview" icon="lucide:file-json-2">
    Adjust site configuration.
  </Card>

  </Column>
  <Column>

  <Card title="Deployments" href="/publish-and-manage/deployments" icon="lucide:cloud-upload">
    See what happens after push.
  </Card>

  </Column>
</Columns>
