From 5644897d1bea550034c848fe1732dc5b309b1546 Mon Sep 17 00:00:00 2001 From: Duane May Date: Fri, 24 Apr 2026 15:23:54 -0400 Subject: [PATCH 1/2] Update migrating guide to refine details --- docs/migrating-from-uaac.md | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/docs/migrating-from-uaac.md b/docs/migrating-from-uaac.md index 7a53a6e..69f5bd5 100644 --- a/docs/migrating-from-uaac.md +++ b/docs/migrating-from-uaac.md @@ -1,17 +1,25 @@ # Migrating from uaac This guide helps users of the Ruby-based [cf-uaac](https://github.com/cloudfoundry/cf-uaac) (`uaac`) CLI transition to the Go-based `uaa` CLI. -See the [UAA-CLI Command Reference](docs/commands.md) for the full list of `uaa` commands and their options. +See the [UAA-CLI Command Reference](./commands.md) for the full list of `uaa` commands and their options. ## Key Differences -| | uaac (Ruby) | uaa (Go) | -|---|---|---| -| **Command style** | Hierarchical topic/verb: `uaac token client get` | Flat VERB-NOUN with hyphens: `uaa get-client-credentials-token` | -| **Output format** | Human-readable text | Machine-parseable JSON by default | -| **SSL validation** | `uaac target URL --skip-ssl-validation` | `uaa target URL --skip-ssl-validation` | -| **Identity zones** | `-z` / `--zone` global flag | `-z` / `--zone` flag on most commands | -| **Verbose/trace** | `-t` / `--trace` for verbose debug output | `-v` / `--verbose` on all commands | +| | uaac (Ruby) | uaa (Go) | +|--------------------|--------------------------------------------------|------------------------------------------------------------------------------| +| **Command style** | Hierarchical topic/verb: `uaac token client get` | Flat VERB-NOUN with hyphens: `uaa get-client-credentials-token` | +| **Output format** | Human-readable text | Defaults to Machine-parseable JSON, with some human-readable status messages | +| **SSL validation** | `uaac target URL --skip-ssl-validation` | `uaa target URL --skip-ssl-validation` | +| **Identity zones** | `-z` / `--zone` global flag | `-z` / `--zone` flag on most commands | +| **Verbose/trace** | `-t` / `--trace` for verbose debug output | `-v` / `--verbose` on all commands | + +### Output Format Notes + +The `uaa` CLI outputs a combination of human-readable status messages and JSON data to stdout. Many commands (like `create-client`, `update-client`, etc.) print a success message followed by JSON output. For reliable machine parsing: + +- Use tools like `tail -n1` to extract only the JSON portion: `uaa create-client myclient -s secret --authorized_grant_types client_credentials | tail -n1 | jq` +- Be aware that status messages and JSON are both written to stdout, not separated by stderr +- Commands that only retrieve data (like `get-client`, `list-clients`) typically output only JSON --- @@ -137,13 +145,13 @@ uaa add-member my-group carol ## Using `uaa curl` as a Fallback -For uaac commands that have no direct equivalent, `uaa curl` provides authenticated access to any UAA API endpoint. First obtain a token, then use `curl` with the active context's credentials: +For uaac commands that have no direct equivalent, `uaa curl` provides authenticated access to any UAA API endpoint. First obtain a token, then use `uaa curl` with the active context's credentials: ```bash uaa target https://uaa.example.com uaa get-client-credentials-token admin -s admin-secret # Example: delete a group by ID -GROUP_ID=$(uaa get-group my-group | python3 -c "import sys,json; print(json.load(sys.stdin)['id'])") +GROUP_ID=$(uaa get-group my-group | jq -r .id) uaa curl /Groups/$GROUP_ID -X DELETE ``` From 8d42e2e9690dbe7d98d7e46c5cea30c22c67b7c8 Mon Sep 17 00:00:00 2001 From: Duane May Date: Thu, 30 Apr 2026 10:47:52 -0400 Subject: [PATCH 2/2] Update docs/migrating-from-uaac.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- docs/migrating-from-uaac.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/migrating-from-uaac.md b/docs/migrating-from-uaac.md index 69f5bd5..83b08fc 100644 --- a/docs/migrating-from-uaac.md +++ b/docs/migrating-from-uaac.md @@ -17,7 +17,7 @@ See the [UAA-CLI Command Reference](./commands.md) for the full list of `uaa` co The `uaa` CLI outputs a combination of human-readable status messages and JSON data to stdout. Many commands (like `create-client`, `update-client`, etc.) print a success message followed by JSON output. For reliable machine parsing: -- Use tools like `tail -n1` to extract only the JSON portion: `uaa create-client myclient -s secret --authorized_grant_types client_credentials | tail -n1 | jq` +- Extract the full JSON block starting at the first line that begins with `{` or `[` rather than using only the last line, for example: `uaa create-client myclient -s secret --authorized_grant_types client_credentials | sed -n '/^[[:space:]]*[{\[]/,$p' | jq` - Be aware that status messages and JSON are both written to stdout, not separated by stderr - Commands that only retrieve data (like `get-client`, `list-clients`) typically output only JSON