Skip to main content
aspect run builds a target and executes the resulting binary — the same job bazel run does, but routed through the Aspect task lifecycle so it gets the same retry-on-transient-error, status updates, and CI integrations as aspect build and aspect test.
Arguments after -- are forwarded to the target binary unchanged. Arguments before -- are interpreted by the task itself.

Forwarding Bazel flags

Pass build-time Bazel flags with --bazel-flag (repeatable):
Startup flags use --bazel-startup-flag. Note that changing startup flags restarts the Bazel server:

When to use aspect run

  • Local development — same lifecycle as aspect build / aspect test, so debug output looks the same.
  • CI smoke tests — running a binary as a pipeline step works exactly like a build or test step. No special wrapping required.
  • One-off scripts — invoke a binary built from source without writing a wrapper script.
For long-running services in CI, prefer running a daemon outside the Bazel build graph. aspect run waits for the spawned binary to exit before completing.

Comparison with bazel run