# Device Upgrade from CLI

**URL:** <https://forums.balena.io/t/device-upgrade-from-cli/369259>\
**Category:** Product support\
**Created:** [November 2, 2023, 11:17am UTC](https://forums.balena.io/t/device-upgrade-from-cli/369259 "2023-11-02T11:17:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ben](https://avatars.discourse-cdn.com/v4/letter/b/df788c/32.png) [@ben](https://forums.balena.io/u/ben)\
**Post date:** [November 2, 2023, 11:17am UTC](https://forums.balena.io/t/device-upgrade-from-cli/369259/1 "2023-11-02T11:17:04Z")

</div>

How can I manage device upgrades remotely, from a command line?

I have a fleet, where the devices are pinned to a specific release (auto upgrades off)  
I want to upgrade a specific device or fleet to a different release.

I did not find a relevant command in balena cli.  
The command “balena device os-update ” is for updating the Balena OS, and not the release.

---

<div class="post-metadata">

**Author:** ![rcooke-warwick](https://avatars.discourse-cdn.com/v4/letter/r/ba9def/32.png) [@rcooke-warwick](https://forums.balena.io/u/rcooke-warwick)\
**Post date:** [November 2, 2023, 11:32am UTC](https://forums.balena.io/t/device-upgrade-from-cli/369259/7 "2023-11-02T11:32:41Z")

</div>

Hi there, I’ve just taken a look, and it turns out these CLI commands do exist, but it seems we haven’t documented them!

I found this command

```auto
Pin a device to a release.

USAGE
  $ balena device pin <uuid> [releaseToPinTo]

ARGUMENTS
  <uuid> the uuid of the device to pin to a release
  [releaseToPinTo] the commit of the release for the device to get pinned to

```

and

```auto
Pin a fleet to a release.

USAGE
  $ balena fleet pin <slug> [releaseToPinTo]

ARGUMENTS
  <slug> the slug of the fleet to pin to a release
  [releaseToPinTo] the commit of the release for the fleet to get pinned to

```

These will allow you to pin a specific fleet or device to a specified release.

---

<div class="post-metadata">

**Author:** ![rcooke-warwick](https://avatars.discourse-cdn.com/v4/letter/r/ba9def/32.png) [@rcooke-warwick](https://forums.balena.io/u/rcooke-warwick)\
**Post date:** [November 2, 2023, 12:19pm UTC](https://forums.balena.io/t/device-upgrade-from-cli/369259/8 "2023-11-02T12:19:47Z")

</div>

Just to correct myself, the CLI commands for pinning a device and fleet are documented here: [Release policy - Balena Documentation](https://docs.balena.io/learn/deploy/release-strategy/release-policy/#pin-fleet-to-a-release)

However I see how this is easily missed as the CLI docs page itself doesn’t document them. We will look into adding them there

---

<div class="post-metadata">

**Author:** ![LiorVahav](https://avatars.discourse-cdn.com/v4/letter/l/e8c25b/32.png) [@LiorVahav](https://forums.balena.io/u/LiorVahav)\
**Post date:** [November 5, 2023, 4:36pm UTC](https://forums.balena.io/t/device-upgrade-from-cli/369259/10 "2023-11-05T16:36:21Z")

</div>

Hi,  
Is that CLI command also exposed as HTTP endpoint?

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [November 6, 2023, 11:31am UTC](https://forums.balena.io/t/device-upgrade-from-cli/369259/11 "2023-11-06T11:31:10Z")

</div>

Hello @LiorVahav first of all welcome to the balena community!

did you check the API documentation? [Resources - Balena Documentation](https://docs.balena.io/reference/api/resources/device/)

Let us know if that works for you!
