CLI CLI Reference stx connect
stx connect
Connect a local docs directory to an existing Syntext project.
Link your local documentation to a Syntext project by writing the projectId into your config file. Use this when you created a project in the dashboard (or with stx projects create) and want your local docs to deploy to it.
Usage
bash
stx connect <projectId> [options]
Arguments
| Argument | Description |
|---|---|
<projectId> | Project ID to connect to — find it with stx projects list |
Options
| Flag | Alias | Type | Default | Description |
|---|---|---|---|---|
--dir <dir> | -d | string | . | Documentation directory |
--json | boolean | false | Output result as JSON |
What It Does
1.
Verifies you have access to the project (requires
stx login first)2.
Locates your config file (
syntext.json, syntext.yaml, stx.json, or stx.yaml)3.
Writes the
projectId field into ittext
✔ Connected to Acme Docs
Project: Acme Docs
ID: 3f2b8c1e-6a4d-4e2b-9c7f-1a2b3c4d5e6f
Docs URL: https://acme-docs-docs.syntext.dev
Config: syntext.json
You can now run:
stx dev — watch & deploy previews
stx deploy — publish to production
Examples
Connect the Current Directory
bash
stx projects list # find your project ID
stx connect 3f2b8c1e-6a4d-4e2b-9c7f-1a2b3c4d5e6f
Connect a Nested Docs Directory
bash
stx connect 3f2b8c1e-6a4d-4e2b-9c7f-1a2b3c4d5e6f --dir ./docs-site
Scripted (JSON Output)
bash
stx connect 3f2b8c1e-6a4d-4e2b-9c7f-1a2b3c4d5e6f --json
json
{ "success": true, "projectId": "3f2b8c1e-6a4d-4e2b-9c7f-1a2b3c4d5e6f", "name": "Acme Docs", "docsUrl": "https://acme-docs-docs.syntext.dev" }
Troubleshooting
| Error | Fix |
|---|---|
Not authenticated. Run `stx login` first. | Run stx login first |
Project <id> not found. | Check the ID with stx projects list |
No access to project <id>. Check your permissions. | Ask an org admin to invite you to the project's organization |
No config file found. | Run stx init to scaffold the project structure first |
Related
•
stx projects — create and list projects
•
stx init — scaffold a new docs project
•
stx deploy — publish to production
Was this page helpful? Yes No
Previous
Next