Use **branches** to work on documentation changes without touching your live docs, and **preview deployments** to share a read-only preview of a Markdown folder before you publish it, for example from a pull request. Both are available in the Theneo CLI (version 0.24.0 or later), the Theneo SDK, and the Theneo API.

Branches must be enabled for your workspace. If they aren't, these commands return "Document review is not enabled for this workspace". Contact hello@theneo.io to enable them.

npm install -g @theneo/cli@latest Preview a Markdown folder ------------------------- `theneo preview` imports a Markdown project folder into a temporary preview branch and returns a read-only link that anyone can open without logging in. Your published docs don't change. theneo preview --project <project-slug> --dir ./docs The command prints the preview page URL, when it expires, and the preview branch's name and ID. The preview branch and its link expire together, after 24 hours by default, and the branch is then removed automatically.

--project <project-slug>

Project to preview against

--dir <directory>

Markdown project folder, in the same layout theneo export produces

--projectVersion <version-slug>

Version to preview against; the default version if omitted

--expiresIn <hours>

Lifetime of the preview in whole hours, 1 to 168 (default 24)

--name <branch-name>

Custom name for the preview branch; generated if omitted

--tab <tab-slug>

Import into one tab only

--workspace <workspace-slug>

Workspace, when the project slug isn't unique

--json

Print the result as JSON: branch, previewUrl, and expiresAt. Useful for posting the link on a pull request from CI

--profile <string>

Use a specific profile from your CLI config file

Happy with the preview? Publish it with `theneo branch publish --branch `, or discard it early with `theneo branch delete --branch `. Manage branches --------------- A standard branch is a named working copy of a project version that you edit in the editor and publish when it's ready. Manage branches from the terminal with `theneo branch`:

theneo branch list --project <project-slug>

Lists open branches with their kind (standard or preview), status, expiry, editor link, and ID. Add --projectVersion to filter by version.

theneo branch create --name <name> --project <project-slug>

Creates a branch from the default version, or from --projectVersion, and prints its editor link.

theneo import --branch <branch-id> --project <project-slug> --dir <directory>

Imports a Markdown folder into an existing branch instead of the base version. Can't be combined with --publish.

theneo branch rebase --branch <branch-id>

Pulls the latest changes from the base version into the branch. Where both changed the same section, the branch version is kept.

theneo branch link --branch <branch-id>

Creates a read-only preview link for the branch, valid for 24 hours by default (--expiresIn, up to 168).

theneo branch publish --branch <branch-id>

Merges the branch into its base version and publishes it. Workspace admins only; other members open a review in the app.

theneo branch delete --branch <branch-id>

Abandons the branch and discards its draft content. Only the branch creator or a workspace admin can do this.

Publishing fails if the branch is behind its base version; run `theneo branch rebase` first. The Theneo SDK exposes the same operations: createPreviewDeployment, listBranches, createBranch, getBranch, rebaseBranch, createBranchPreviewLink, publishBranch, and deleteBranch.