productivity
GitBook CLI for AI Agents
Use the GitBook CLI from KosmoKrator to call GitBook tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.GitBook CLI Setup
GitBook can be configured headlessly with `kosmokrator integrations:configure gitbook`.
# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash
# Configure and verify this integration.
kosmokrator integrations:configure gitbook --set api_token="$GITBOOK_API_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor gitbook --json
kosmokrator integrations:status --json Credentials
Authentication type: API token api_token. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.
| Key | Env var | Type | Required | Label |
|---|---|---|---|---|
api_token | GITBOOK_API_TOKEN | Secret secret | yes | API Token |
Command Patterns
The generic command is stable across every integration. The provider shortcut is shorter for humans.
kosmo integrations:call gitbook.gitbook_list_organizations '{}' --json kosmo integrations:gitbook gitbook_list_organizations '{}' --json Discovery
These commands return structured output for coding agents that need to inspect capabilities before choosing a function.
kosmo integrations:docs gitbook --json
kosmo integrations:docs gitbook.gitbook_list_organizations --json
kosmo integrations:schema gitbook.gitbook_list_organizations --json
kosmo integrations:search "GitBook" --json
kosmo integrations:list --json Automation Contexts
The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.
CLI Functions
Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.
gitbook.gitbook_list_organizations
List organizations visible to the token.
read - Parameters
- none
kosmo integrations:call gitbook.gitbook_list_organizations '{}' --json kosmo integrations:gitbook gitbook_list_organizations '{}' --json gitbook.gitbook_get_organization
Get one GitBook organization.
read - Parameters
- none
kosmo integrations:call gitbook.gitbook_get_organization '{}' --json kosmo integrations:gitbook gitbook_get_organization '{}' --json gitbook.gitbook_search_organization
Search across an organization.
read - Parameters
- none
kosmo integrations:call gitbook.gitbook_search_organization '{}' --json kosmo integrations:gitbook gitbook_search_organization '{}' --json gitbook.gitbook_list_spaces
List spaces in an organization.
read - Parameters
- none
kosmo integrations:call gitbook.gitbook_list_spaces '{}' --json kosmo integrations:gitbook gitbook_list_spaces '{}' --json gitbook.gitbook_get_space
Get one GitBook space.
read - Parameters
- none
kosmo integrations:call gitbook.gitbook_get_space '{}' --json kosmo integrations:gitbook gitbook_get_space '{}' --json gitbook.gitbook_search_space
Search content in a GitBook space.
read - Parameters
- none
kosmo integrations:call gitbook.gitbook_search_space '{}' --json kosmo integrations:gitbook gitbook_search_space '{}' --json gitbook.gitbook_get_space_content
Get the current content revision for a space.
read - Parameters
- none
kosmo integrations:call gitbook.gitbook_get_space_content '{}' --json kosmo integrations:gitbook gitbook_get_space_content '{}' --json gitbook.gitbook_list_pages
List pages in a space content revision.
read - Parameters
- none
kosmo integrations:call gitbook.gitbook_list_pages '{}' --json kosmo integrations:gitbook gitbook_list_pages '{}' --json gitbook.gitbook_get_page
Get one page by ID.
read - Parameters
- none
kosmo integrations:call gitbook.gitbook_get_page '{}' --json kosmo integrations:gitbook gitbook_get_page '{}' --json gitbook.gitbook_get_page_by_path
Get one page by path.
read - Parameters
- none
kosmo integrations:call gitbook.gitbook_get_page_by_path '{}' --json kosmo integrations:gitbook gitbook_get_page_by_path '{}' --json gitbook.gitbook_list_files
List files in a space.
read - Parameters
- none
kosmo integrations:call gitbook.gitbook_list_files '{}' --json kosmo integrations:gitbook gitbook_list_files '{}' --json gitbook.gitbook_get_file
Get one file by ID.
read - Parameters
- none
kosmo integrations:call gitbook.gitbook_get_file '{}' --json kosmo integrations:gitbook gitbook_get_file '{}' --json gitbook.gitbook_list_openapi_specs
List OpenAPI specs in a space.
read - Parameters
- none
kosmo integrations:call gitbook.gitbook_list_openapi_specs '{}' --json kosmo integrations:gitbook gitbook_list_openapi_specs '{}' --json Function Schemas
Use these parameter tables when building CLI payloads without calling integrations:schema first.
gitbook.gitbook_list_organizations 0 parameters
kosmo integrations:schema gitbook.gitbook_list_organizations --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
gitbook.gitbook_get_organization 0 parameters
kosmo integrations:schema gitbook.gitbook_get_organization --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
gitbook.gitbook_search_organization 0 parameters
kosmo integrations:schema gitbook.gitbook_search_organization --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
gitbook.gitbook_list_spaces 0 parameters
kosmo integrations:schema gitbook.gitbook_list_spaces --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
gitbook.gitbook_get_space 0 parameters
kosmo integrations:schema gitbook.gitbook_get_space --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
gitbook.gitbook_search_space 0 parameters
kosmo integrations:schema gitbook.gitbook_search_space --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
gitbook.gitbook_get_space_content 0 parameters
kosmo integrations:schema gitbook.gitbook_get_space_content --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
gitbook.gitbook_list_pages 0 parameters
kosmo integrations:schema gitbook.gitbook_list_pages --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
gitbook.gitbook_get_page 0 parameters
kosmo integrations:schema gitbook.gitbook_get_page --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
gitbook.gitbook_get_page_by_path 0 parameters
kosmo integrations:schema gitbook.gitbook_get_page_by_path --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
gitbook.gitbook_list_files 0 parameters
kosmo integrations:schema gitbook.gitbook_list_files --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
gitbook.gitbook_get_file 0 parameters
kosmo integrations:schema gitbook.gitbook_get_file --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
gitbook.gitbook_list_openapi_specs 0 parameters
kosmo integrations:schema gitbook.gitbook_list_openapi_specs --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
Permissions
Headless calls still follow the integration read/write permission policy. Configure read/write defaults with
integrations:configure. Add --force only for trusted automation that should bypass that policy.