Merge pull request #8795 from dokku/8792-add-format-json-support-to-apps-list

Add --format json support to apps:list
This commit is contained in:
Jose Diaz-Gonzalez
2026-07-06 13:32:38 -04:00
committed by GitHub
5 changed files with 67 additions and 6 deletions

View File

@@ -8,7 +8,7 @@ apps:clone <old-app> <new-app> # Clones an app
apps:create <app> # Create a new app
apps:destroy <app> # Permanently destroy an app
apps:exists <app> # Checks if an app exists
apps:list # List your apps
apps:list [--format stdout|json] # List your apps
apps:lock <app> # Locks an app for deployment
apps:locked <app> # Checks if an app is locked for deployment
apps:rename <old-app> <new-app> # Rename an app
@@ -47,6 +47,18 @@ node-js-app
python-app
```
You can also retrieve the list of apps as a JSON array by using the `--format json` flag, which is useful for programmatic consumption:
```shell
dokku apps:list --format json
```
```json
["node-js-app","python-app"]
```
When no apps exist, the JSON output is an empty array (`[]`).
### Checking if an application exists
For CI/CD pipelines, it may be useful to see if an application exists before creating a "review" application for a specific branch. You can do so via the `apps:exists` command: