CLI Overview
The stx CLI is your primary interface for working with Syntext documentation. It handles project initialization, local development, building, and deployment.
Installation
curl -fsSL https://get.syntext.dev | sh
brew install syntext-dev/tap/stx
npm install -g @syntext/cli
Verify installation:
stx --version
Quick Reference
| Command | Description |
|---|---|
stx init |
Initialize a new docs project |
stx dev |
Start the development server |
stx build |
Build on the Syntext backend and download the static site |
stx deploy |
Deploy to Syntext CDN |
stx generate |
Generate API docs from OpenAPI/code |
stx check |
Validate configuration and content |
stx login |
Authenticate with Syntext |
stx logout |
Remove stored credentials |
stx connect |
Connect local docs to a Syntext project |
stx projects |
Create, list, and delete projects |
stx migrate |
Migrate from Mintlify, Docusaurus, GitBook, or ReadMe |
Global Flags
All commands support these global flags:
| Flag | Alias | Description |
|---|---|---|
--help |
-h |
Show help for a command |
--version |
-v |
Show CLI version |
--config |
-c |
Path to config file (default: syntext.json) |
--cwd |
Working directory (default: current directory) | |
--verbose |
Enable verbose output | |
--json |
Output as JSON (for scripting) |
Configuration Files
The CLI looks for configuration in these locations (in order):
.syntext/syntext.jsonor.syntext/stx.json.syntext/syntext.yamlor.syntext/stx.yaml.stx/syntext.jsonor.stx/stx.json.stx/syntext.yamlor.stx/stx.yamlsyntext.jsonorstx.json(project root)syntext.yamlorstx.yaml(project root)
The first matching file is used. JSON and YAML formats are functionally equivalent — use whichever you prefer. For monorepos, place configuration in .syntext/ to keep the root clean.
Project Detection
The CLI auto-detects your project layout:
Standalone — Config at repository root:
docs-repo/
├── syntext.json
├── docs/
└── public/
Embedded — Config inside .syntext/ or .stx/:
my-api/
├── src/
├── package.json
└── .syntext/
├── syntext.json
└── docs/
Environment Variables
| Variable | Description |
|---|---|
SYNTEXT_API_KEY |
API key for authenticated operations |
SYNTEXT_PROJECT_ID |
Override project ID |
SYNTEXT_ENV |
Environment: production, staging |
NO_COLOR |
Disable colored output |
Exit Codes
| Code | Meaning |
|---|---|
0 |
Success |
1 |
General error |
2 |
Configuration error |
3 |
Validation error |
4 |
Network error |
5 |
Authentication error |
Command Details
Initialize a new documentation project
Start the development server
Build static site for production
Deploy to Syntext CDN
Generate docs from OpenAPI or code
Validate configuration and content
Authenticate with Syntext
Connect local docs to a project
Manage projects from the terminal
Migrate from another docs platform