# Add a location or device ad hoc with the CLI Add a single location or device to an existing location using the InStore device command-line interface (CLI). You can use the [InStore device CLI](https://github.com/NebulaTerra/instore-device-cli) to add a location or device directly to your system. This method is useful for quick, ad hoc additions without using the InStore Center application. Alternatively, you can add [locations](/instore/use-the-instore-center/location.md) and [devices](/instore/use-the-instore-center/devices.md) manually in the InStore Center. ## Add a location using the CLI 1. Complete the initial setup as described in [Initial setup via the CLI](/instore/implement-instore/use-instore-device-cli/initial-setup-via-cli.md). 2. Run the following command, replacing the JSON string with the required location information: ```bash title="Add a location via CLI" node index.js create-location '{"location_id": "12345", "location_name": "Test Store", ...}' ``` If your organization has created payment options with the `default` key set to `true`, a new location can have those payment options automatically associated with it. If there are no default payment options, or if the location requires special options, you can manually add them to the location. See [Assign payment options to a location](/instore/integration/payments/build-payment-components.md#assign-to-a-location). ## Add a device using the CLI 1. Complete the initial setup as described in [Initial setup via the CLI](/instore/implement-instore/use-instore-device-cli/initial-setup-via-cli.md). 2. Run the following command, replacing `LOCATION_ID` with the identifier of an existing location and `{device info}` with the required device fields: - `name` - `type` - `status` - `brand` - `model` - `shared` ```bash title="Add a device via CLI" node index.js create-device LOCATION_ID '{device info}' ``` If the device you are adding is a workstation, see [Initial setup via the CLI](/instore/implement-instore/use-instore-device-cli/initial-setup-via-cli.md) for required fields. If your organization has created payment options with the `default` key set to `true`, a new workstation can have those payment options automatically associated with it. If there are no default payment options, or if the workstation requires special options, you can manually add them to the workstation. See [Assign payment options to a workstation](/instore/integration/payments/build-payment-components.md#assign-to-a-workstation). ### Example ```bash title="Example: Add a printer device" node index.js create-device 44444 '{"name": "Epson TM88VI Printer", "type": "Printer", "description": "Printer 1", "status": "Active", "brand": "Epson", "model": "m1", "shared": true, "proxy_address": "127.0.0.1", "ip_address": "127.0.0.1"}' ``` You cannot delete a [device](/instore/use-the-instore-center/devices.md) from a location programmatically using the CLI. To delete a device, use the InStore Center if the device is eligible for deletion. ## Related pages - [Search documentation and API specs](/search.md)