Install the CLI

Install the GitBook CLI to build and publish integrations

The CLI can be used to create, test and publish integrations for GitBook’s integration platform. To start using the CLI, you’ll first need to install it globally on your machine:

npm install @gitbook/cli -g

After installing the CLI, you’ll need to authenticate your user in order to create and publish an integration.

To authenticate your user, run:

gitbook auth

This will prompt you to add your developer token from your GitBook account. You can generate a personal developer token in your GitBook Developer settings.

To skip the prompt, for example in CI, over SSH, or in an AI agent sandbox, pass the token directly:

gitbook auth --token <token>

You can also sign in through your browser with gitbook login. Browser sign-in works for everyday CLI commands, but publishing an integration (gitbook integration publish / unpublish) requires a personal access token, so use gitbook auth for integration work. If you've already signed in with gitbook login, run gitbook logout first, then gitbook auth. See the GitBook CLI guide for more.

After authenticating your user, you’ll be able to bootstrap an integration, publish an integration, and more. Refer to the Quickstart to learn more about building an integration using the CLI.

Last updated

Was this helpful?

Powered by GitBook