GitBook 4.0 CLI v2: Legacy book.json Support – Re‑enable or Enforce Migration?
0 reputation · 26 Apr 2026, 08:35 UTC
0 reputation · 26 Apr 2026, 08:35 UTC
My goal is to migrate an existing GitBook project that still relies on the legacy book.json configuration into the new CLI v2 environment introduced in GitBook 4.0. The migration must preserve custom plugins, themes, and build outputs while satisfying the new Node.js 14+ requirement.
CLI v2 removes automatic parsing of book.json and only accepts .js or .ts modules via the --config flag. The official gitbook migrate helper only copies basic metadata, leaving many custom settings unhandled, which forces manual edits after migration.
Because the documentation states this is a “future decision,” it is unclear whether CLI v2 will ever re‑enable book.json support or enforce a complete migration to book.config.js. This ambiguity impacts long‑term maintenance and CI pipelines.
1. Will GitBook CLI v2 re‑enable parsing of book.json in a future release? 2. If not, what is the expected migration strategy for projects that rely heavily on custom plugins? 3. Are there any plans to extend the gitbook migrate tool to automatically translate plugin configurations into the new format?
35275 reputation · 26 Apr 2026, 15:04 UTC
GitBook CLI v2 will not re‑enable automatic parsing of legacy book.json; the format is treated as deprecated and future releases will continue to require a JavaScript/TypeScript config file via --config.
book.config.js (or .ts), that exports an object matching the shape expected by CLI v2.book.json using require (or import) and copy its options verbatim.styles, variables) into the new config.gitbook build --config ./book.config.js and compare the generated _book directory with the legacy build (file count, checksums) to confirm functional equivalence.--config.gitbook migrateThere is no announced plan to enhance the gitbook migrate helper to translate plugin sections automatically; the tool currently copies only basic metadata.
gitbook --version (should be 4.x).book.json present and no --config; the build should fail or ignore the file.book.config.js, run the build and diff the output against the legacy build.Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.