// What you'll learn

If you're using Adobe Experience Manager on Adobe's AEM Managed Services infrastructure — or on AEM as a Cloud Service — all software releases and web-tier configuration updates flow through Adobe's Cloud Manager CI/CD pipeline. The UI is fine for the happy path. But when you need to actually see what your build is doing in real time — or pull logs that are no longer in the dashboard — you reach for aio-cli.

Why would you want this?

Two reasons, mostly:

01
Install aio-cli

Install the Adobe I/O CLI globally via npm:

bash · install
shell
$ npm install -g @adobe/aio-cli

Confirm the install:

bash · version check
shell
$ aio -v
@adobe/aio-cli/3.5.0 win32-x64 node-v12.18.0
02
Create a Cloud Manager API integration

In the Adobe I/O Developer Console, create a new project (or use an existing one) and add the Cloud Manager API with a JWT credential. Adobe's docs cover this end-to-end — what you need on the way out is a downloaded config.json plus a private key. Stash both somewhere you can reference by absolute path.

03
Configure aio-cli with your credentials

The config.json from the console should look something like this:

config.json · jwt credentials
json
{
  "client_id": "value from your CLI integration (String)",
  "client_secret": "value from your CLI integration (String)",
  "jwt_payload": { value from your CLI integration (JSON Object Literal) },
  "token_exchange_url": "https://ims-na1.adobelogin.com/ims/exchange/jwt"
}

Load it into aio-cli's config under the jwt-auth namespace:

bash · load jwt config
shell
$ aio config:set jwt-auth PATH_TO_CONFIG_JSON_FILE --file --json

Then load the private key:

bash · load private key
shell
$ aio config:set jwt-auth.jwt_private_key PATH_TO_PRIVATE_KEY_FILE --file
04
Set your Cloud Manager program ID

Find your program ID in Cloud Manager (it's the numeric ID in the URL when you're inside a program) and set it as a default:

bash · set program id
shell
$ aio config:set cloudmanager_programid 1234

You only set this once per shell session (or persistently, with --global).

05
List your pipelines

List every pipeline in the program so you can pick the one you want to monitor:

bash · list pipelines
cloudmanager
$ aio cloudmanager:program:list-pipelines
 Pipeline Id   Name                                       Status
 ───────────   ────────────────────────────────────────   ──────
 7239327       Web-Tier Only                              BUSY
 4042555       Non-Production Pipeline                    IDLE
 3984112       Production Pipeline                        IDLE

Grab the pipeline ID you care about — you'll feed it to the next two commands.

06
Kick off (or attach to) an execution

To start a new execution:

bash · create execution
cloudmanager
$ aio cloudmanager:pipeline:create-execution 4042555
starting execution... started execution ID 4042555

If you already kicked off a build from the Cloud Manager UI, skip this — just grab the execution ID from the dashboard.

07
Tail the build log

The payoff. Tail the live build output:

bash · tail live build log
cloudmanager
$ aio cloudmanager:pipeline:tail-build-log 4042555
2022-03-09T00:15:38+0000 The following build artifacts were reused from the prior execution 1132597
2022-03-09T00:15:38+0000 [INFO]   - all
2022-03-09T00:15:38+0000 [INFO]   - core
2022-03-09T00:15:38+0000 [INFO]   - ui.apps
2022-03-09T00:15:38+0000 [INFO]   - ui.content
2022-03-09T00:15:38+0000 [INFO]   - ui.tests
2022-03-09T00:15:38+0000 Running additional tests...
2022-03-09T00:16:02+0000 [INFO] BUILD SUCCESS

And that's the loop: terminal feedback, no dashboard polling, full history available later via aio cloudmanager:pipeline:list-executions.

Important · Logging caveats & limitations
Two things to know before you live in this command
  • You can only tail the "Build & Unit Testing" step. The CLI surfaces Maven/build output. Deploy, security scans, and the rest of the pipeline aren't tail-able — you check those separately.
  • Logs aren't shipped to Splunk. If your org's centralized log search is the source of truth, you won't find Cloud Manager build logs there. Pull them through aio or download via the dashboard while they're still hot.

About the cover photo

Mountain bike trail in Mt. Hood National Forest at sunrise
Sandy Ridge · Mt. Hood
Being in the woods at sunrise is a downright spiritual experience.
This was taken at the Sandy Ridge Mountain Bike Park in Mt. Hood National Forest on an early-morning ride. There's a reason a lot of the hardest problems I've solved got worked out on the trail — your brain unsticks once your hands are busy.

// Related reading

CTA Band