# EkLine CLI for documentation reviews

import { Aside, Steps, Tabs, TabItem } from '@astrojs/starlight/components';

The EkLine CLI lets you run documentation checks locally, in CI/CD pipelines, or as part of custom integrations. Store your configuration in a file for team consistency.

## Installation

Download the EkLine binary for your operating system from the [Release Page](https://github.com/ekline-io/ekline-cli-binaries/releases/latest).

<Tabs>
  <TabItem label="macOS">
    ```bash
    # Download and extract
    curl -L https://github.com/ekline-io/ekline-cli-binaries/releases/latest/download/ekline-cli-macos.tar.gz | tar xz

    # Make executable and move to PATH
    chmod +x ekline-cli
    sudo mv ekline-cli /usr/local/bin/
    ```
  </TabItem>
  <TabItem label="Linux">
    ```bash
    # Download and extract
    curl -L https://github.com/ekline-io/ekline-cli-binaries/releases/latest/download/ekline-cli-linux.tar.gz | tar xz

    # Make executable and move to PATH
    chmod +x ekline-cli
    sudo mv ekline-cli /usr/local/bin/
    ```
  </TabItem>
  <TabItem label="Windows">
    Download `ekline-cli-windows.zip` from the [Release Page](https://github.com/ekline-io/ekline-cli-binaries/releases/latest) and add to your PATH.
  </TabItem>
</Tabs>

## Quick start

Run EkLine on your documentation:

```bash
ekline-cli --ek-token YOUR_TOKEN --content-directory ./docs
```

Get your token from the [EkLine Dashboard](https://ekline.io/dashboard).

<Aside type="tip">
Create an [ekline.config.json](#configuration-file) to store shared settings and avoid repeating flags. You still need to pass `--ek-token` on every invocation — for CI/CD, use a pipeline secret.
</Aside>

---

## Configuration file

Instead of passing flags every time, create an `ekline.config.json` file in your project root. This ensures consistent settings across your team.

### Creating the config file

Create `ekline.config.json` in your project root:

```json
{
  "contentDirectory": ["docs"],
  "styleGuide": "google",
  "ignore": ["EK00001"],
  "excludeDirectories": ["node_modules", "dist"]
}
```

Then run:

```bash
ekline-cli --ek-token YOUR_TOKEN
```

EkLine automatically discovers and uses the config file.

### Config file discovery

EkLine searches for `ekline.config.json` starting from your current directory and walking up the directory tree. This supports monorepo setups where the config file lives at the root.

```
my-monorepo/
├── ekline.config.json    ← Found and used
├── packages/
│   └── docs/
│       └── guide.md      ← Running CLI here still finds root config
└── apps/
    └── web/
```

### Configuration precedence

CLI arguments override config file values. This lets you use a shared config while customizing specific runs:

```bash
# Uses config file, but overrides styleGuide for this run
ekline-cli --ek-token YOUR_TOKEN --style-guide microsoft
```

**Order of precedence**, from highest to lowest:
1. CLI arguments
2. `ekline.config.json`
3. Default values

### All config options

| Option | Type | Description |
|--------|------|-------------|
| `contentDirectory` | `string[]` | Directories to scan for documentation files |
| `styleGuide` | `string` | Style guide to enforce: `google`, `microsoft`, or `marketing` |
| `ignore` | `string[]` | Rule IDs to skip (for example, `["EK00001", "EK00004"]`) |
| `excludeDirectories` | `string[]` | Directories to exclude from scanning |
| `excludeFiles` | `string[]` | Specific files to exclude |
| `output` | `string` | Output path (`.jsonl` or `.csv`) |
| `framework` | `string` | Documentation framework: `mintlify`, `astro`, `fern`, `docusaurus`, or `gitbook` |
| `openapiSpec` | `string` | Path to OpenAPI spec for API terminology validation |
| `changedFiles` | `string[]` | Only check specific files (useful in CI) |
| `changedLines` | `string` | Path to JSON file containing changed files and their line numbers |
| `aiSuggestions` | `boolean` | Enable AI-powered documentation suggestions (default: `false`) |
| `suggestion` | `boolean` | Enable suggestions in output (default: `true`) |

### Example configurations

**Minimal config:**
```json
{
  "contentDirectory": ["docs"]
}
```

**Mintlify project:**
```json
{
  "contentDirectory": ["."],
  "framework": "mintlify",
  "excludeDirectories": ["node_modules", "api-reference"],
  "styleGuide": "google"
}
```

**Monorepo with many doc sources:**
```json
{
  "contentDirectory": ["docs", "packages/sdk/docs", "guides"],
  "excludeFiles": ["CHANGELOG.md"],
  "ignore": ["EK00042"]
}
```

**Full configuration:**
```json
{
  "contentDirectory": ["docs"],
  "framework": "astro",
  "styleGuide": "microsoft",
  "ignore": ["EK00001", "EK00004"],
  "excludeDirectories": ["node_modules", "dist", ".astro"],
  "excludeFiles": ["README.md"],
  "output": "ekline-report.jsonl",
  "aiSuggestions": true
}
```

**CI/CD optimized config:**
```json
{
  "contentDirectory": ["docs"],
  "output": "results.jsonl",
  "changedLines": "git-diff-output.json",
  "suggestion": true
}
```

<Aside type="caution">
Never store your `ekToken` in the config file. Always pass it via the `--ek-token` flag. For CI/CD, use your platform's secret management.
</Aside>

---

## Framework support

If you use a documentation framework like Mintlify, Docusaurus, or Astro, set the `framework` option to improve MDX file analysis.

### Why this matters

Documentation frameworks use custom MDX components such as `<Note>`, `<Card>`, and `<Tabs>` that contain prose. Without framework awareness, EkLine might skip content inside these components.

**Without `framework` set:**
```mdx
<Note>
  This text mite not be checked for spelling errors.
</Note>
```
The spelling error "mite" could be missed because EkLine doesn't know `<Note>` has prose.

**With `framework: "mintlify"`:**
EkLine recognizes that `<Note>` is a prose component and checks the content inside, catching the "mite" → "might" error.

### Supported frameworks

| Framework | Value |
|-----------|-------|
| [Mintlify](https://mintlify.com) | `mintlify` |
| [Astro](https://astro.build) | `astro` |
| [Fern](https://buildwithfern.com) | `fern` |
| [Docusaurus](https://docusaurus.io) | `docusaurus` |
| [GitBook](https://gitbook.com) | `gitbook` |

<Aside type="note">
Mintlify has the most comprehensive component support. EkLine detects prose inside Mintlify components like Note, Card, Accordion, Update, Tip, Warning, and more. Support for other frameworks is expanding.
</Aside>

### Configuring framework support

**Via config file, recommended:**
```json
{
  "contentDirectory": ["."],
  "framework": "mintlify"
}
```

**Via CLI flag:**
```bash
ekline-cli --ek-token YOUR_TOKEN --framework mintlify
```

For detailed framework setup guides, see [Framework Support](/reviewer/configuration/framework-support/).

---

## CLI options reference

### Commonly used options

| Option | Short | Description |
|--------|-------|-------------|
| `--ek-token <token>` | `-et` | Your EkLine integration token (required) |
| `--content-directory <paths>` | `-cd` | Directories to scan (space-separated) |
| `--style-guide <guide>` | `-sg` | Style guide: `google`, `microsoft`, `marketing` |
| `--ignore <rules>` | `-i` | Rule IDs to ignore (comma-separated) |
| `--output <file>` | `-o` | Output file (`.jsonl` or `.csv`) |
| `--framework <name>` | `-fw` | Documentation framework |

### All options

| Option | Short | Description | Default |
|--------|-------|-------------|---------|
| `--ek-token <token>` | `-et` | EkLine integration token | — |
| `--content-directory <paths>` | `-cd` | Directories to scan | `.` |
| `--style-guide <guide>` | `-sg` | Style guide to enforce | — |
| `--ignore <rules>` | `-i` | Rule IDs to skip | — |
| `--exclude-directories <dirs>` | `-ed` | Directories to exclude | — |
| `--exclude-files <files>` | `-ef` | Files to exclude | — |
| `--output <file>` | `-o` | Output path (`.jsonl`, `.csv`, or terminal) | Terminal |
| `--framework <name>` | `-fw` | Documentation framework | — |
| `--openapi-spec <path>` | `-oas` | OpenAPI spec for terminology | — |
| `--changed-files <files>` | `-cf` | Only check these files | — |
| `--changed-lines <path>` | — | Path to JSON file with changed lines | — |
| `--ai-suggestions` | — | Enable AI-powered suggestions | `false` |
| `--no-suggestion` | `-ns` | Disable suggestions in output | — |
| `--version` | `-v` | Show version | — |
| `--help` | `-h` | Show help | — |

---

## Examples

### Basic usage

```bash
# Check docs folder with Google style guide
ekline-cli --ek-token YOUR_TOKEN -cd ./docs --style-guide google
```

### Ignore specific rules

```bash
# Skip passive voice and sentence length rules
ekline-cli --ek-token YOUR_TOKEN -cd ./docs -i EK00001,EK00004
```

### Export results to file

```bash
# JSON Lines format (recommended for CI)
ekline-cli --ek-token YOUR_TOKEN -cd ./docs -o results.jsonl

# CSV format
ekline-cli --ek-token YOUR_TOKEN -cd ./docs -o results.csv
```

### Mintlify project

```bash
ekline-cli --ek-token YOUR_TOKEN -cd . --framework mintlify --exclude-directories api-reference
```

### CI/CD integration

```bash
# Only check changed files (for PR workflows)
ekline-cli --ek-token YOUR_TOKEN --changed-files docs/guide.md docs/api.md
```

### AI-powered analysis

```bash
# Get AI suggestions in JSON Lines format
ekline-cli --ek-token YOUR_TOKEN -cd ./docs --ai-suggestions -o report.jsonl
```

### Incremental CI checks

```bash
# Check only specific lines that changed (for large repos)
ekline-cli --ek-token YOUR_TOKEN --changed-lines git-diff-changes.json
```

---

## Obtaining your token

1. Go to **Settings > Organization > Access** in the [EkLine Dashboard](https://ekline.io/dashboard).
2. Copy the token.

<Aside type="tip">
For CI/CD, store your token as a secret environment variable:
- GitHub Actions: `${{ secrets.EK_TOKEN }}`
- GitLab CI: `$EK_TOKEN` from CI/CD variables
- Bitbucket: `$EK_TOKEN` from repository variables
</Aside>

---

## Troubleshooting

### "Token required" error
Ensure you're passing `--ek-token` with a valid token. You must include this flag for every CLI invocation.

### Config file not found
EkLine looks for `ekline.config.json` in the current directory and parent directories. Verify the file exists and is valid JSON.

### Framework components not being checked
Make sure you've set the correct `framework` option. Verify your `ekline.config.json` has the right framework value.

### Issues in MDX files not detected
If you're using a documentation framework, set the `framework` option to enable proper MDX parsing. See [Framework Support](/reviewer/configuration/framework-support).

---

## Next steps

- [Ignoring Rules](/reviewer/configuration/ignoring-rules/) — Handle false positives with inline comments or config
- [Framework Support](/reviewer/configuration/framework-support/) — Detailed setup for Mintlify, Astro, Fern, and more
- [GitHub Actions Integration](/reviewer/integrations/github-integration/) — Automate checks on every PR
- [VS Code Extension](/reviewer/integrations/vscode-integration) — Real-time feedback while writing