---
title: CLI Reference
description: All create-thally-docs commands for scaffolding, migrating, and linting Thally projects.
url: http://localhost:3040/guides/cli-reference
---

# CLI Reference

All create-thally-docs commands for scaffolding, migrating, and linting Thally projects.

The `create-thally-docs` CLI is the primary tool for working with Thally projects from the terminal. Install it globally or run it directly with `npx`.

```bash
npx create-thally-docs [command] [args] [options]
```

---

## create-thally-docs (scaffold)

Creates a new Thally documentation project.

```bash
npx create-thally-docs my-docs
```

The CLI walks through an interactive setup:

- **Project name** — displayed in the header and metadata
- **Description** — used for SEO and OpenGraph tags
- **Brand preset** — `primary` (green) or `secondary` (purple)
- **GitHub repo URL** — auto-wires Support and GitHub links
- **Install dependencies** — runs `npm install` for you

Skip all prompts and accept defaults with `--yes`:

```bash
npx create-thally-docs my-docs --yes
```

### Options

| Flag | Description |
|------|-------------|
| `--yes`, `-y` | Accept all defaults, skip interactive prompts |

---

## create-thally-docs migrate

Migrates a public documentation URL or GitHub documentation repository into a Thally project.

```bash
npx create-thally-docs migrate <github-or-docs-url> [output-dir] [options]
```

For repository sources, Thally clones and reads the source content directly. For live sites, it discovers machine-readable indexes, sitemaps, and same-origin documentation navigation. Both paths produce the same ready-to-run Thally project.

**Supported source platforms:** Mintlify, Docusaurus, GitBook, Nextra, VitePress, Starlight, and any repo with plain Markdown files.

### Examples

```bash
# Migrate a live documentation site
npx create-thally-docs migrate https://docs.example.com example-docs

# Trial a large live site with at most 100 pages
npx create-thally-docs migrate https://docs.example.com example-docs --max-pages 100

# Migrate into a new project at ./my-docs
npx create-thally-docs migrate https://github.com/org/repo my-docs

# Derive the output dir from the repo name
npx create-thally-docs migrate https://github.com/mintlify/starter

# Migrate a specific branch or subdirectory
npx create-thally-docs migrate https://github.com/org/repo/tree/main/docs my-docs

# Migrate content into an existing Thally project
npx create-thally-docs migrate https://github.com/org/repo --into ./existing-docs
```

### What gets migrated

- All `.md` and `.mdx` files are copied and converted to clean MDX
- Navigation structure is detected from `mint.json`, `docusaurus.config.js`, `docs.json`, or inferred from the directory structure
- OpenAPI spec files (`.json`, `.yaml`) are detected and wired up as an API Reference tab
- Platform-specific MDX components are normalized to Thally equivalents (see [component mapping](#component-mapping) below)

### Options

| Flag | Description |
|------|-------------|
| `--max-pages <count>` | Import at most 1–1,000 content pages from a public docs URL (default: 1,000) |
| `--into <dir>` | Migrate into an existing Thally project instead of scaffolding a new one |
| `--branch <name>` | Override the auto-detected git branch |
| `--docs-dir <path>` | Override the auto-detected docs subdirectory |
| `--api-key <key>` | Anthropic API key for converting non-Markdown files (e.g. `.rst`). Falls back to `ANTHROPIC_API_KEY` env var |
| `--yes`, `-y` | Skip confirmation prompts |

### Component mapping

Mintlify, Docusaurus, and GitBook use platform-specific MDX components that don't exist in Thally. The migration tool converts them automatically:

| Source | Thally equivalent |
|--------|---------------|
| `<Tip>` | `` |
| `<Check>` | `` |
| `<Danger>` | `<Error>` |
| `` | `` / `<Warning>` / `<Info>` |
| `:::note ...:::` (Docusaurus) | `` |
| `{% hint style="..." %}` (GitBook) | `` / `<Warning>` |
| `` | stripped (children kept) |
| `<Expandable title="...">` | `` |
| `<ResponseField>` / `<ParamField>` | Markdown property definition |
| `<RequestExample>` / `<ResponseExample>` | `` |
| `<Tile>` | `` |

Files in `.rst` or other formats require an Anthropic API key to convert. Set `ANTHROPIC_API_KEY` in your environment or pass `--api-key`. Plain `.md` and `.mdx` files are migrated for free.

See [Migrate and publish existing documentation](/guides/migrating) for the complete workflow from a live site to a managed Thally Cloud deployment.

---

## create-thally-docs check

Lints a Thally project for common issues and reports errors and warnings.

```bash
npx create-thally-docs check [project-dir]
```

Defaults to the current directory if no path is given.

### What it checks

| Issue | Severity |
|-------|----------|
| Page listed in `docs.json` but no MDX file found | Error |
| Duplicate page ID in `docs.json` | Error |
| Tab with no groups and no `href` | Error |
| MDX file not listed in `docs.json` (orphan) | Warning |
| Missing `title` in frontmatter | Warning |
| Missing `description` in frontmatter | Warning |
| Empty or near-empty page body | Warning |

```bash
# Check the current project
npx create-thally-docs check

# Check a specific directory
npx create-thally-docs check /path/to/my-docs

# Auto-fix orphan files by adding them to the nav
npx create-thally-docs check --fix
```

The CLI exits with code `1` if any errors are found, `0` if the project is clean or only has warnings.

### Options

| Flag | Description |
|------|-------------|
| `--fix` | Auto-add orphan pages to the last group of the first content tab |

---

## create-thally-docs translate

Translates documentation pages to a secondary locale using Claude AI. Requires an `i18n` block in `docs.json`.

```bash
npx create-thally-docs translate --locale es
```

Translated files are written to `src/content/{locale}/` and committed to your repo — no runtime cost, full SSG.

### Examples

```bash
# Translate all pages to Spanish
npx create-thally-docs translate --locale es

# Translate specific pages only
npx create-thally-docs translate --locale fr --pages introduction,guides/getting-started

# Overwrite existing translations
npx create-thally-docs translate --locale es --force

# Pass API key explicitly
npx create-thally-docs translate --locale de --api-key sk-ant-...
```

### Options

| Flag | Description |
|------|-------------|
| `--locale <code>` | Target locale code — required (must be in `docs.json` i18n config) |
| `--pages <ids>` | Comma-separated page IDs to translate (omit for all pages) |
| `--force` | Overwrite existing translation files |
| `--api-key <key>` | Anthropic API key (falls back to `ANTHROPIC_API_KEY` env var) |
| `--model <id>` | Claude model to use (default: `claude-sonnet-4-6`) |
| `--yes`, `-y` | Skip confirmation prompt |

See [Multi-Language Support](/guides/multi-language) for full setup instructions.