How to use the Bump command line interface.
To install it globally, run the following command with NPM
npm install -g bump-cli
Or, with Yarn via
yarn global add bump-cli
As our CLI is a node package, you can easily embed it to your project by adding the package to your
package.jsonfile, either via NPM
npm install --save-dev bump-cli
Or via Yarn
yarn add --dev bump-cli
You can then use any Bump CLI commands via
npm execas such
npm exec -- bump --help
Unfortunately, at the moment we only support the Node environment. However we plan to distribute universal binaries in the most common package managers very soon. In the meantime, you can download a standalone package directly from the latest Github release assets or you can push your documentation using our API.
To list all the available commands, just type
bumpin your command line environment. You can get some help anytime by using
--helpon any command. Example:
bump deploy --help.
When writing a documentation, you'll want to preview how it renders on Bump. This is exactly the goal of the
previewcommand: it will create a temporary documentation with a unique URL, which will be available for a short period of time.
Usage from a local OpenAPI or AsyncAPI file
bump preview path/to/file.json
You can also preview a file available from a URL
bump preview https://developers.bump.sh/source.yaml
By using the
--liveflag you can stay focused on API design (OpenAPI or AsyncAPI file) while seeing a continuously updated preview each time you save your API definition file.
- Launch the live preview command in your terminalbump preview --live --open openapi-definition.json
- Edit your
openapi-definition.jsonfile in your favorite text editor
- Watch the live preview being updated each time your save your file!
This is mainly used when you integrate Bump in your automated environments (Continuous Integration). It will validate your documentation file to make sure it is parsed correctly by Bump. If you want to validate your API specification file before a deployment, you can either use:
This command will output a diff summary of what has changed in the API. It can be used to ensure that future file deployment will work smoothly and to get a human diff summary during code reviews.
bump diff path/to/file.json --doc my-documentation
If you don't need a diff summary from the
bump diffcommand explained above, you can also make sure your API specification file is valid and parsed correctly by Bump with the
bump deploy --dry-runcommand. It can be used to ensure that future file deployment will work smoothly.
bump deploy --dry-run path/to/file.json --doc my-documentation
Once your documentation has been updated and merged, you want it to be live for your API users. This is what the
deploycommand is for. When deploying the new version, Bump will analyse your API structure and will generate a changelog item if the API structure has changed.
bump deploy path/to/file.json --doc my-documentation