LinuxCommandLibrary

gitbook

TLDR

Initialize new book

$ gitbook init
copy
Serve book locally
$ gitbook serve
copy
Build static site
$ gitbook build
copy
Build to specific output
$ gitbook build [.] [_book]
copy
Install plugins
$ gitbook install
copy
Update GitBook
$ gitbook update
copy
List available versions
$ gitbook ls-remote
copy

SYNOPSIS

gitbook command [options]

DESCRIPTION

gitbook is a command-line tool for building books and documentation from Markdown files. It generates static HTML sites or other formats like PDF and ePub.
The tool uses a book.json configuration file and organizes content through SUMMARY.md for structure. Plugins extend functionality with custom features.

PARAMETERS

init

Initialize book structure.
serve
Serve book on localhost.
build
Build static website.
install
Install plugins from book.json.
pdf
Generate PDF (requires Calibre).
epub
Generate ePub.
mobi
Generate Mobi.
update
Update GitBook.
--port port
Server port for serve.
--log level
Log level.

CAVEATS

Legacy CLI deprecated. Requires older Node.js versions. Plugins may be unmaintained. PDF generation needs Calibre.

HISTORY

GitBook was created by Samy Pessé and Aaron O'Mullan around 2014. It became popular for technical documentation and books. The company pivoted to a commercial platform, leaving the CLI as a legacy tool. Community forks continue development.

SEE ALSO

mdbook(1), mkdocs(1), sphinx(1), docusaurus(1)

Copied to clipboard