---
title: Add devices to a group via CLI
description: Learn how to assign devices to a group using the Orchard binary, either during enrollment or with a separate command using your group key.
---

[Skip to content](https://resources.the-orchard.io/add-devices-to-a-group#main-content)

[![Orchard WordMark - White - Final - SVG](https://resources.the-orchard.io/hubfs/Orchard%20WordMark%20-%20White%20-%20Final%20-%20SVG.svg)](https://the-orchard.io/)

- [Home](https://the-orchard.io/)
- [Why Orchard?](https://the-orchard.io/info/why-us)
- [Trust Center](https://trust.the-orchard.io/)
- [Pricing](https://the-orchard.io/info/pricing)
- [Become a Partner](https://the-orchard.io/info/partner)

Open main navigation

Close main navigation

- [Home](https://the-orchard.io/)
- [Why Orchard?](https://the-orchard.io/info/why-us)
- [Trust Center](https://trust.the-orchard.io/)
- [Pricing](https://the-orchard.io/info/pricing)
- [Become a Partner](https://the-orchard.io/info/partner)
- [Contact us](mailto:hello@the-orchard.io)

[Contact us](mailto:hello@the-orchard.io)

 How can we help you?

- There are no suggestions because the search field is empty.

1. [Orchard Knowledge Base](https://resources.the-orchard.io/?hsLang=en-gb)
2. [Device Enrollment](https://resources.the-orchard.io/device-enrollment?hsLang=en-gb)

17 August 2026

# Add devices to a group via CLI

## Add devices into your preferred group automatically during enrollment

The Orchard binary has the ability to assign devices directly to a group, either during enrollment, or as a separate command.

The basic syntax is:

`orchard --group <group-key>`

You can find the "group key" in the web interface, on the specific group page:

![group-add](https://resources.the-orchard.io/hs-fs/hubfs/group-add.png?width=670&height=640&name=group-add.png)

For example, taking the above group id:

`orchard --group cmswyyxdz007g0f7xw5rri86a`

To add the device into the group at the same time as enrollment, combine it with the `enroll` option:

`orchard enroll --secret <secret-key> --group <group-id>`

- [Getting Started](https://resources.the-orchard.io/getting-started?hsLang=en-gb)
- [Device Enrollment](https://resources.the-orchard.io/device-enrollment?hsLang=en-gb)
- [App Patching](https://resources.the-orchard.io/app-patching?hsLang=en-gb)
- [Billing & Subscriptions](https://resources.the-orchard.io/billing-subscriptions?hsLang=en-gb)

- [Home](https://the-orchard.io/)
- [Why Orchard?](https://the-orchard.io/info/why-us)
- [Trust Center](https://trust.the-orchard.io/)
- [Pricing](https://the-orchard.io/info/pricing)
- [Become a Partner](https://the-orchard.io/info/partner)

[![Orchard O - Leaf](https://resources.the-orchard.io/hs-fs/hubfs/Orchard%20O%20-%20Leaf.png?width=79&height=75&name=Orchard%20O%20-%20Leaf.png "Orchard O - Leaf")](https://the-orchard.io)

[mailto:hello@the-orchard.io](mailto:hello@the-orchard.io) <https://www.linkedin.com/company/the-orchard-labs/posts/?feedView=all>

Copyright © 2026,