Registry / devops / gitbook-cli

gitbook-cli

JSON →
library2.3.2jsnpmunverified

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.

npm install gitbook-cli
INSTALL
IMPORT
SIG · GITBOOK-CLI
G
gitbook-cli
devopsjavascriptv2.3.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Installs the GitBook CLI globally, initializes a new book, builds and serves it, and demonstrates version management.

npm install -g gitbook-cli mkdir my-book cd my-book # Initialize a new GitBook project gitbook init # Build the book gitbook build # Serve the book locally gitbook serve # List installed GitBook versions gitbook ls # Install a specific GitBook version gitbook fetch 3.2.3
gitbook --version
Debug
Known issues
breakingThe `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.
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.
affects: >=2.3.0
gotchagitbook-cli only supports GitBook engine versions `>=2.0.0`. Attempting to use older versions may result in unexpected behavior or errors.
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.
affects: >=2.0.0
gotchaDue 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.
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).
affects: >=2.0.0
Errors
Common errors & fixes
gitbook: command not found
The `gitbook-cli` package was not installed globally or the `npm` global bin path is not in your system's PATH.
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`.
Error: GitBook version 1.x.x is not supported by the GitBook CLI. Please upgrade to a version >= 2.0.0.
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`.
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`.
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)
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.
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`).
Upgrade
Version history
2.3.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
gitbook-cli — npm install gitbook-cli · libregistry