Command line option

#1

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.

#8

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 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

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?

#10

I will give it a whirl thanks