CLI Reference

Version 4.3.0

Command-line interface for Jekyll and the Minima+ theme

Overview

Jekyll is a static site generator that transforms your plain text into static websites and blogs. This reference covers all available commands.

Installation

Install Jekyll and Bundler:

gem install jekyll bundler

Verify installation:

jekyll --version

Quick Start

# Create a new site
jekyll new my-site

# Navigate to site
cd my-site

# Start development server
bundle exec jekyll serve

# Visit http://localhost:4000

Global Options

These options work with all commands:

Option Description
-v, --version Print version number
-h, --help Show help information
--config FILE Use custom config file(s)
--trace Show full backtrace on errors

Environment Variables

Variable Description
JEKYLL_ENV Set to production for production builds
JEKYLL_LOG_LEVEL Logging level (debug, info, warn, error)

Commands

new

$ jekyll new PATH [options]

Create a new Jekyll site with default scaffolding

Arguments

PATH required
Path where the new site will be created

Options

Flag Type Default Description
--blank boolean - Create a blank site without default content
--skip-bundle boolean - Skip running bundle install
-f, --force boolean - Force creation even if PATH is not empty

Examples

Create a new site

jekyll new my-awesome-site

Create a blank site

jekyll new my-site --blank

Force create in existing directory

jekyll new . --force

serve

$ jekyll serve [options]

Build the site and start a local development server

Options

Flag Type Default Description
-H, --host string 127.0.0.1 Host to bind to
-P, --port number 4000 Port to listen on
-l, --livereload boolean - Enable live reload
-o, --open-url boolean - Open site in browser after build
-B, --detach boolean - Run server in background
-w, --watch boolean true Watch for changes and rebuild
--drafts boolean - Include draft posts in build
--future boolean - Include posts with future dates

Examples

Start development server

jekyll serve

Serve with live reload

jekyll serve --livereload

Serve on custom port

jekyll serve --port 3000

Serve including drafts

jekyll serve --drafts --future

build

$ jekyll build [options]

Build the site and output to the _site directory

Options

Flag Type Default Description
-d, --destination path _site Output directory
-s, --source path . Source directory
-b, --baseurl string - Base URL for the site
--drafts boolean - Include draft posts
--future boolean - Include future-dated posts
-V, --verbose boolean - Show detailed output
-q, --quiet boolean - Suppress output
--profile boolean - Generate Liquid profile

Examples

Build the site

jekyll build

Build to custom directory

jekyll build --destination ./public

Build with baseurl

jekyll build --baseurl /my-project

Production build

JEKYLL_ENV=production jekyll build

clean

$ jekyll clean

Remove all generated files and caches

Examples

Clean build artifacts

jekyll clean
Cleaner: Removing _site... Cleaner: Removing .jekyll-cache...

doctor

$ jekyll doctor

Check your site for common issues and configuration problems

Examples

Run diagnostics

jekyll doctor