From 7d426b2091a07bbf9ff92d544f5dfa151885d35d Mon Sep 17 00:00:00 2001
From: Phil Sturgeon <67381+philsturgeon@users.noreply.github.com>
Date: Tue, 28 Jan 2025 09:39:35 +0000
Subject: [PATCH 1/4] docs: tidied up the README a little
---
README.md | 165 +++++++++++++++++++++++++++++-------------------------
1 file changed, 88 insertions(+), 77 deletions(-)
diff --git a/README.md b/README.md
index 229ec0c..b21b87a 100644
--- a/README.md
+++ b/README.md
@@ -5,16 +5,15 @@
- Help |
+ Help |
Sign up
-The Bump.sh CLI is used to interact with your API documentation or hubs hosted on Bump.sh. With any API definition of your choice (from Swagger, OpenAPI or AsyncAPI), it can help you to:
-
-- Validate an API document before publishing it to your documentation
-- Publish an API document to your Bump.sh documentation or hubs
-- Compare two API documents to generate a human-readable diff from your API definitions
+The Bump.sh CLI is used to interact with your API documentation or hubs hosted on Bump.sh. With any API definition of your choice (from OpenAPI, Swagger, or AsyncAPI), it can help you to:
+- Validate an API document before publishing to your documentation.
+- Publish an API document to your Bump.sh documentation or hubs.
+- Compare two API documents to generate a human-readable diff from your API definition.
Under the hood, it uses the API of [developers.bump.sh](https://developers.bump.sh). And is built with the [`oclif`](https://oclif.io) framework in Typescript.
[](https://npmjs.org/package/bump-cli)
@@ -34,43 +33,43 @@ Under the hood, it uses the API of [developers.bump.sh](https://developers.bump.
The Bump.sh CLI is a node package currently distributed via NPM. This means you must have the Node v20+ interpreter installed on your computer or CI servers.
-_If you are looking to use Bump.sh in a continuous integration environment you might be interested by [our Github Action](https://github.com/marketplace/actions/api-documentation-on-bump)._
+_If you are looking to use Bump.sh in a continuous integration environment you might be interested by [our Github Action](https://github.com/marketplace/actions/bump-sh-api-documentation-changelog)._
> You can download a standalone package directly from the latest
-> GitHub release assets if you don’t use Node.
+> Github release assets if you don’t use Node.
{: .info}
### Global installation
To install it globally, run the following command with NPM
-```sh-session
+```shell
npm install -g bump-cli
```
Or, with Yarn via
-```sh-session
+```shell
yarn global add bump-cli
```
### Add Bump.sh to your Node project
-As our CLI is a node package, you can easily embed it into your project by adding the package to your `package.json` file, either with NPM
+As our CLI is a node package, you can easily embed it to your project by adding the package to your `package.json` file, either with NPM
-```sh-session
+```shell
npm install --save-dev bump-cli
```
Or with Yarn via
-```sh-session
+```shell
yarn add --dev bump-cli
```
You can then use any Bump.sh commands with `npx` (same as `npm exec`)
-```sh-session
+```shell
npx bump --help
```
@@ -82,12 +81,12 @@ Unfortunately, at the moment we only support the Node environment. However, you
To list all the available commands, just type `bump` in your command line environment.
-```sh-session
+```shell
$ bump --help
The Bump.sh CLI is used to interact with your API documentation hosted on Bump.sh by using the API of developers.bump.sh
VERSION
- bump-cli/2.9.1 linux-x64 node-v20.18.1
+ bump-cli/2.9.2 linux-x64 node-v20.18.1
USAGE
$ bump [COMMAND]
@@ -96,8 +95,8 @@ COMMANDS
deploy Create a new version of your documentation from the given file or URL.
diff Get a comparison diff with your documentation from the given file or URL.
help Display help for bump.
- overlay Apply an OpenAPI specified overlay to your API definition.
preview Create a documentation preview from the given file or URL.
+ overlay Apply an OpenAPI specified overlay to your API definition.
```
You can also get some help anytime by adding `--help` to any command. Example: `bump deploy --help`.
@@ -108,6 +107,10 @@ While some commands don't need any API token (`preview` or `diff`) you will need
Head over to your Documentation settings in the “CI deployment” section or your Account or Organization settings in the “API keys” section to fetch a personal token for later usage.
+### Compatible API description formats
+
+We currently support [OpenAPI](https://github.com/OAI/OpenAPI-Specification) from v2.0 to v3.1 and [AsyncAPI 2.x](https://www.asyncapi.com/docs/reference/specification/latest) description formats. Both YAML or JSON file formats are accepted file inputs to the CLI.
+
## Commands
* [`bump deploy [FILE]`](#bump-deploy-file)
@@ -115,11 +118,11 @@ Head over to your Documentation settings in the “CI deployment” section or y
* [`bump preview [FILE]`](#bump-preview-file)
* [`bump overlay [DEFINITION_FILE] [OVERLAY_FILE]`](#bump-overlay-definition_file-overlay_file)
-### `bump deploy [FILE]`
+### The `deploy` command
-When you update your API, you also want its documentation to be up to date for your API users. This is what the deploy command is for.
+When an API is updated, the documentation should be updated at the same time. This is what the deploy command is for.
-```sh-session
+```shell
bump deploy path/to/api-document.yml --doc my-documentation --token $DOC_TOKEN
```
@@ -128,7 +131,7 @@ bump deploy path/to/api-document.yml --doc my-documentation --token $DOC_TOKEN
You can also deploy a given API document to a different branch of your documentation with the `--branch ` parameter. Please note the branch will be created if it doesn’t exist. More details about the branching feature are available on [this dedicated help page](https://docs.bump.sh/help/branching). E.g. deploy the API document to the `staging` branch of the documentation:
-```sh-session
+```shell
bump deploy path/to/api-document.yml --doc my-documentation --token $DOC_TOKEN --branch staging
```
@@ -136,7 +139,7 @@ bump deploy path/to/api-document.yml --doc my-documentation --token $DOC_TOKEN -
If you already have a hub in your [Bump.sh](https://bump.sh) account, you can automatically create documentation and deploy it into that hub by publishing a whole directory containing multiple API documents in a single command:
-```sh-session
+```shell
bump deploy dir/path/to/apis/ --auto-create --hub my-hub --token $HUB_TOKEN
```
@@ -168,69 +171,77 @@ bump deploy path/to/apis/ --hub my-hub --filename-pattern '*-api-{slug}-service'
Simulate your API document's deployment to ensure it is valid by adding the `--dry-run` flag to the `deploy` command. It is handy in a Continuous Integration environment running a test deployment outside your main branch:
-```sh-session
+```shell
bump deploy path/to/api-document.yml --dry-run --doc my-documentation --token $DOC_TOKEN
```
Please check `bump deploy --help` for more usage details.
-### `bump diff [FILE]`
+### The `diff` command
-_If you want to receive automatic `bump diff` results on your Github Pull Requests you might be interested by [our Github Action](https://github.com/marketplace/actions/bump-sh-api-documentation-changelog) which also has a diff command._
-
-Please note that by default the command will always exit with a
-successful return code. If you want to use this command in a CI
-environment and want the command to fail **in case of a breaking
-change**, you will need to add the `--fail-on-breaking` flag to your
-diff command. By default if the environment variable `CI=1` is present
-(in most continuous integration environment), the flag will be
-enabled. In that case you can disable the failures with
-`--no-fail-on-breaking` flag.
+Using the `diff` command can help to spot differences between the local API
+document and the latest deployed version.
#### Public API diffs
-From any two API documents or URLs, you can retrieve a comprehensive changelog of what has changed between them.
+From any two API documents or URLs, you can retrieve a comprehensive changelog
+of what has changed between them.
-```sh-session
+```shell
$ bump diff path/to/your/file.yml path/to/your/second_file.yml
* Comparing the two given definition files... done
Modified: GET /consommations
Response modified: 200
[Breaking] Body attribute modified: energie
```
-> You can create as many diffs as you like without being authenticated. This is a **free and unlimited service** provided as long as you use the service fairly.
-{: .info}
-_**Note:** You can also test this feature in our dedicated web application at ._
+By default the command will always exit with a successful return code. If you
+want to use this command in a CI environment and want the command to fail **in
+case of a breaking change**, you will need to add the `--fail-on-breaking` flag
+to your diff command.
+
+You can also test this feature in our dedicated web application at
+.
+
+#### GitHub Integration
+
+If you want to receive automatic `bump diff` results on Github Pull Requests you
+might be interested by [our Github
+Action](https://github.com/marketplace/actions/bump-sh-api-documentation-changelog#deploy-documentation--diff-on-pull-requests)
+which has support for the diff command.
#### Authenticated diffs related to your Bump.sh documentation
-From an existing Bump.sh documentation, the `diff` command will retrieve a comparison changelog between your latest published documentation and the given file or URL:
+From an existing Bump.sh documentation, the `diff` command will retrieve a
+comparison changelog between your latest published documentation and the given
+file or URL:
-```sh-session
+```shell
bump diff path/to/your/file.yml --doc my-documentation --token $DOC_TOKEN
```
If you want to compare two unpublished versions of your API document, the `diff` command can retrieve a comparison changelog between two given file or URL, “as simple as `git diff`”:
-```sh-session
+```shell
bump diff path/to/your/file.yml path/to/your/next-file.yml --doc my-documentation --token $DOC_TOKEN
```
Please check `bump diff --help` for full usage details.
-### `bump preview [FILE]`
+### The `preview` command
+When writing documentation, you might want to preview how it renders on Bump.sh.
+This is precisely the goal of the `preview` command: it will create temporary
+documentation with a unique URL, which will be available for a short period (30
+minutes).
-When writing documentation, you might want to preview how it renders on Bump.sh. This is precisely the goal of the `preview` command: it will create temporary documentation with a unique URL, which will be available for a short period (30 minutes).
-
-Usage from a local OpenAPI or AsyncAPI file
+Usage from a local OpenAPI or AsyncAPI document:
```shell
bump preview path/to/file.json
```
-You can also preview a file available from a URL
+You can also preview a document available via a URL:
```shell
bump preview https://developers.bump.sh/source.yaml
@@ -243,37 +254,48 @@ By using the `--live` flag you can stay focused on API design (OpenAPI or AsyncA
- Launch the live preview command in your terminal
```shell
-bump preview --live --open openapi-definition.json
+bump preview --live --open api-document.yaml
```
-- Edit your `openapi-definition.json` file in your favorite text editor
+- Edit your `api-document.yaml` file in your favorite text editor.
- Watch the live preview being updated each time you save your file.
+- The additional `--open` flag helps to automatically open the preview URL in your browser.
> You can create as many previews as you like without being authenticated. This is a **free and unlimited service**.
{: .info}
-_**Note:** the additional `--open` flag helps to automatically open the preview URL in your browser._
-
Please check `bump preview --help` for more usage details
-### `bump overlay [DEFINITION_FILE] [OVERLAY_FILE]`
+### The `overlay` command
-> This feature implements the [OpenAPI Overlay specification](https://github.com/OAI/Overlay-Specification). It is possible to apply an Overlay to any kind of document, be it an OpenAPI or AsyncAPI definition file.
+The [Overlay specification](https://github.com/OAI/Overlay-Specification) from the OpenAPI Initiative makes it possible to modify the content of an API definition by adding a layer on top of it. That layer helps adding, removing or changing some or all of the content of the original definition.
-The Overlay specification of OpenAPI makes it possible to modify the content of an API definition file by adding a layer on top of it. That layer helps add, remove, or change some or all of the content of the original definition.
+The `bump overlay` command takes an original API document, applies the changes from the overlay document, and outputs a modified version. No changes are made directly to the original document.
-Technically, the `bump overlay` command will output a modified version of the `[DEFINITION_FILE]` (an OpenAPI or AsyncAPI document) by applying the operations described in the `[OVERLAY_FILE]` Overlay file to the original API document.
+```shell
+bump overlay api-document.yaml overlay.yaml
+```
-To redirect the output of the command to a new file you can run the following:
+To redirect the output of the command to a new file you can run:
```shell
-bump overlay api-document.yaml overlay-file.yaml > api-overlayed-document.yaml
+bump overlay api-document.yaml overlay.yaml > modified-api-document.yaml
```
-_Note: you can also apply overlays during the [`bump deploy` command]((#bump-deploy-file)) with the `--overlay` flag (which can be used multiples times):_
+You can also apply the overlay using the [`deploy` command](#the-deploy-command) with the `--overlay` flag:
```shell
-bump deploy api-document.yaml --doc my-doc --token my-token --overlay overlay-file.yaml
+bump deploy openapi.yaml --doc my-doc --token my-token --overlay overlay.yaml
+```
+
+If there are multiple overlays which need to be applied, the `--overlay` can be passed multiple times.
+
+```shell
+bump deploy openapi.yaml \
+ --doc my-doc \
+ --token my-token \
+ --overlay overlay1.yaml \
+ --overlay overlay2.yaml
```
## Development
@@ -288,6 +310,7 @@ Make sure to have Node.js (At least v20) installed on your machine.
- Compile the Typescript code
+
```sh-session
npm run build
npm run clean # to remove build artifacts
@@ -300,37 +323,25 @@ Make sure to have Node.js (At least v20) installed on your machine.
```
- Run the test suites
-
+
```sh-session
npm run test
npm run test-coverage # Run tests with coverage
```
-## Compatible specification types
+## License
-We currently support [OpenAPI](https://github.com/OAI/OpenAPI-Specification) from 2.0 (called Swagger) to 3.1 and [AsyncAPI 2.x](https://www.asyncapi.com/docs/reference/specification/latest) specification file types. Both YAML and JSON file formats are accepted file inputs to the CLI.
+The Bump CLI project is released under the [MIT License](http://opensource.org/licenses/MIT).
## Contributing
Bug reports and pull requests are welcome on GitHub at . This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
-## Thanks
-
-- [Lorna Mitchel](https://github.com/lornajane/) for [openapi-overlay-js](https://github.com/lornajane/openapi-overlays-js)
-
-## License
-
-The Bump CLI project is released under the [MIT License](http://opensource.org/licenses/MIT).
-
## Code of Conduct
Everyone interacting in the Bump-CLI project codebases, issue trackers, chat rooms, and mailing lists is expected to follow the [code of conduct](https://github.com/bump-sh/.github/blob/main/CODE_OF_CONDUCT.md).
-## Versioning
-
-This npm package starts at v2.0.0 for two main reasons:
-
-- Our [first version](https://github.com/bump-sh/bump-cli) of the Bump CLI was written in Ruby, starting at v2.0.0, which makes it clear we are working on our second version of the Bump CLI
+## Thanks
-- The `bump-cli` package used to be [owned by Rico](https://github.com/rstacruz) which already published v1.x packages. If you are looking for the old npm package please head to [`@rstacruz/bump-cli` package](https://www.npmjs.com/package/@rstacruz/bump-cli). _A big thanks to Rico for transferring the ownership of the `bump-cli` package name!_
-w
+- [Lorna Mitchel](https://github.com/lornajane/) for [openapi-overlay-js](https://github.com/lornajane/openapi-overlays-js).
+- [Rico](https://github.com/rstacruz) for transferring the ownership of the `bump-cli` package name.
From e59290289335301f00ca9eb310811820b31feedb Mon Sep 17 00:00:00 2001
From: Phil Sturgeon <67381+philsturgeon@users.noreply.github.com>
Date: Tue, 28 Jan 2025 11:01:05 +0000
Subject: [PATCH 2/4] toc links to new headers
---
README.md | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/README.md b/README.md
index b21b87a..95a5ab4 100644
--- a/README.md
+++ b/README.md
@@ -41,13 +41,13 @@ _If you are looking to use Bump.sh in a continuous integration environment you m
### Global installation
-To install it globally, run the following command with NPM
+To install it globally, run the following command with NPM:
```shell
npm install -g bump-cli
```
-Or, with Yarn via
+Or, with Yarn via:
```shell
yarn global add bump-cli
@@ -55,19 +55,19 @@ yarn global add bump-cli
### Add Bump.sh to your Node project
-As our CLI is a node package, you can easily embed it to your project by adding the package to your `package.json` file, either with NPM
+As our CLI is a node package, you can easily embed it to your project by adding the package to your `package.json` file, either with NPM:
```shell
npm install --save-dev bump-cli
```
-Or with Yarn via
+Or with Yarn via:
```shell
yarn add --dev bump-cli
```
-You can then use any Bump.sh commands with `npx` (same as `npm exec`)
+You can then use any Bump.sh commands with `npx` (same as `npm exec`):
```shell
npx bump --help
@@ -113,10 +113,10 @@ We currently support [OpenAPI](https://github.com/OAI/OpenAPI-Specification) fro
## Commands
-* [`bump deploy [FILE]`](#bump-deploy-file)
-* [`bump diff [FILE]`](#bump-diff-file)
-* [`bump preview [FILE]`](#bump-preview-file)
-* [`bump overlay [DEFINITION_FILE] [OVERLAY_FILE]`](#bump-overlay-definition_file-overlay_file)
+* [`bump deploy [FILE]`](#the-deploy-command)
+* [`bump diff [FILE]`](#the-diff-command)
+* [`bump preview [FILE]`](#the-preview-command)
+* [`bump overlay [DEFINITION_FILE] [OVERLAY_FILE]`](#the-overlay-command)
### The `deploy` command
From 27485877d68acae70e4b4630f42f4e5202ff671a Mon Sep 17 00:00:00 2001
From: Phil Sturgeon <67381+philsturgeon@users.noreply.github.com>
Date: Tue, 28 Jan 2025 11:08:28 +0000
Subject: [PATCH 3/4] returned a new mention of CI=1
---
README.md | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/README.md b/README.md
index 95a5ab4..fcee41a 100644
--- a/README.md
+++ b/README.md
@@ -95,8 +95,8 @@ COMMANDS
deploy Create a new version of your documentation from the given file or URL.
diff Get a comparison diff with your documentation from the given file or URL.
help Display help for bump.
- preview Create a documentation preview from the given file or URL.
overlay Apply an OpenAPI specified overlay to your API definition.
+ preview Create a documentation preview from the given file or URL.
```
You can also get some help anytime by adding `--help` to any command. Example: `bump deploy --help`.
@@ -198,7 +198,11 @@ Modified: GET /consommations
By default the command will always exit with a successful return code. If you
want to use this command in a CI environment and want the command to fail **in
case of a breaking change**, you will need to add the `--fail-on-breaking` flag
-to your diff command.
+to your diff command.
+
+By default if the environment variable `CI=1` is present (in most continuous
+integration environment), the flag will be enabled. In that case you can disable
+the failures with `--no-fail-on-breaking` flag.
You can also test this feature in our dedicated web application at
.
@@ -268,7 +272,7 @@ Please check `bump preview --help` for more usage details
### The `overlay` command
-The [Overlay specification](https://github.com/OAI/Overlay-Specification) from the OpenAPI Initiative makes it possible to modify the content of an API definition by adding a layer on top of it. That layer helps adding, removing or changing some or all of the content of the original definition.
+The [Overlay Specification](https://spec.openapis.org/overlay/v1.0.0.html) from the OpenAPI Initiative makes it possible to modify the content of an API definition by adding a layer on top of it. That layer helps adding, removing or changing some or all of the content of the original definition.
The `bump overlay` command takes an original API document, applies the changes from the overlay document, and outputs a modified version. No changes are made directly to the original document.
@@ -285,13 +289,13 @@ bump overlay api-document.yaml overlay.yaml > modified-api-document.yaml
You can also apply the overlay using the [`deploy` command](#the-deploy-command) with the `--overlay` flag:
```shell
-bump deploy openapi.yaml --doc my-doc --token my-token --overlay overlay.yaml
+bump deploy api-document.yaml --doc my-doc --token my-token --overlay overlay.yaml
```
If there are multiple overlays which need to be applied, the `--overlay` can be passed multiple times.
```shell
-bump deploy openapi.yaml \
+bump deploy api-document.yaml \
--doc my-doc \
--token my-token \
--overlay overlay1.yaml \
@@ -304,27 +308,27 @@ Make sure to have Node.js (At least v20) installed on your machine.
- Install node dependencies with
- ```sh-session
+ ```shell
npm install
```
- Compile the Typescript code
- ```sh-session
+ ```shell
npm run build
- npm run clean # to remove build artifacts
+ npm run clean # Remove build artifacts
```
- Format the codebase to comply with the linter rules
- ```sh-session
+ ```shell
npm run fmt
```
- Run the test suites
- ```sh-session
+ ```shell
npm run test
npm run test-coverage # Run tests with coverage
```
From 6d9f60767138a661d96b521c5b676f7a59ecfe1f Mon Sep 17 00:00:00 2001
From: Phil Sturgeon <67381+philsturgeon@users.noreply.github.com>
Date: Tue, 28 Jan 2025 11:34:40 +0000
Subject: [PATCH 4/4] merge compatibility into intro
---
README.md | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
index fcee41a..4566f18 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,9 @@
Sign up
-The Bump.sh CLI is used to interact with your API documentation or hubs hosted on Bump.sh. With any API definition of your choice (from OpenAPI, Swagger, or AsyncAPI), it can help you to:
+The Bump.sh CLI is used to interact with API documentation and hubs hosted on Bump.sh from your choice of popular API description formats: OpenAPI, Swagger, or AsyncAPI.
+
+Using [OpenAPI](https://github.com/OAI/OpenAPI-Specification) (v3.x and v2.0) or [AsyncAPI](https://www.asyncapi.com/docs/reference/specification/latest) (2.x), you can do any of the following:
- Validate an API document before publishing to your documentation.
- Publish an API document to your Bump.sh documentation or hubs.
@@ -107,10 +109,6 @@ While some commands don't need any API token (`preview` or `diff`) you will need
Head over to your Documentation settings in the “CI deployment” section or your Account or Organization settings in the “API keys” section to fetch a personal token for later usage.
-### Compatible API description formats
-
-We currently support [OpenAPI](https://github.com/OAI/OpenAPI-Specification) from v2.0 to v3.1 and [AsyncAPI 2.x](https://www.asyncapi.com/docs/reference/specification/latest) description formats. Both YAML or JSON file formats are accepted file inputs to the CLI.
-
## Commands
* [`bump deploy [FILE]`](#the-deploy-command)