
Once you have created the facility and operations, you will be able to execute the operations with obniz-cli.
You can write obnizOS to an obniz device that can communicate with a PC via USB and execute operations simultaneously at high speed.


##  Requirements

### PC

Required Operating Conditions/Verified Devices

- Nodejs12 (MacOS 10.15 / Windows 10)



### obniz Device

obnizOS 3.5.0 or higher  
Must be able to communicate with PC via USB


### Operations to be created

- Only "Write Successful" can be selected for Work Progress Management.
- Work photos and installation location descriptions cannot be used.




## Install obniz-cli

Please install obniz-cli from this procedure.

[Preparing obniz-cli](https://obniz.com//reference/obnizos-for-esp32/quick-start/#preparing-obniz-cli)

obniz-cli requires version 0.9.0 or higher.
Please check the version by using -v to display the version

```shell
$ obniz-cli -v
version 0.9.0
```

## Prepare the API Key

Issue the API key from the API Key menu.
After issuing the key, write down the token.

<div class="row">
<div class="col-md-6">
<figure class="wp-block-image size-large">
<img src="./images/cli-api1.png" alt="">
</figure>
</div>
<div class="col-md-6">
<figure class="wp-block-image size-large">
<img src="./images/cli-api2.png" alt="">
</figure>
</div>
</div>


## How to use


Write obnizOS by typing the following command, followed by the operation.

```shell
$ obniz-cli os:flash-create --operation {{operationName}} --indication {{indicationId}} --token {{token}}
```


If the instruction ID is `next`, the incomplete settings will be performed in order.

For the token, put the string you got from the API key.


![](./images/cli-op.png)

例

```shell
$ obniz-cli os:flash-create --operation obnizBuilding --indication ob-0 --token token_Bowk7ovadfagcwxJTIxP6WfdX1GOB
```


```shell
$ obniz-cli os:flash-create --operation obnizBuilding --indication next --token token_Bowk7ovadfagcwxJTIxP6WfdX1GOB
```



### Precautions
If you perform the same operation on multiple computers at the same time, there is a possibility that next will not work properly.
If you want to run next on multiple computers at the same time, please do not use next or run the operations separately.
