Guide

Token helper CLI

The docspress npm executable currently provides one command: token.

Top-level help

DocsPress CLI bash
npx docspress@0.2.0 --help
Docspress CLI

Usage:
  docspress token --client-id CLIENT_ID --client-secret CLIENT_SECRET --site fkadev.blog --repo f/docspress-demo

Commands:
  token    Create and optionally store a WordPress.com OAuth token.

Unknown commands exit with an error. The CLI does not publish documentation from a local command; synchronization runs through the GitHub Action.

Token options

OptionRequiredPurpose
--client-idyesWordPress.com application client ID.
--client-secretyesWordPress.com application client secret. Keep it outside chat and shell history.
--sitenoSite domain or ID supplied to the authorization screen.
--scopenoOAuth scope; defaults to global.
--redirect-urinoLocal HTTP callback; defaults to http://localhost:8787/callback.
--reporequired with --set-secretGitHub repository in OWNER/REPO form.
--set-secretnoStores the access token as WP_ACCESS_TOKEN through GitHub CLI instead of printing it.

The redirect must use http and the hostname must be localhost or 127.0.0.1. The helper generates and validates OAuth state before exchanging the authorization code.

See Authenticate WordPress for the recommended invocation.

Was this helpful?