{"id":17010,"library":"gitbook-cli","title":"GitBook CLI","description":"gitbook-cli is a command-line interface tool designed to manage and execute local installations of the open-source GitBook static site generator. It enables users to build, serve, and manage various versions of the GitBook engine (specifically GitBook versions >=2.0.0), storing them in a dedicated directory (defaulting to `~/.gitbook`). The current stable version indicated is 2.3.2. This toolchain facilitated local documentation and book generation, abstracting away direct `gitbook` engine installations. However, the GitBook project has since pivoted to a SaaS-first platform, and this open-source CLI and its associated engine are no longer actively maintained, making it an abandoned project. Its primary differentiator was simplifying local GitBook engine management and execution.","status":"abandoned","version":"2.3.2","language":"javascript","source_language":"en","source_url":"https://github.com/GitbookIO/gitbook-cli","tags":["javascript"],"install":[{"cmd":"npm install gitbook-cli","lang":"bash","label":"npm"},{"cmd":"yarn add gitbook-cli","lang":"bash","label":"yarn"},{"cmd":"pnpm add gitbook-cli","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[],"quickstart":{"code":"npm install -g gitbook-cli\n\nmkdir my-book\ncd my-book\n\n# Initialize a new GitBook project\ngitbook init\n\n# Build the book\ngitbook build\n\n# Serve the book locally\ngitbook serve\n\n# List installed GitBook versions\ngitbook ls\n\n# Install a specific GitBook version\ngitbook fetch 3.2.3","lang":"javascript","description":"Installs the GitBook CLI globally, initializes a new book, builds and serves it, and demonstrates version management."},"warnings":[{"fix":"Consider migrating documentation to the modern GitBook platform (GitBook.com) or an alternative static site generator like Docsify, VuePress, Docusaurus, or MkDocs if a self-hosted solution is required.","message":"The `gitbook-cli` project and the underlying open-source GitBook engine are no longer actively maintained. The official GitBook platform has pivoted to a commercial SaaS model, deprecating the open-source toolchain.","severity":"breaking","affected_versions":">=2.3.0"},{"fix":"Ensure that the GitBook version specified in your `book.json` (or via `--gitbook` option) is 2.0.0 or higher. Use `gitbook fetch <version>` to install compatible versions.","message":"gitbook-cli only supports GitBook engine versions `>=2.0.0`. Attempting to use older versions may result in unexpected behavior or errors.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"If encountering issues, try running `gitbook-cli` with an older, compatible Node.js version (e.g., Node.js 10 or 12) using a tool like `nvm` (Node Version Manager).","message":"Due to the project's abandonment, `gitbook-cli` may have compatibility issues with newer Node.js versions (e.g., Node.js 16+). It was developed during an era of older Node.js LTS releases.","severity":"gotcha","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"fix":"Run `npm install -g gitbook-cli` to install it globally. If the issue persists, ensure your shell's PATH includes `$(npm config get prefix)/bin`.","cause":"The `gitbook-cli` package was not installed globally or the `npm` global bin path is not in your system's PATH.","error":"gitbook: command not found"},{"fix":"Update your `book.json` to specify a GitBook version like `\"gitbook\": \">=3.0.0\"` or explicitly fetch and use a newer version with `gitbook fetch 3.2.3` and then `gitbook build --gitbook=3.2.3`.","cause":"The configured GitBook engine version in `book.json` or specified via `--gitbook` is older than the minimum supported version (2.0.0) by `gitbook-cli`.","error":"Error: GitBook version 1.x.x is not supported by the GitBook CLI. Please upgrade to a version >= 2.0.0."},{"fix":"Downgrade your Node.js version to an older LTS release, such as Node.js 12 or 14, using a Node.js version manager (e.g., `nvm install 14 && nvm use 14`).","cause":"This error typically indicates an incompatibility between an older Node.js module (like parts of the GitBook engine) and newer Node.js strict mode execution.","error":"TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments object for strict mode functions at Function.init (fs.js:255:17)"}],"ecosystem":"npm","meta_description":null}