https://github.com/pressbooks/pb-cli
A suite of wp-cli commands for Pressbooks.
https://github.com/pressbooks/pb-cli
automation backend cli
Last synced: 12 months ago
JSON representation
A suite of wp-cli commands for Pressbooks.
- Host: GitHub
- URL: https://github.com/pressbooks/pb-cli
- Owner: pressbooks
- License: gpl-3.0
- Created: 2016-08-15T21:52:59.000Z (almost 10 years ago)
- Default Branch: dev
- Last Pushed: 2025-05-15T19:40:24.000Z (about 1 year ago)
- Last Synced: 2025-06-12T19:21:27.476Z (about 1 year ago)
- Topics: automation, backend, cli
- Language: PHP
- Homepage: https://cli.pressbooks.org/
- Size: 612 KB
- Stars: 5
- Watchers: 10
- Forks: 1
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Contributing: docs/contributing.md
- License: LICENSE.md
Awesome Lists containing this project
README
pressbooks/pb-cli
=================
A suite of wp-cli commands for Pressbooks.
[](https://travis-ci.org/pressbooks/pb-cli)
Quick links: [Using](#using) | [Installing](#installing) | [Contributing](docs/contributing.md#contributing) | [Support](docs/contributing.md#support)
## Using
This package implements the following commands:
### wp scaffold book-theme
Generate the files needed for a Pressbooks book theme.
~~~
wp scaffold book-theme [--theme_name=] [--description=] [--uri=] [--author=] [--author_uri=] [--github_account=] [--github_repo=] [--license=] [--textdomain=] [--version=] [--dir=] [--activate] [--enable-network] [--force]
~~~
Default behavior is to create the following files:
- functions.php
- .gitignore, .editorconfig, package.json, composer.json, composer.lock, yarn.lock
- README.md
Unless specified with `--dir=`, the theme is placed in the themes
directory.
**OPTIONS**
Slug for the new theme.
Vendor for the new theme. Used in composer.json and package.json.
[--theme_name=]
What to put in the 'Theme Name:' header in 'style.css'. Defaults to .
[--description=]
Human-readable description for the theme.
[--uri=]
What to put in the 'Theme URI:' header in 'style.css'.
[--author=]
What to put in the 'Author:' header in 'style.css'.
[--author_uri=]
What to put in the 'Author URI:' header in 'style.css'.
[--github_account=]
The GitHub account that owns this project (e.g. 'pressbooks'). Defaults to vendor.
[--github_repo=]
The GitHub repo name for this project (e.g. 'pressbooks-book'). Defaults to slug.
[--license=]
What to put in the 'License:' header in 'style.css'.
---
default: GPL 2.0+
---
[--textdomain=]
Text domain for the theme. Defaults to .
[--version=]
Version for the theme.
---
default: 1.0
---
[--dir=]
Specify a destination directory for the command. Defaults to the themes directory.
[--activate]
Activate the newly created book theme.
[--enable-network]
Enable the newly created book theme for the entire network.
[--force]
Overwrite files that already exist.
### wp pb issue-template
Generate an issue template for a Pressbooks theme or plugin, placing it in .github/ISSUE_TEMPLATE.md.
~~~
wp pb issue-template --type= --owner= [--dir=] [--force]
~~~
**OPTIONS**
Slug for the theme or plugin (e.g. pressbooks, pressbooks-book).
--type=
The type of repo for which we're generating an issue template. Must be `theme` or `plugin`.
--owner=
The GitHub username of this repo's owner (e.g. pressbooks).
[--dir=]
Specify a destination directory for the command. Defaults to the theme or plugin's directory.
[--force]
Overwrite files that already exist.
### wp pb theme lock
Lock a book's theme.
~~~
wp pb theme lock --url=
~~~
**OPTIONS**
--url=
The URL of the target book.
### wp pb theme unlock
Unlock a book's theme.
~~~
wp pb theme unlock --url=
~~~
**OPTIONS**
--url=
The URL of the target book.
### wp pb clone
Clone a book.
~~~
wp pb clone --user=
~~~
**OPTIONS**
URL
Book slug on the current network
--user=
sets request to a specific WordPress user
## Installing
Installing this package requires WP-CLI v2.5.0 or greater. Update to the latest stable release with `wp cli update`.
Once you've done so, you can install this package with:
wp package install git@github.com:pressbooks/pb-cli.git
## Upgrade Notice
### 2.1.0
* PB-CLI requires Pressbooks >= 5.21.0