CLI
stx init
Initialize a new Syntext documentation project with the recommended folder structure and configuration.
Usage
stx init [options]
Options
| Flag | Alias | Type | Default | Description |
|---|---|---|---|---|
--name |
-n |
string | folder name | Project name |
--create |
boolean | false |
Create project on Syntext and link | |
--template |
-t |
string | default |
Starter template |
--layout |
-l |
string | auto | standalone or embedded |
--skip-git |
boolean | false |
Don't initialize git repository | |
--force |
-f |
boolean | false |
Overwrite existing files |
Examples
Basic Initialization
stx init
Creates a new docs folder with default configuration in the current directory.
Named Project with Remote Link
stx init --name "My API Docs" --create
Creates the project locally and registers it on Syntext for deployment.
Using a Template
stx init --template api
Available templates:
default— Basic documentation siteapi— API reference with OpenAPI integrationsdk— SDK documentation with multi-language exampleslanding— Marketing-focused landing page
Embedded Layout (Inside Existing Repo)
stx init --layout embedded
Creates documentation in .syntext/ folder, keeping your project root clean.
Generated Structure
Standalone Layout
my-docs/
├── syntext.json
├── docs/
│ ├── index.mdx
│ └── guides/
│ └── getting-started.mdx
├── public/
│ └── favicon.ico
└── .gitignore
Embedded Layout
my-project/
├── src/
├── package.json
└── .syntext/
├── syntext.json
├── docs/
│ └── index.mdx
└── public/
Configuration File
The generated syntext.json:
{
"name": "My Docs",
"description": "Documentation for My Docs",
"theme": "default",
"colors": {
"primary": "#6366F1"
},
"navigation": [
{
"group": "Getting Started",
"pages": ["index", "guides/getting-started"]
}
]
}
Interactive Mode
Running stx init without flags starts an interactive wizard:
? Project name: My API Docs
? Description: Documentation for our REST API
? Primary color: #6366F1
? Template: api
? Create on Syntext? Yes
✓ Created syntext.json
✓ Created docs/index.mdx
✓ Created docs/guides/getting-started.mdx
✓ Linked to Syntext project: my-api-docs
Run `stx dev` to start the development server.
Linking to Syntext
If you skip --create during init, link later with:
stx connect
This associates your local project with a Syntext project for deployment.
Use stx init --create for new projects. This ensures deployment works immediately with stx deploy.
Was this page helpful?