Buddy CLI action: run bdy commands in your pipeline

Buddy now has a Buddy CLI action. It runs bdy commands in your pipeline, already logged in through a Buddy integration, so the pipeline can create sandboxes and start other pipelines with the same commands you use in the terminal. The integration decides who the commands run as and what they can access.

How the Buddy CLI action works

Commands run in the pipeline's workspace and project out of the box.

Image loading...Buddy CLI action with a Buddy integration

The action image is a minimal Ubuntu with bdy. Install any extra tools in setup_commands, which are cached between runs.

Buddy integration permissions

You authorize the integration with OAuth, which gives you these options:

  • Authorize as - commands run as you or as an agent. An agent does not tie the pipeline to a specific person's account and works only in its own workspace, so you only pick its permissions.
  • Workspace access - when you authorize as yourself: all your workspaces or only selected ones. Reaching outside them ends with a 401 error.
  • Permissions - scope per resource, e.g. write access to projects or managing members.

Image loading...Authorizing the integration as an agent

You can also use a personal access token. It acts on behalf of your account, within the scopes, expiration date, and IP restrictions set when you created it.

Warning
Even an integration limited to one workspace sees all of its projects, so start with minimal permissions.

Smoke test in a throwaway sandbox

Every run gets a fresh sandbox with the current code, starts the app in it, checks its health endpoint, and removes the sandbox:

yaml
- action: Smoke test in a sandbox type: BDY_CLI integration: buddy commands: |- SB="smoke-$BUDDY_RUN_ID" bdy sb create -i "$SB" -n "Smoke test #$BUDDY_RUN_ID" --fetch --app-command "npm start" --timeout 900 --wait-for-apps 180 bdy sb exec command "$SB" "curl -fsS localhost:3000/health" --wait bdy sb destroy "$SB" -f
  • --fetch clones the project repository into the sandbox without copying any credentials there,
  • --app-command starts the app in the sandbox, and --wait-for-apps waits until it is up,
  • curl -fsS fails the action if the endpoint returns an HTTP error,
  • --timeout 900 removes the sandbox even if the run stops before destroy.

While the run is in progress, the sandbox shows up on the list with the app running:

Image loading...Smoke test sandbox with the app running

The whole action takes about 10 seconds:

Image loading...Smoke test logs

Handing files to another pipeline

bdy pipeline run start with the --payload option starts another pipeline and sends files to it:

yaml
- action: Hand off to Release type: BDY_CLI integration: buddy commands: |- mkdir -p handoff/config echo "{\"version\": \"1.4.0\", \"source_run\": \"$BUDDY_RUN_ID\"}" > handoff/config/release.json cd handoff bdy pipeline run start release -b main --payload . --comment "Started from Prepare release #$BUDDY_RUN_ID"

The target pipeline gets config/release.json in its filesystem and reacts to it with the new payload conditions:

yaml
trigger_conditions: - trigger_condition: ON_PAYLOAD_AT_PATH trigger_condition_paths: - config/**

Actions waiting for other paths, e.g. Import content waiting for content/**, are skipped, and their logs say why:

Image loading...Target run with a payload file

By default, bdy waits for the started pipeline to finish and shows its result.

Getting started

  1. Add a Buddy integration in Integrations.
  2. Add the Buddy CLI action to your pipeline and select the integration.
  3. Paste your bdy commands.

What's next

Jarek Dylewski

Jarek Dylewski

Customer Support

A journalist and an SEO specialist trying to find himself in the unforgiving world of coders. Gamer, a non-fiction literature fan and obsessive carnivore. Jarek uses his talents to convert the programming lingo into a cohesive and approachable narration.

Oct 21, 2026
Share