KosmoKrator

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, configure, and verify
# 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.

KeyEnv varTypeRequiredLabel
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.

Generic CLI call
kosmo integrations:call gitbook.gitbook_list_organizations '{}' --json
Provider shortcut
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.

Discovery commands
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 read
Parameters
none
Generic call
kosmo integrations:call gitbook.gitbook_list_organizations '{}' --json
Shortcut
kosmo integrations:gitbook gitbook_list_organizations '{}' --json

gitbook.gitbook_get_organization

Get one GitBook organization.

Read read
Parameters
none
Generic call
kosmo integrations:call gitbook.gitbook_get_organization '{}' --json
Shortcut
kosmo integrations:gitbook gitbook_get_organization '{}' --json

gitbook.gitbook_search_organization

Search across an organization.

Read read
Parameters
none
Generic call
kosmo integrations:call gitbook.gitbook_search_organization '{}' --json
Shortcut
kosmo integrations:gitbook gitbook_search_organization '{}' --json

gitbook.gitbook_list_spaces

List spaces in an organization.

Read read
Parameters
none
Generic call
kosmo integrations:call gitbook.gitbook_list_spaces '{}' --json
Shortcut
kosmo integrations:gitbook gitbook_list_spaces '{}' --json

gitbook.gitbook_get_space

Get one GitBook space.

Read read
Parameters
none
Generic call
kosmo integrations:call gitbook.gitbook_get_space '{}' --json
Shortcut
kosmo integrations:gitbook gitbook_get_space '{}' --json

gitbook.gitbook_search_space

Search content in a GitBook space.

Read read
Parameters
none
Generic call
kosmo integrations:call gitbook.gitbook_search_space '{}' --json
Shortcut
kosmo integrations:gitbook gitbook_search_space '{}' --json

gitbook.gitbook_get_space_content

Get the current content revision for a space.

Read read
Parameters
none
Generic call
kosmo integrations:call gitbook.gitbook_get_space_content '{}' --json
Shortcut
kosmo integrations:gitbook gitbook_get_space_content '{}' --json

gitbook.gitbook_list_pages

List pages in a space content revision.

Read read
Parameters
none
Generic call
kosmo integrations:call gitbook.gitbook_list_pages '{}' --json
Shortcut
kosmo integrations:gitbook gitbook_list_pages '{}' --json

gitbook.gitbook_get_page

Get one page by ID.

Read read
Parameters
none
Generic call
kosmo integrations:call gitbook.gitbook_get_page '{}' --json
Shortcut
kosmo integrations:gitbook gitbook_get_page '{}' --json

gitbook.gitbook_get_page_by_path

Get one page by path.

Read read
Parameters
none
Generic call
kosmo integrations:call gitbook.gitbook_get_page_by_path '{}' --json
Shortcut
kosmo integrations:gitbook gitbook_get_page_by_path '{}' --json

gitbook.gitbook_list_files

List files in a space.

Read read
Parameters
none
Generic call
kosmo integrations:call gitbook.gitbook_list_files '{}' --json
Shortcut
kosmo integrations:gitbook gitbook_list_files '{}' --json

gitbook.gitbook_get_file

Get one file by ID.

Read read
Parameters
none
Generic call
kosmo integrations:call gitbook.gitbook_get_file '{}' --json
Shortcut
kosmo integrations:gitbook gitbook_get_file '{}' --json

gitbook.gitbook_list_openapi_specs

List OpenAPI specs in a space.

Read read
Parameters
none
Generic call
kosmo integrations:call gitbook.gitbook_list_openapi_specs '{}' --json
Shortcut
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
Schema command
kosmo integrations:schema gitbook.gitbook_list_organizations --json
ParameterTypeRequiredDescription
No parameters.
gitbook.gitbook_get_organization 0 parameters
Schema command
kosmo integrations:schema gitbook.gitbook_get_organization --json
ParameterTypeRequiredDescription
No parameters.
gitbook.gitbook_search_organization 0 parameters
Schema command
kosmo integrations:schema gitbook.gitbook_search_organization --json
ParameterTypeRequiredDescription
No parameters.
gitbook.gitbook_list_spaces 0 parameters
Schema command
kosmo integrations:schema gitbook.gitbook_list_spaces --json
ParameterTypeRequiredDescription
No parameters.
gitbook.gitbook_get_space 0 parameters
Schema command
kosmo integrations:schema gitbook.gitbook_get_space --json
ParameterTypeRequiredDescription
No parameters.
gitbook.gitbook_search_space 0 parameters
Schema command
kosmo integrations:schema gitbook.gitbook_search_space --json
ParameterTypeRequiredDescription
No parameters.
gitbook.gitbook_get_space_content 0 parameters
Schema command
kosmo integrations:schema gitbook.gitbook_get_space_content --json
ParameterTypeRequiredDescription
No parameters.
gitbook.gitbook_list_pages 0 parameters
Schema command
kosmo integrations:schema gitbook.gitbook_list_pages --json
ParameterTypeRequiredDescription
No parameters.
gitbook.gitbook_get_page 0 parameters
Schema command
kosmo integrations:schema gitbook.gitbook_get_page --json
ParameterTypeRequiredDescription
No parameters.
gitbook.gitbook_get_page_by_path 0 parameters
Schema command
kosmo integrations:schema gitbook.gitbook_get_page_by_path --json
ParameterTypeRequiredDescription
No parameters.
gitbook.gitbook_list_files 0 parameters
Schema command
kosmo integrations:schema gitbook.gitbook_list_files --json
ParameterTypeRequiredDescription
No parameters.
gitbook.gitbook_get_file 0 parameters
Schema command
kosmo integrations:schema gitbook.gitbook_get_file --json
ParameterTypeRequiredDescription
No parameters.
gitbook.gitbook_list_openapi_specs 0 parameters
Schema command
kosmo integrations:schema gitbook.gitbook_list_openapi_specs --json
ParameterTypeRequiredDescription
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.