This guide walks through a real-world scenario encountered while building and testing this CLI tool. The specific example below came from trying to manually run a PR validation pipeline—the exact debugging session that led to adding the --var option.
Tip
This iterative debugging workflow is ideal for pairing with an LLM assistant (Claude, ChatGPT, etc.). Let it run commands, interpret output, check --help for options, and suggest next steps. The back-and-forth of "run → check logs → diagnose → try fix → repeat" is exactly the kind of conversation LLMs excel at.
You have a PR validation pipeline that works when triggered by GitHub PRs but fails when run manually via the CLI.
buddy pipelines:run 12345 --project=my-project --branch=my-feature-branchOutput:
Execution Started
Execution ID 101
Status INPROGRESS
Branch my-feature-branch
Started just now
buddy executions:show 101 --pipeline=12345 --project=my-projectOutput:
Execution Details
ID 101
Status FAILED
Branch my-feature-branch
...
Actions:
+------------------------------------+------------+----------+
| Action | Status | Duration |
+------------------------------------+------------+----------+
| Get GitHub Info & Setup Vars | FAILED | 3s |
| Run NPM Install | ENQUEUED | - |
| ... | ... | ... |
+------------------------------------+------------+----------+
Use executions:failed to see details and logs for the failed action:
buddy executions:failed 101 --pipeline=12345 --project=my-projectOutput:
Failed Action: Get GitHub Info & Setup Vars
Type GIT_HUB_CLI
Started 5 min ago
Finished 5 min ago
Logs:
Integration: abc123|abc123
my-project
fatal: bad revision 'origin/..HEAD'
Action failed: see logs above for details
The error fatal: bad revision 'origin/..HEAD' indicates a git diff is failing because of an empty base branch reference.
Root cause: This pipeline is designed for PR events (refs/pull/*). When triggered by a PR, Buddy automatically provides BUDDY_EXECUTION_PULL_REQUEST_BASE_BRANCH. When run manually, this variable is empty.
Use the --var option to provide the missing context:
buddy pipelines:run 12345 --project=my-project \
--branch=my-feature-branch \
--var="BUDDY_EXECUTION_PULL_REQUEST_BASE_BRANCH=master"Output:
Execution Started
Execution ID 102
Status INPROGRESS
Branch my-feature-branch
Started just now
buddy executions:show 102 --pipeline=12345 --project=my-project --logsOutput:
Actions:
+------------------------------------+------------+----------+
| Action | Status | Duration |
+------------------------------------+------------+----------+
| Get GitHub Info & Setup Vars | SUCCESSFUL | 3s |
| Run NPM Install | SKIPPED | - |
| ... | ... | ... |
+------------------------------------+------------+----------+
--- Logs: Get GitHub Info & Setup Vars ---
...
IS_DRAFT: 'true'
...
The first action passes, but subsequent actions are skipped. The --logs output shows two clues:
- The first action's logs show
IS_DRAFT: 'true' - The skipped actions' logs say "Action has been skipped because trigger conditions were not met"
To inspect trigger conditions, use pipelines:show which displays a "Conditions" column:
buddy pipelines:show 12345 --project=my-projectActions:
+-------+------------------------------------+--------------+---------------------------+
| ID | Name | Type | Conditions |
+-------+------------------------------------+--------------+---------------------------+
| 10001 | Get GitHub Info & Setup Vars | GIT_HUB_CLI | - |
| 10002 | Run NPM Install | BUILD | VAR_IS_NOT:IS_DRAFT=true |
| ... | ... | ... | ... |
+-------+------------------------------------+--------------+---------------------------+
The VAR_IS_NOT:IS_DRAFT=true condition confirms the action only runs when IS_DRAFT is NOT "true".
To fully simulate a PR run, pass additional variables. Here, 42 represents a non-draft PR number in the repo:
buddy pipelines:run 12345 --project=my-project \
--branch=my-feature-branch \
--var="BUDDY_EXECUTION_PULL_REQUEST_BASE_BRANCH=master" \
--var="BUDDY_EXECUTION_PULL_REQUEST_NO=42"Now the logs show:
BUDDY_EXECUTION_PULL_REQUEST_NO: '42'
IS_DRAFT: ''
And all actions run instead of being skipped.
If an execution fails for a transient reason (flaky test, network issue), retry it:
buddy pipelines:retry 12345 --project=my-projectOutput:
Execution Retried
Execution ID 103
Status INPROGRESS
The retry preserves all original variables and settings.
| Command | Purpose |
|---|---|
buddy pipelines:run <id> --branch=<name> |
Run pipeline on a branch |
buddy pipelines:run <id> --var="KEY=value" |
Run with custom variables |
buddy executions:show <id> --logs |
View execution with action logs |
buddy executions:show <id> --logs -v |
Same, but surface skipped-action errors |
buddy executions:failed <id> |
Show failed actions with logs |
buddy executions:actions <id> |
List actions with their execution IDs |
buddy executions:action-logs <id> <action-exec-id> |
Logs for a specific action |
buddy pipelines:retry <id> |
Retry the last failed execution |
-
Export pipeline config to understand its structure:
buddy pipelines:get <id> --project=<name>
-
Check pipeline variables in the YAML output to see what the pipeline expects.
-
Use
--logsliberally - action logs contain the actual commands and errors. -
Retry vs. Re-run: Use
retryfor transient failures (same config). Userunwith new variables if you need to change inputs or just want to run it from scratch.