# Buildkite CLI not working locally, but working on the buildkite builds

**URL:** <https://forum.buildkite.community/t/buildkite-cli-not-working-locally-but-working-on-the-buildkite-builds/4326>\
**Category:** Pipelines\
**Created:** [March 25, 2025, 5:18pm UTC](https://forum.buildkite.community/t/buildkite-cli-not-working-locally-but-working-on-the-buildkite-builds/4326 "2025-03-25T17:18:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zenogueira](https://avatars.discourse-cdn.com/v4/letter/z/e480ec/32.png) [@zenogueira](https://forum.buildkite.community/u/zenogueira)\
**Post date:** [March 25, 2025, 5:18pm UTC](https://forum.buildkite.community/t/buildkite-cli-not-working-locally-but-working-on-the-buildkite-builds/4326/1 "2025-03-25T17:18:14Z")

</div>

in a similar fashion to [Can't make `buildkite-agent pipeline upload` work on my machine - #7 by zenogueira](https://forum.buildkite.community/t/cant-make-buildkite-agent-pipeline-upload-work-on-my-machine/4312/7), it seems that Buildkite CLI has a different behaviour in the builds generated in Buildkite, than in the local environment. I want to understand what is the issue this time.

My setup is: I have a local cluster where I spawn a few agents on my machine and then builds are triggered by buildkite.

I was just trying out the cli, and tried to run a simple command: `bk build view`, as in the README.

on my machine I get:

```bash
$ bk build view
Error: Failed to resolve a pipeline.

```

on buildkite step (I added a new step manually with just the command) I get:

```bash
$ bk build view
┃ Select a pipeline
┃ > pipeline1
┃ pipeline2
┃ pipeline3

```

I have tried adding all the env variables in the bk build to my local env, but I still have the same issue, this doesn’t fix it, it’s something else. What do I need to do to have the same behaviour? When buildkite runs builds on my machine i’d expect it not to be too different of what I have on my machine, especially for the `bk` cli, which doesn’t come by default with `buildkite-agent`.

Bottom line, my question is: what are the limitations in the use of `bk` in the builds, and does it work well on linux? I see mac seems to be your target distribution platform, but we use debian. On my machine I’m on mac and spawning agents on my machine/mac too.

Thanks for your help :)

---

<div class="post-metadata">

**Author:** ![jerrid](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/jerrid/32/1597_2.png) [@jerrid](https://forum.buildkite.community/u/jerrid)\
**Post date:** [March 25, 2025, 6:42pm UTC](https://forum.buildkite.community/t/buildkite-cli-not-working-locally-but-working-on-the-buildkite-builds/4326/2 "2025-03-25T18:42:02Z")

</div>

Hi zenogueira!

I hope your week is going well! Welcome to the Buildkite CLI!

Pipelines are “resolved”, or divined 🪄, explicitly and implicitly. If you type just `bk build view --help`, you’ll find a bunch of examples that contribute to explicitly resolving a pipeline. When you run it without arguments, it depends on what it can determine implicitly, and that means it will look for a “preferred pipeline” setting in the `.bk.yaml` file, or it will try to determine whether you’re calling it within a repository.

So my guess is that the folder you’re calling `bk build view` isn’t a repo/branch connected to a pipeline and the cli needs more help to figure out what to look at.

Best bets: See if you can run in a repo folder with a branch that Buildkite knows about and has builds, or add a arg to the command.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/system/32/1321_2.png) [@system](https://forum.buildkite.community/u/system)\
**Post date:** [April 25, 2025, 4:42am UTC](https://forum.buildkite.community/t/buildkite-cli-not-working-locally-but-working-on-the-buildkite-builds/4326/3 "2025-04-25T04:42:56Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
