# Command line option

**URL:** <https://forums.balena.io/t/command-line-option/7171>\
**Category:** balenaEtcher\
**Created:** [May 2, 2019, 10:27pm UTC](https://forums.balena.io/t/command-line-option/7171 "2019-05-02T22:27:34Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![ed.barnes](https://avatars.discourse-cdn.com/v4/letter/e/ebca7d/32.png) [@ed.barnes](https://forums.balena.io/u/ed.barnes)\
**Post date:** [May 2, 2019, 10:27pm UTC](https://forums.balena.io/t/command-line-option/7171/1 "2019-05-02T22:27:34Z")

</div>

Is it possible to run Etcher via command line? Give the program the location of the image and the drive of the micro SD card?

I am trying to script the whole setup of our Raspberry Pi set up to make life easier for our Production people.

---

<div class="post-metadata">

**Author:** ![imrehg](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/imrehg/32/36_2.png) [@imrehg](https://forums.balena.io/u/imrehg)\
**Post date:** [May 3, 2019, 4:09pm UTC](https://forums.balena.io/t/command-line-option/7171/8 "2019-05-03T16:09:53Z")

</div>

Hi, Etcher does not have a command-line interface at the moment, there was one but it was deprecated due to the lack of use.

### balena CLI

You can likely use the balena CLI, probably, which uses etcher underneath:

> **[balena-io/balena-cli](https://github.com/balena-io/balena-cli)**
>
> The official balena CLI tool. Contribute to balena-io/balena-cli development by creating an account on GitHub.

```auto
~> balena local flash --help
Usage: local flash <image>

Use this command to flash a balenaOS image to a drive.

Examples:

	$ balena local flash path/to/balenaos.img[.zip|.gz|.bz2|.xz]
	$ balena local flash path/to/balenaos.img --drive /dev/disk2
	$ balena local flash path/to/balenaos.img --drive /dev/disk2 --yes

Options:

    --drive, -d <drive> drive                              
    --yes, -y confirm non-interactively          

```

This `local flash` command should provide all the things you needed?

### Etcher SDK

You can also make a simple command line interface using Node.js and the Etcher SDK

> **[balena-io-modules/etcher-sdk](https://github.com/balena-io-modules/etcher-sdk)**
>
> Contribute to balena-io-modules/etcher-sdk development by creating an account on GitHub.

This could be used to put together a small tool to do the image burn on the command line, asked our team members for a simple example, that etcher-sdk codebase has some examples too, but doesn’t seem to me that there’s one that is directly usable to as you wanted.

Does this help?

---

<div class="post-metadata">

**Author:** ![ed.barnes](https://avatars.discourse-cdn.com/v4/letter/e/ebca7d/32.png) [@ed.barnes](https://forums.balena.io/u/ed.barnes)\
**Post date:** [May 6, 2019, 7:23pm UTC](https://forums.balena.io/t/command-line-option/7171/10 "2019-05-06T19:23:06Z")

</div>

I will give it a whirl thanks

---

<div class="post-metadata">

**Author:** ![Tschebbischeff](https://avatars.discourse-cdn.com/v4/letter/t/54ee81/32.png) [@Tschebbischeff](https://forums.balena.io/u/Tschebbischeff)\
**Post date:** [October 16, 2019, 8:56am UTC](https://forums.balena.io/t/command-line-option/7171/11 "2019-10-16T08:56:24Z")

</div>

We are using etcher CLI in our workflow to flash our devices, just wanted to let you know. While you of course have the stats for how many people are actually using it, I just wanted to reinforce that there are people who are actually using it.

While I generally would discourage using old versions of software, for anyone stumbling upon this and in absolute need of using it, the last version over at [GitHub](https://github.com/balena-io/etcher/releases?after=v1.5.0) is v.1.4.9 and we are currently using that version to flash our devices.

---

<div class="post-metadata">

**Author:** ![ashleemikeyoung](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/ashleemikeyoung/32/5040_2.png) [@ashleemikeyoung](https://forums.balena.io/u/ashleemikeyoung)\
**Post date:** [December 6, 2020, 3:13pm UTC](https://forums.balena.io/t/command-line-option/7171/13 "2020-12-06T15:13:27Z")

</div>

Can you provide any insight or tips in how you’re using both the CLI and possibly the older version to flash devices via the command line? I’ve been happy with using Etcher via the desktop, but I need to now automate a workflow and the GUI version is just not feasible any longer. Thanks!

---

<div class="post-metadata">

**Author:** ![CharlesZ](https://avatars.discourse-cdn.com/v4/letter/c/c5a1d2/32.png) [@CharlesZ](https://forums.balena.io/u/CharlesZ)\
**Post date:** [March 6, 2021, 12:27am UTC](https://forums.balena.io/t/command-line-option/7171/14 "2021-03-06T00:27:56Z")

</div>

Yes, we have the similar case, want to make this progress automation for the production application. Have you completed it?

---

<div class="post-metadata">

**Author:** ![jakogut](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@jakogut](https://forums.balena.io/u/jakogut)\
**Post date:** [March 6, 2021, 12:53am UTC](https://forums.balena.io/t/command-line-option/7171/15 "2021-03-06T00:53:17Z")

</div>

Hey guys,

As mentioned above with the man page for `balena local flash`, you can automate flashing local disks with `balena local flash /path/to/image.img --drive /path/to/drive --yes`. Is there something specifically we can further help clarify?

---

<div class="post-metadata">

**Author:** ![jaredhagel](https://avatars.discourse-cdn.com/v4/letter/j/5fc32e/32.png) [@jaredhagel](https://forums.balena.io/u/jaredhagel)\
**Post date:** [September 17, 2021, 5:03pm UTC](https://forums.balena.io/t/command-line-option/7171/17 "2021-09-17T17:03:12Z")

</div>

Hello everyone,

Is there a way to flash system drives with this ‘balena local flash’ command? This is a requirement for us.

Thank you,  
Jared

---

<div class="post-metadata">

**Author:** ![builder555](https://avatars.discourse-cdn.com/v4/letter/b/cc9497/32.png) [@builder555](https://forums.balena.io/u/builder555)\
**Post date:** [October 21, 2021, 6:09pm UTC](https://forums.balena.io/t/command-line-option/7171/18 "2021-10-21T18:09:51Z")

</div>

Hello Jared,

Just to clarify, are you trying to flash a system drive on the same device that is running balena-cli?

---

<div class="post-metadata">

**Author:** ![rahul4](https://avatars.discourse-cdn.com/v4/letter/r/a8b319/32.png) [@rahul4](https://forums.balena.io/u/rahul4)\
**Post date:** [March 29, 2022, 5:55am UTC](https://forums.balena.io/t/command-line-option/7171/21 "2022-03-29T05:55:32Z")

</div>

Hi @imrehg and @Tschebbischeff ,

Does the balena cli support flashing multiple devices at the same time like the etcher?

```auto
balena local flash path/to/balenaos.img --drive /dev/sda --drive /dev/sdb 

```

I want to use automate the process of using balena etcher just like the users above, but I am flashing multiple Cm4 devices at the same time

---

<div class="post-metadata">

**Author:** ![builder555](https://avatars.discourse-cdn.com/v4/letter/b/cc9497/32.png) [@builder555](https://forums.balena.io/u/builder555)\
**Post date:** [August 25, 2022, 6:28pm UTC](https://forums.balena.io/t/command-line-option/7171/22 "2022-08-25T18:28:50Z")

</div>

Hi,

No it does not. Only one --drive argument is processed. You can still automate the process, it’ll just require a separate flash for each of the drives.

---

<div class="post-metadata">

**Author:** ![awu](https://avatars.discourse-cdn.com/v4/letter/a/41988e/32.png) [@awu](https://forums.balena.io/u/awu)\
**Post date:** [September 13, 2022, 10:15am UTC](https://forums.balena.io/t/command-line-option/7171/23 "2022-09-13T10:15:37Z")

</div>

I am using Balena Etcher GUI to flash iot devices, it’s took about 3 minutes to decompress flash and validate. I need to automate this process, so I tried Balena CLI and it took about 18 minutes to but only performing two action flashing and validate, without decompressing. Any idea how to accelerate it?
