@cleocode/cleo 2026.3.4 → 2026.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +2277 -609
- package/dist/cli/index.js.map +4 -4
- package/dist/mcp/index.js +1838 -443
- package/dist/mcp/index.js.map +4 -4
- package/package.json +1 -1
- package/packages/ct-skills/index.js +1 -1
- package/packages/ct-skills/package.json +0 -2
- package/packages/ct-skills/profiles/core.json +1 -1
- package/packages/ct-skills/profiles/full.json +4 -5
- package/packages/ct-skills/profiles/minimal.json +3 -3
- package/packages/ct-skills/profiles/recommended.json +2 -2
- package/packages/ct-skills/provider-skills-map.json +97 -0
- package/packages/ct-skills/skills/_shared/skill-chaining-patterns.md +23 -26
- package/packages/ct-skills/skills/_shared/testing-framework-config.md +9 -9
- package/packages/ct-skills/skills/ct-cleo/SKILL.md +21 -1
- package/packages/ct-skills/skills/ct-dev-workflow/SKILL.md +1 -1
- package/packages/ct-skills/skills/ct-documentor/SKILL.md +1 -1
- package/packages/ct-skills/skills/ct-epic-architect/SKILL.md +1 -1
- package/packages/ct-skills/skills/ct-orchestrator/SKILL.md +119 -43
- package/packages/ct-skills/skills/ct-orchestrator/orchestrator-prompt.txt +17 -0
- package/packages/ct-skills/skills/ct-orchestrator/references/orchestrator-patterns.md +1 -1
- package/packages/ct-skills/skills/ct-research-agent/SKILL.md +1 -1
- package/packages/ct-skills/skills/ct-spec-writer/SKILL.md +1 -1
- package/packages/ct-skills/skills/ct-task-executor/SKILL.md +1 -1
- package/packages/ct-skills/skills/ct-validator/SKILL.md +1 -1
- package/packages/ct-skills/skills/manifest.json +217 -947
- package/packages/ct-skills/skills.json +244 -3
- package/server.json +4 -4
- package/templates/CLEO-INJECTION.md +24 -0
- package/packages/ct-skills/protocols/agent-protocol.md +0 -260
- package/packages/ct-skills/protocols/artifact-publish.md +0 -587
- package/packages/ct-skills/protocols/consensus.md +0 -309
- package/packages/ct-skills/protocols/contribution.md +0 -375
- package/packages/ct-skills/protocols/decomposition.md +0 -352
- package/packages/ct-skills/protocols/implementation.md +0 -344
- package/packages/ct-skills/protocols/provenance.md +0 -600
- package/packages/ct-skills/protocols/release.md +0 -635
- package/packages/ct-skills/protocols/research.md +0 -248
- package/packages/ct-skills/protocols/specification.md +0 -287
- package/packages/ct-skills/protocols/testing.md +0 -346
- package/packages/ct-skills/protocols/validation.md +0 -229
- package/packages/ct-skills/skills/ct-gitbook/SKILL.md +0 -516
- package/packages/ct-skills/skills/ct-gitbook/assets/SUMMARY.md +0 -28
- package/packages/ct-skills/skills/ct-gitbook/assets/gitbook.yaml +0 -14
- package/packages/ct-skills/skills/ct-gitbook/references/api-sdk.md +0 -318
- package/packages/ct-skills/skills/ct-gitbook/references/auth-sso.md +0 -208
- package/packages/ct-skills/skills/ct-gitbook/references/change-requests.md +0 -169
- package/packages/ct-skills/skills/ct-gitbook/references/content-blocks.md +0 -230
- package/packages/ct-skills/skills/ct-gitbook/references/docs-sites.md +0 -202
- package/packages/ct-skills/skills/ct-gitbook/references/git-sync.md +0 -175
- package/packages/ct-skills/skills/ct-gitbook/references/llm-ready.md +0 -178
- package/packages/ct-skills/skills/ct-gitbook/references/migration.md +0 -263
- package/packages/ct-skills/skills/ct-library-implementer-bash/SKILL.md +0 -316
- package/packages/ct-skills/skills/ct-skill-lookup/SKILL.md +0 -179
- package/packages/ct-skills/skills/ct-test-writer-bats/SKILL.md +0 -347
- package/packages/ct-skills/skills/railway-platform/SKILL.md +0 -506
- package/packages/ct-skills/skills/railway-platform/_shared/scripts/railway-api.sh +0 -180
- package/packages/ct-skills/skills/railway-platform/_shared/scripts/railway-common.sh +0 -262
- package/packages/ct-skills/skills/railway-platform/references/01-getting-started.md +0 -149
- package/packages/ct-skills/skills/railway-platform/references/02-projects.md +0 -116
- package/packages/ct-skills/skills/railway-platform/references/03-services.md +0 -147
- package/packages/ct-skills/skills/railway-platform/references/04-deployments.md +0 -210
- package/packages/ct-skills/skills/railway-platform/references/05-databases.md +0 -142
- package/packages/ct-skills/skills/railway-platform/references/06-environments.md +0 -261
- package/packages/ct-skills/skills/railway-platform/references/07-domains.md +0 -139
- package/packages/ct-skills/skills/railway-platform/references/08-volumes.md +0 -533
- package/packages/ct-skills/skills/railway-platform/references/09-networking.md +0 -592
- package/packages/ct-skills/skills/railway-platform/references/10-cron.md +0 -488
- package/packages/ct-skills/skills/railway-platform/references/11-functions.md +0 -170
- package/packages/ct-skills/skills/railway-platform/references/12-monorepo.md +0 -294
- package/packages/ct-skills/skills/railway-platform/references/13-troubleshooting.md +0 -335
- package/packages/ct-skills/skills/railway-platform/references/14-railway-metal.md +0 -197
|
@@ -1,516 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: ct-gitbook
|
|
3
|
-
description: >-
|
|
4
|
-
Comprehensive guide for the modern GitBook platform including Docs Sites
|
|
5
|
-
publishing, @gitbook/api TypeScript SDK, Git Sync with GitHub App, Change
|
|
6
|
-
Requests, Site Sections, adaptive content, visitor authentication
|
|
7
|
-
(Auth0/Okta/Azure AD), LLM-ready docs (llms.txt, MCP server), OpenAPI
|
|
8
|
-
integration, content blocks, custom domains, SSO/SAML, SEO optimization,
|
|
9
|
-
and migration from MkDocs/Docusaurus. Use when creating, managing, or
|
|
10
|
-
automating GitBook documentation sites, configuring Git Sync, working
|
|
11
|
-
with the GitBook API, setting up authentication, or migrating
|
|
12
|
-
documentation to GitBook.
|
|
13
|
-
version: 1.0.0
|
|
14
|
-
tier: 3
|
|
15
|
-
core: false
|
|
16
|
-
category: meta
|
|
17
|
-
protocol: null
|
|
18
|
-
dependencies: []
|
|
19
|
-
sharedResources: []
|
|
20
|
-
compatibility:
|
|
21
|
-
- claude-code
|
|
22
|
-
- cursor
|
|
23
|
-
- windsurf
|
|
24
|
-
- gemini-cli
|
|
25
|
-
license: MIT
|
|
26
|
-
---
|
|
27
|
-
|
|
28
|
-
# GitBook Platform Guide
|
|
29
|
-
|
|
30
|
-
GitBook is an AI-native documentation platform for publishing, managing, and automating documentation through Docs Sites, a TypeScript SDK, Git Sync, Change Requests, and LLM-ready output.
|
|
31
|
-
|
|
32
|
-
## Platform Overview
|
|
33
|
-
|
|
34
|
-
GitBook organizes documentation into **Spaces** (content containers), published through **Docs Sites** (public-facing sites). Spaces contain pages authored in a block-based editor or synced from Git. Docs Sites support **Site Sections** for multi-product navigation, **content variants** for versioning, **adaptive content** for personalization, and **visitor authentication** for access control.
|
|
35
|
-
|
|
36
|
-
Key platform capabilities:
|
|
37
|
-
- **Docs Sites** — Publish spaces with custom domains, sections, and SEO
|
|
38
|
-
- **Git Sync** — Bidirectional sync with GitHub/GitLab via the GitHub App
|
|
39
|
-
- **@gitbook/api SDK** — TypeScript client for all API operations
|
|
40
|
-
- **Change Requests** — Branch-and-merge editing workflow with review
|
|
41
|
-
- **Adaptive Content** — Personalize docs based on visitor claims
|
|
42
|
-
- **LLM-Ready** — Auto-generated `llms.txt`, `.md` endpoints, MCP server
|
|
43
|
-
- **Visitor Auth** — Protect docs via Auth0, Okta, Azure AD, or OIDC
|
|
44
|
-
|
|
45
|
-
> For deep-dive content on each topic, see the [Reference Index](#reference-index) at the bottom.
|
|
46
|
-
|
|
47
|
-
## Quick Start
|
|
48
|
-
|
|
49
|
-
### 1. Install the SDK
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
npm install @gitbook/api
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
### 2. Initialize the Client
|
|
56
|
-
|
|
57
|
-
```typescript
|
|
58
|
-
import { GitBookAPI } from '@gitbook/api';
|
|
59
|
-
|
|
60
|
-
const client = new GitBookAPI({ authToken: process.env.GITBOOK_API_TOKEN });
|
|
61
|
-
|
|
62
|
-
// Verify authentication
|
|
63
|
-
const user = await client.user.getCurrentUser();
|
|
64
|
-
console.log(`Authenticated as: ${user.data.displayName}`);
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
### 3. Create a Space
|
|
68
|
-
|
|
69
|
-
```typescript
|
|
70
|
-
const org = await client.orgs.listOrganizationsForAuthenticatedUser();
|
|
71
|
-
const orgId = org.data.items[0].id;
|
|
72
|
-
|
|
73
|
-
const space = await client.orgs.createSpace(orgId, {
|
|
74
|
-
title: 'API Documentation',
|
|
75
|
-
visibility: 'public',
|
|
76
|
-
});
|
|
77
|
-
console.log(`Space created: ${space.data.id}`);
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
### 4. Publish a Docs Site
|
|
81
|
-
|
|
82
|
-
```typescript
|
|
83
|
-
const site = await client.orgs.createSite(orgId, {
|
|
84
|
-
title: 'Developer Docs',
|
|
85
|
-
});
|
|
86
|
-
// Link the space as the site's primary content
|
|
87
|
-
await client.sites.addSiteSection(site.data.id, {
|
|
88
|
-
spaceId: space.data.id,
|
|
89
|
-
title: 'API Reference',
|
|
90
|
-
});
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
> Full SDK reference: `references/api-sdk.md`
|
|
94
|
-
|
|
95
|
-
## Git Sync Configuration
|
|
96
|
-
|
|
97
|
-
Git Sync provides bidirectional synchronization between a GitHub/GitLab repository and a GitBook space. Content authored in either location stays in sync.
|
|
98
|
-
|
|
99
|
-
### Setup
|
|
100
|
-
|
|
101
|
-
1. Install the **GitBook GitHub App** from your space's integrations
|
|
102
|
-
2. Select the repository and branch to sync
|
|
103
|
-
3. Optionally add `.gitbook.yaml` for structure configuration
|
|
104
|
-
|
|
105
|
-
### .gitbook.yaml
|
|
106
|
-
|
|
107
|
-
```yaml
|
|
108
|
-
root: ./docs/
|
|
109
|
-
|
|
110
|
-
structure:
|
|
111
|
-
readme: README.md
|
|
112
|
-
summary: SUMMARY.md
|
|
113
|
-
|
|
114
|
-
redirects:
|
|
115
|
-
old-page: new-page.md
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
### SUMMARY.md
|
|
119
|
-
|
|
120
|
-
Controls the page hierarchy in GitBook:
|
|
121
|
-
|
|
122
|
-
```markdown
|
|
123
|
-
# Summary
|
|
124
|
-
|
|
125
|
-
## Getting Started
|
|
126
|
-
* [Introduction](README.md)
|
|
127
|
-
* [Installation](getting-started/installation.md)
|
|
128
|
-
|
|
129
|
-
## Guides
|
|
130
|
-
* [Basic Usage](guides/basic.md)
|
|
131
|
-
* [Advanced](guides/advanced/README.md)
|
|
132
|
-
* [Plugins](guides/advanced/plugins.md)
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
### Sync Behavior
|
|
136
|
-
|
|
137
|
-
- **GitHub to GitBook**: Push to the synced branch triggers content import
|
|
138
|
-
- **GitBook to GitHub**: Edits in the GitBook editor create commits on the branch
|
|
139
|
-
- **Conflicts**: GitBook shows a conflict resolution UI; prefer one direction
|
|
140
|
-
- Mono-repo support: use `root` in `.gitbook.yaml` to scope to a subdirectory
|
|
141
|
-
|
|
142
|
-
> Full details: `references/git-sync.md`
|
|
143
|
-
|
|
144
|
-
## Docs Sites and Publishing
|
|
145
|
-
|
|
146
|
-
A **Docs Site** is the published, public-facing version of your documentation. Each site has its own URL, custom domain, and navigation structure.
|
|
147
|
-
|
|
148
|
-
### Site Sections
|
|
149
|
-
|
|
150
|
-
Site Sections let you combine multiple spaces into a single site with tab-based navigation. Each section maps to one space.
|
|
151
|
-
|
|
152
|
-
```typescript
|
|
153
|
-
// Add sections to a site
|
|
154
|
-
await client.sites.addSiteSection(siteId, {
|
|
155
|
-
spaceId: apiDocsSpaceId,
|
|
156
|
-
title: 'API Reference',
|
|
157
|
-
});
|
|
158
|
-
await client.sites.addSiteSection(siteId, {
|
|
159
|
-
spaceId: guidesSpaceId,
|
|
160
|
-
title: 'Guides',
|
|
161
|
-
});
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
Sections support **nested groups** — group related sections under a dropdown heading.
|
|
165
|
-
|
|
166
|
-
### Custom Domains
|
|
167
|
-
|
|
168
|
-
```typescript
|
|
169
|
-
await client.sites.updateSiteCustomization(siteId, {
|
|
170
|
-
hostname: 'docs.example.com',
|
|
171
|
-
});
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
Configure DNS: add a CNAME record pointing `docs.example.com` to `hosting.gitbook.io`.
|
|
175
|
-
|
|
176
|
-
### Content Variants
|
|
177
|
-
|
|
178
|
-
Variants let you maintain multiple versions of documentation within a single space (e.g., v1, v2, latest).
|
|
179
|
-
|
|
180
|
-
```typescript
|
|
181
|
-
await client.spaces.createVariant(spaceId, { title: 'v2.0', slug: 'v2' });
|
|
182
|
-
await client.spaces.setDefaultVariant(spaceId, variantId);
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
> Full details: `references/docs-sites.md`
|
|
186
|
-
|
|
187
|
-
## Content Authoring
|
|
188
|
-
|
|
189
|
-
GitBook's editor supports rich content blocks beyond plain Markdown.
|
|
190
|
-
|
|
191
|
-
### Supported Block Types
|
|
192
|
-
|
|
193
|
-
| Block | Description |
|
|
194
|
-
|-------|-------------|
|
|
195
|
-
| Code blocks | Syntax-highlighted with language tabs |
|
|
196
|
-
| Hints | Info, warning, success, danger callouts |
|
|
197
|
-
| Tabs | Tabbed content sections |
|
|
198
|
-
| Expandables | Collapsible sections |
|
|
199
|
-
| Cards | Link cards with images |
|
|
200
|
-
| Embedded URLs | Auto-expanding embeds (YouTube, Figma, etc.) |
|
|
201
|
-
| OpenAPI | Render API reference from spec files |
|
|
202
|
-
| Drawings | Diagrams authored in the editor |
|
|
203
|
-
| Math | LaTeX math blocks and inline equations |
|
|
204
|
-
| Files | Attached file downloads |
|
|
205
|
-
|
|
206
|
-
### OpenAPI Integration
|
|
207
|
-
|
|
208
|
-
Upload or link an OpenAPI spec to auto-generate interactive API reference pages:
|
|
209
|
-
|
|
210
|
-
```yaml
|
|
211
|
-
# In your Git-synced repo, reference a spec file:
|
|
212
|
-
# GitBook detects .yaml/.json OpenAPI files and renders them
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
Or paste an OpenAPI spec URL in the editor — GitBook renders endpoints with try-it-out functionality.
|
|
216
|
-
|
|
217
|
-
### Markdown in Git Sync
|
|
218
|
-
|
|
219
|
-
When syncing from Git, GitBook supports standard Markdown plus extensions:
|
|
220
|
-
- `{% hint style="info" %}` blocks for callouts
|
|
221
|
-
- `{% tabs %}` / `{% tab %}` for tabbed content
|
|
222
|
-
- `{% embed url="..." %}` for embeds
|
|
223
|
-
- `{% swagger src="./openapi.yaml" %}` for API specs
|
|
224
|
-
|
|
225
|
-
> Full details: `references/content-blocks.md`
|
|
226
|
-
|
|
227
|
-
## Change Requests
|
|
228
|
-
|
|
229
|
-
Change Requests provide a branch-and-merge workflow for documentation, analogous to pull requests in Git.
|
|
230
|
-
|
|
231
|
-
### Workflow
|
|
232
|
-
|
|
233
|
-
1. **Create** a change request from the space sidebar
|
|
234
|
-
2. **Edit** content in the isolated branch — no impact on live docs
|
|
235
|
-
3. **Request review** from team members or the Docs Agent (AI reviewer)
|
|
236
|
-
4. **Merge** to publish changes to the live site
|
|
237
|
-
|
|
238
|
-
### API Usage
|
|
239
|
-
|
|
240
|
-
```typescript
|
|
241
|
-
// Create a change request
|
|
242
|
-
const cr = await client.spaces.createChangeRequest(spaceId, {
|
|
243
|
-
subject: 'Update API authentication guide',
|
|
244
|
-
});
|
|
245
|
-
|
|
246
|
-
// Merge when ready
|
|
247
|
-
await client.spaces.mergeChangeRequest(spaceId, cr.data.id);
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
### Review Features
|
|
251
|
-
|
|
252
|
-
- Tag specific reviewers for notification
|
|
253
|
-
- Reviews marked as outdated when new changes are pushed
|
|
254
|
-
- Re-request review with a single action
|
|
255
|
-
- Filter change requests by creator, participant, or status
|
|
256
|
-
|
|
257
|
-
> Full details: `references/change-requests.md`
|
|
258
|
-
|
|
259
|
-
## Authentication and Access Control
|
|
260
|
-
|
|
261
|
-
### Visitor Authentication
|
|
262
|
-
|
|
263
|
-
Protect published docs behind a login screen. Supported providers:
|
|
264
|
-
|
|
265
|
-
| Provider | Integration |
|
|
266
|
-
|----------|-------------|
|
|
267
|
-
| Auth0 | Native GitBook integration |
|
|
268
|
-
| Okta | Native GitBook integration |
|
|
269
|
-
| Azure AD | Native GitBook integration |
|
|
270
|
-
| AWS Cognito | Native GitBook integration |
|
|
271
|
-
| Custom OIDC | Build your own backend |
|
|
272
|
-
|
|
273
|
-
Enable in site settings under **Audience > Authenticated access**.
|
|
274
|
-
|
|
275
|
-
### SSO & SAML
|
|
276
|
-
|
|
277
|
-
For organization member authentication (not visitor auth):
|
|
278
|
-
- SSO via authorized email domain
|
|
279
|
-
- SAML 2.0 with any compliant IdP
|
|
280
|
-
- SOC 2 and ISO 27001 certified
|
|
281
|
-
|
|
282
|
-
### Adaptive Content with Auth
|
|
283
|
-
|
|
284
|
-
When visitor authentication is enabled, you can pass **claims** (role, plan, region) from your IdP to personalize content per visitor. See the Adaptive Content section in `references/auth-sso.md`.
|
|
285
|
-
|
|
286
|
-
> Full details: `references/auth-sso.md`
|
|
287
|
-
|
|
288
|
-
## LLM-Ready Documentation
|
|
289
|
-
|
|
290
|
-
GitBook automatically generates LLM-optimized outputs for every published site.
|
|
291
|
-
|
|
292
|
-
### llms.txt
|
|
293
|
-
|
|
294
|
-
Append `/llms.txt` to any docs site URL to get a plain-text index:
|
|
295
|
-
|
|
296
|
-
```
|
|
297
|
-
https://docs.example.com/llms.txt # Index with page links
|
|
298
|
-
https://docs.example.com/llms-full.txt # Full content in one file
|
|
299
|
-
```
|
|
300
|
-
|
|
301
|
-
### Markdown Endpoints
|
|
302
|
-
|
|
303
|
-
Append `.md` to any page URL to get raw Markdown — ideal for LLM ingestion:
|
|
304
|
-
|
|
305
|
-
```
|
|
306
|
-
https://docs.example.com/getting-started.md
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
### MCP Server
|
|
310
|
-
|
|
311
|
-
Every published space exposes a Model Context Protocol server:
|
|
312
|
-
|
|
313
|
-
```
|
|
314
|
-
https://docs.example.com/~gitbook/mcp
|
|
315
|
-
```
|
|
316
|
-
|
|
317
|
-
Configure in your agent's MCP settings to give it structured access to your docs.
|
|
318
|
-
|
|
319
|
-
### SEO
|
|
320
|
-
|
|
321
|
-
GitBook generates sitemaps, Open Graph meta tags, and structured data automatically. Custom meta descriptions can be set per page.
|
|
322
|
-
|
|
323
|
-
> Full details: `references/llm-ready.md`
|
|
324
|
-
|
|
325
|
-
## API Operations Quick Reference
|
|
326
|
-
|
|
327
|
-
### Organizations
|
|
328
|
-
|
|
329
|
-
```typescript
|
|
330
|
-
// List orgs
|
|
331
|
-
const orgs = await client.orgs.listOrganizationsForAuthenticatedUser();
|
|
332
|
-
|
|
333
|
-
// Get org details
|
|
334
|
-
const org = await client.orgs.getOrganizationById(orgId);
|
|
335
|
-
|
|
336
|
-
// List members
|
|
337
|
-
const members = await client.orgs.listMembersInOrganization(orgId);
|
|
338
|
-
|
|
339
|
-
// Invite member
|
|
340
|
-
await client.orgs.inviteMembersToOrganization(orgId, {
|
|
341
|
-
emails: ['user@example.com'],
|
|
342
|
-
role: 'editor',
|
|
343
|
-
});
|
|
344
|
-
```
|
|
345
|
-
|
|
346
|
-
### Spaces
|
|
347
|
-
|
|
348
|
-
```typescript
|
|
349
|
-
// List spaces
|
|
350
|
-
const spaces = await client.orgs.listSpacesInOrganization(orgId);
|
|
351
|
-
|
|
352
|
-
// Get space
|
|
353
|
-
const space = await client.spaces.getSpaceById(spaceId);
|
|
354
|
-
|
|
355
|
-
// Update space
|
|
356
|
-
await client.spaces.updateSpace(spaceId, { title: 'New Title' });
|
|
357
|
-
|
|
358
|
-
// Delete space
|
|
359
|
-
await client.spaces.deleteSpace(spaceId);
|
|
360
|
-
```
|
|
361
|
-
|
|
362
|
-
### Content
|
|
363
|
-
|
|
364
|
-
```typescript
|
|
365
|
-
// Get page tree
|
|
366
|
-
const content = await client.spaces.listPagesInSpace(spaceId);
|
|
367
|
-
|
|
368
|
-
// Search
|
|
369
|
-
const results = await client.spaces.searchSpaceContent(spaceId, {
|
|
370
|
-
query: 'authentication',
|
|
371
|
-
});
|
|
372
|
-
|
|
373
|
-
// Import from Git
|
|
374
|
-
await client.spaces.importContentInSpace(spaceId, {
|
|
375
|
-
source: { type: 'github', url: 'https://github.com/org/repo' },
|
|
376
|
-
});
|
|
377
|
-
```
|
|
378
|
-
|
|
379
|
-
### Docs Sites
|
|
380
|
-
|
|
381
|
-
```typescript
|
|
382
|
-
// Create site
|
|
383
|
-
const site = await client.orgs.createSite(orgId, { title: 'Docs' });
|
|
384
|
-
|
|
385
|
-
// List sites
|
|
386
|
-
const sites = await client.orgs.listSitesInOrganization(orgId);
|
|
387
|
-
|
|
388
|
-
// Update customization
|
|
389
|
-
await client.sites.updateSiteCustomization(siteId, {
|
|
390
|
-
styling: { primaryColor: '#0066FF' },
|
|
391
|
-
themes: { default: 'light', toggleable: true },
|
|
392
|
-
});
|
|
393
|
-
```
|
|
394
|
-
|
|
395
|
-
> Full SDK reference: `references/api-sdk.md`
|
|
396
|
-
|
|
397
|
-
## CI/CD Integration Patterns
|
|
398
|
-
|
|
399
|
-
### GitHub Actions — Validate Docs Structure
|
|
400
|
-
|
|
401
|
-
```yaml
|
|
402
|
-
name: Validate Docs
|
|
403
|
-
on:
|
|
404
|
-
pull_request:
|
|
405
|
-
paths: ['docs/**']
|
|
406
|
-
|
|
407
|
-
jobs:
|
|
408
|
-
validate:
|
|
409
|
-
runs-on: ubuntu-latest
|
|
410
|
-
steps:
|
|
411
|
-
- uses: actions/checkout@v4
|
|
412
|
-
- name: Check SUMMARY.md links
|
|
413
|
-
run: |
|
|
414
|
-
while IFS= read -r link; do
|
|
415
|
-
if [ ! -f "docs/$link" ]; then
|
|
416
|
-
echo "Broken link: $link"
|
|
417
|
-
exit 1
|
|
418
|
-
fi
|
|
419
|
-
done < <(grep -oP '\[.*?\]\(\K[^)]+' docs/SUMMARY.md)
|
|
420
|
-
echo "All links valid"
|
|
421
|
-
```
|
|
422
|
-
|
|
423
|
-
### GitHub Actions — Trigger Sync
|
|
424
|
-
|
|
425
|
-
```yaml
|
|
426
|
-
name: Sync to GitBook
|
|
427
|
-
on:
|
|
428
|
-
push:
|
|
429
|
-
branches: [main]
|
|
430
|
-
paths: ['docs/**']
|
|
431
|
-
|
|
432
|
-
jobs:
|
|
433
|
-
sync:
|
|
434
|
-
runs-on: ubuntu-latest
|
|
435
|
-
steps:
|
|
436
|
-
- uses: actions/checkout@v4
|
|
437
|
-
- run: echo "GitBook auto-syncs via GitHub App — no manual trigger needed"
|
|
438
|
-
# The GitBook GitHub App handles sync automatically.
|
|
439
|
-
# This workflow is for additional validation only.
|
|
440
|
-
```
|
|
441
|
-
|
|
442
|
-
### Pre-commit Hook
|
|
443
|
-
|
|
444
|
-
```bash
|
|
445
|
-
#!/usr/bin/env bash
|
|
446
|
-
# .git/hooks/pre-commit — validate docs before commit
|
|
447
|
-
if git diff --cached --name-only | grep -q '^docs/'; then
|
|
448
|
-
if [ -f docs/SUMMARY.md ]; then
|
|
449
|
-
grep -oP '\[.*?\]\(\K[^)]+' docs/SUMMARY.md | while read -r link; do
|
|
450
|
-
[ -f "docs/$link" ] || { echo "Broken: $link"; exit 1; }
|
|
451
|
-
done
|
|
452
|
-
fi
|
|
453
|
-
fi
|
|
454
|
-
```
|
|
455
|
-
|
|
456
|
-
## Migration
|
|
457
|
-
|
|
458
|
-
### From MkDocs
|
|
459
|
-
|
|
460
|
-
1. Copy `docs/` directory contents to your GitBook repo
|
|
461
|
-
2. Convert `mkdocs.yml` nav to `SUMMARY.md` format
|
|
462
|
-
3. Add `.gitbook.yaml` with `root: ./`
|
|
463
|
-
4. Replace `!!! note` admonitions with `{% hint style="info" %}` blocks
|
|
464
|
-
5. Connect via Git Sync
|
|
465
|
-
|
|
466
|
-
### From Docusaurus
|
|
467
|
-
|
|
468
|
-
1. Copy `docs/` directory to your GitBook repo
|
|
469
|
-
2. Convert `sidebars.js` structure to `SUMMARY.md`
|
|
470
|
-
3. Strip MDX components — replace with GitBook equivalents
|
|
471
|
-
4. Replace `import` statements with standard Markdown
|
|
472
|
-
5. Convert frontmatter `sidebar_position` to SUMMARY.md ordering
|
|
473
|
-
|
|
474
|
-
### From Legacy GitBook (v1/v2)
|
|
475
|
-
|
|
476
|
-
1. Export content from the legacy instance
|
|
477
|
-
2. Structure matches — `SUMMARY.md` format is unchanged
|
|
478
|
-
3. Update `.gitbook.yaml` for any root path changes
|
|
479
|
-
4. Plugins are not supported — replace with native GitBook features
|
|
480
|
-
|
|
481
|
-
> Full details: `references/migration.md`
|
|
482
|
-
|
|
483
|
-
## Troubleshooting
|
|
484
|
-
|
|
485
|
-
| Issue | Cause | Fix |
|
|
486
|
-
|-------|-------|-----|
|
|
487
|
-
| 401 Unauthorized | Invalid or expired token | Regenerate at `app.gitbook.com/account/developer` |
|
|
488
|
-
| Git Sync not updating | Branch mismatch or conflict | Check space integrations; verify branch name |
|
|
489
|
-
| Broken links after migration | Missing `.md` extensions | Ensure all internal links include `.md` suffix |
|
|
490
|
-
| Images not displaying | Wrong path format | Use paths relative to the page file |
|
|
491
|
-
| Custom domain not working | DNS not configured | Add CNAME to `hosting.gitbook.io` |
|
|
492
|
-
| Change request conflicts | Concurrent edits | Resolve in GitBook UI or re-create the CR |
|
|
493
|
-
| Site sections not showing | Section not linked | Add section in site Settings > Structure |
|
|
494
|
-
| MCP server returns error | Accessed via browser | MCP endpoint is for agent tools, not browsers |
|
|
495
|
-
|
|
496
|
-
## Reference Index
|
|
497
|
-
|
|
498
|
-
| Reference | File | Topics |
|
|
499
|
-
|-----------|------|--------|
|
|
500
|
-
| TypeScript SDK | `references/api-sdk.md` | @gitbook/api client, all endpoints, error handling |
|
|
501
|
-
| Git Sync | `references/git-sync.md` | GitHub App, .gitbook.yaml, SUMMARY.md, mono-repos |
|
|
502
|
-
| Docs Sites | `references/docs-sites.md` | Publishing, Site Sections, domains, variants, SEO |
|
|
503
|
-
| Content Blocks | `references/content-blocks.md` | Block types, OpenAPI, embeds, Markdown extensions |
|
|
504
|
-
| Change Requests | `references/change-requests.md` | CR workflow, review, Docs Agent, adaptive content |
|
|
505
|
-
| Auth & SSO | `references/auth-sso.md` | Visitor auth, Auth0/Okta/Azure AD, SAML, adaptive |
|
|
506
|
-
| LLM-Ready | `references/llm-ready.md` | llms.txt, MCP server, Markdown endpoints, SEO |
|
|
507
|
-
| Migration | `references/migration.md` | MkDocs, Docusaurus, legacy GitBook v1/v2 |
|
|
508
|
-
|
|
509
|
-
## Starter Templates
|
|
510
|
-
|
|
511
|
-
Copy these assets into a new project to bootstrap a GitBook-ready repository:
|
|
512
|
-
|
|
513
|
-
| Asset | File | Description |
|
|
514
|
-
|-------|------|-------------|
|
|
515
|
-
| GitBook config | `assets/gitbook.yaml` | Starter `.gitbook.yaml` with root, structure, and redirects |
|
|
516
|
-
| Table of contents | `assets/SUMMARY.md` | Starter `SUMMARY.md` with multi-section navigation |
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# Summary
|
|
2
|
-
|
|
3
|
-
## Getting Started
|
|
4
|
-
|
|
5
|
-
* [Introduction](README.md)
|
|
6
|
-
* [Installation](getting-started/installation.md)
|
|
7
|
-
* [Quick Start](getting-started/quickstart.md)
|
|
8
|
-
* [Configuration](getting-started/configuration.md)
|
|
9
|
-
|
|
10
|
-
## User Guide
|
|
11
|
-
|
|
12
|
-
* [Overview](guide/README.md)
|
|
13
|
-
* [Basic Usage](guide/basics.md)
|
|
14
|
-
* [Advanced Topics](guide/advanced/README.md)
|
|
15
|
-
* [Plugins](guide/advanced/plugins.md)
|
|
16
|
-
* [Theming](guide/advanced/theming.md)
|
|
17
|
-
|
|
18
|
-
## API Reference
|
|
19
|
-
|
|
20
|
-
* [REST API](api/rest.md)
|
|
21
|
-
* [TypeScript SDK](api/sdk.md)
|
|
22
|
-
* [Webhooks](api/webhooks.md)
|
|
23
|
-
|
|
24
|
-
## Resources
|
|
25
|
-
|
|
26
|
-
* [FAQ](resources/faq.md)
|
|
27
|
-
* [Troubleshooting](resources/troubleshooting.md)
|
|
28
|
-
* [Changelog](CHANGELOG.md)
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# .gitbook.yaml — GitBook repository configuration
|
|
2
|
-
# Place this file at the root of your repository (or at the root specified below).
|
|
3
|
-
|
|
4
|
-
# Root directory for documentation (relative to repo root)
|
|
5
|
-
root: ./docs/
|
|
6
|
-
|
|
7
|
-
# Structure files
|
|
8
|
-
structure:
|
|
9
|
-
readme: README.md
|
|
10
|
-
summary: SUMMARY.md
|
|
11
|
-
|
|
12
|
-
# Redirects for moved/renamed pages (old-path: new-path.md)
|
|
13
|
-
# redirects:
|
|
14
|
-
# previous/page: current/page.md
|