Skip to content

heroku/devcenter-cli

Repository files navigation

@heroku-cli/plugin-devcenter

Heroku CLI plugin to interact with Heroku Dev Center

Version License

Installation

heroku plugins:install @heroku-cli/plugin-devcenter
$ npm install -g @heroku-cli/plugin-devcenter
$ heroku COMMAND
running command...
$ heroku (--version)
@heroku-cli/plugin-devcenter/2.0.0 darwin-arm64 node-v24.14.0
$ heroku --help [COMMAND]
USAGE
  $ heroku COMMAND
...

Commands

heroku devcenter:open SLUG

open a Dev Center article in the browser (uses Heroku credentials for private or draft content when available)

USAGE
  $ heroku devcenter:open SLUG [--prompt]

ARGUMENTS
  SLUG  article slug (e.g. ps for https://devcenter.heroku.com/articles/ps)

GLOBAL FLAGS
  --prompt  interactively prompt for command arguments and flags

DESCRIPTION
  open a Dev Center article in the browser (uses Heroku credentials for private or draft content when available)

See code: src/commands/devcenter/open.ts

heroku devcenter:preview SLUG

preview a local Dev Center article in the browser with live reload

USAGE
  $ heroku devcenter:preview SLUG [--prompt] [--host <value>] [--port <value>]

ARGUMENTS
  SLUG  article slug (local <slug>.md file)

FLAGS
  --host=<value>  [default: 127.0.0.1] bind host for the preview server
  --port=<value>  [default: 3000] port for the preview server

GLOBAL FLAGS
  --prompt  interactively prompt for command arguments and flags

DESCRIPTION
  preview a local Dev Center article in the browser with live reload

See code: src/commands/devcenter/preview.ts

heroku devcenter:pull SLUGORURL

save a local copy of a Dev Center article

USAGE
  $ heroku devcenter:pull SLUGORURL [--prompt] [-f]

ARGUMENTS
  SLUGORURL  article slug or full Dev Center article URL

FLAGS
  -f, --force  overwrite an existing local file without prompting

GLOBAL FLAGS
  --prompt  interactively prompt for command arguments and flags

DESCRIPTION
  save a local copy of a Dev Center article

See code: src/commands/devcenter/pull.ts

heroku devcenter:push SLUG

update a Dev Center article from a local markdown file

USAGE
  $ heroku devcenter:push SLUG [--prompt]

ARGUMENTS
  SLUG  article slug (optional .md suffix is ignored)

GLOBAL FLAGS
  --prompt  interactively prompt for command arguments and flags

DESCRIPTION
  update a Dev Center article from a local markdown file

See code: src/commands/devcenter/push.ts

Development

TypeScript code lives under src/ with tests under test/. With Node 22+, run npm install and npm test.

If you have a Dev Center instance, you can point your CLI to it by setting the DEVCENTER_BASE_URL environment variable:

export DEVCENTER_BASE_URL=http://localhost:3000

Verbose logging uses the debug package:

DEBUG=devcenter:open heroku devcenter:open my-article
DEBUG=devcenter:preview heroku devcenter:preview my-article
DEBUG=devcenter:* heroku devcenter:open my-article

License

See LICENSE.txt file.

The preview command uses the Font Awesome vector icons, which have their own License.

About

CLI to interact with Dev Center

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages