Skip to Content
IoT App DevelopmentIronFlock CLIOverview

IronFlock CLI

ironflock is the command line tool for the IronFlock software on a machine. You use it to create devices in your projects, to connect a Linux or Windows machine to IronFlock as a device, to write IronFlockOS to a USB stick, an SD card or a disk, to replace the Linux of a running machine with IronFlockOS, to update, roll back and reset IronFlockOS devices, and to install and look after an IronFlock appliance.

ironflock is one static binary per platform. It needs no runtime and no other package. Install it on Linux or macOS with one line:

curl -fsSL https://instance-registry.ironflock.com/dl/cli/install.sh | sudo bash

The script checks the download against the IronFlock release key before it installs /usr/local/bin/ironflock. Later, sudo ironflock self-update brings it to the newest release. On Windows, one line in PowerShell installs ironflock.exe with the same check, and the same line updates it later:

irm https://instance-registry.ironflock.com/dl/cli/install.ps1 | iex

Installation explains each step, how to verify the script first, and how to update.

The commands are grouped by product: ironflock agent for the device agent, ironflock appliance for the IronFlock appliance, ironflock os for IronFlockOS. A verb means the same in every group. Commands about the machine as a whole, such as ironflock status, have no group. ironflock login, whoami and logout, and the ironflock project, device and app groups, talk to an IronFlock instance with an API key: they manage projects, devices, installed apps and development builds. ironflock --help lists the commands, and ironflock <command> --help describes one.

Commands by Task

TaskCommandReference
Store an API key for an IronFlock instance, show whose it is, remove itironflock login, ironflock whoami, ironflock logoutLog In & Manage Devices
List projects; create, inspect, configure, rename and delete devicesironflock project list, ironflock device create, list, show, apps, config, rename, deleteLog In & Manage Devices
Inspect and operate apps; build and release a versionironflock app list, status, logs, install, update, start, stop, dev, releaseApp Commands
Create or explicitly reuse a device and connect a machine as it in one step--project and --name of agent install, os flash and os installLog In & Manage Devices
Connect a Linux or Windows machine to IronFlock as the device of a device configuration file (.flock)ironflock agent installDevice Agent Commands
Give the installed agent another .flock file or other proxy settingsironflock agent configureDevice Agent Commands
Let the agent update itself to the release of its channelironflock agent updateDevice Agent Commands
Remove the agent and undo what its install changedironflock agent removeDevice Agent Commands
Restart the device agentironflock agent restartDevice Agent Commands
Stop the device agent until it is started againironflock agent stopDevice Agent Commands
Start the device agentironflock agent startDevice Agent Commands
Read the device agent’s logironflock agent logsDevice Agent Commands
See what of IronFlock is on a machine and whether it runsironflock statusStatus & Doctor
Check whether a machine can run the device agent and reach IronFlockironflock doctorStatus & Doctor
List the IronFlockOS images that can be written to a driveironflock os imagesWrite IronFlockOS to a Drive
List the drives an image can be written toironflock os drivesWrite IronFlockOS to a Drive
Write IronFlockOS and a device’s .flock file to a drive or an image fileironflock os flashWrite IronFlockOS to a Drive
Replace the Linux of a running machine with IronFlockOSironflock os installReplace Linux with IronFlockOS
Update an IronFlockOS device to the release of its channelironflock os updateUpdate, Roll Back & Reset
Go back to the IronFlockOS system in the other slotironflock os rollbackUpdate, Roll Back & Reset
Reset an IronFlockOS device to a freshly written oneironflock os resetUpdate, Roll Back & Reset
Install, configure, update and look after an IronFlock appliance on this machineironflock applianceAppliance Commands
Show the version of ironflock, and whether a newer release is outironflock version, ironflock version --checkInstallation
Replace ironflock with the newest releaseironflock self-updateInstallation
Complete command lines with the Tab keyironflock completionInstallation
Run a command on another machine over SSH, or on many--host, --hostsRemote Machines over SSH

Every command takes the global flags. Among them are --yes, which answers the command’s question, and --json, which writes the result as one JSON object for a program to read.

# Install ironflock and connect this Linux machine as the device of device.flock, in one line curl -fsSL https://instance-registry.ironflock.com/dl/cli/install.sh | sudo bash -s -- agent install -c device.flock # Log in with an API key from a file, then create a device and its .flock file ironflock login --key-file key.txt ironflock device create --project Packaging --name press-7 -o press-7.flock # Check whether this machine can run the device agent and reach the hosts of device.flock ironflock doctor -c device.flock # Write IronFlockOS for the device of device.flock to the drive /dev/sdb sudo ironflock os flash -c device.flock -d /dev/sdb # Show the plan for replacing this machine's Linux with IronFlockOS, and change nothing sudo ironflock os install -c device.flock --dry-run # Show the state of a device from your laptop, over SSH ironflock --host pi@device-17 status

Systems

The release publishes ironflock for Linux on amd64, arm64 and 32-bit ARM (v5 to v7), for macOS on Apple silicon and Intel, and for Windows on amd64 (ironflock.exe). Windows on Arm runs the amd64 build emulated.

CommandsLinuxmacOSWindows
version, completionyesyesyes
self-updateyes; on an IronFlockOS device exit code 3, as os update updates ironflock thereyesexit code 3: the install.ps1 line updates ironflock
status, doctoryesyes; status shows the system and that nothing is installedyes
login, whoami, logout, project, device, appyesyesyes
os images, os drives, os flashyesyesyes
agent ...yesexit code 3yes, for the agent’s Windows service
os installyesexit code 3exit code 3
os update, os rollback, os reseton an IronFlockOS device onlyexit code 3exit code 3

A command that does not run on a system is there all the same: it ends with exit code 3 before it looks at anything. The agent commands need a Debian or Ubuntu based Linux with systemd, or Windows on amd64 (The Agent on Windows). os install needs a Linux with systemd on 64-bit UEFI firmware (amd64 or arm64). The appliance commands run on Linux and are described on Appliance Commands.

On an IronFlockOS device, the image brings the device agent with its system. agent install and agent remove therefore refuse there with exit code 3, and agent configure -c gives the device another .flock file.

With --host, every command but completion, login, logout, whoami, project, device and app runs on another Linux machine over SSH, from Linux, macOS and Windows alike. From a Mac you run the agent commands, os install and the commands of an IronFlockOS device this way, and from Windows os install and the commands of an IronFlockOS device. --host does not reach a Windows machine: run the commands there on the machine itself.

IronFlockOS releases after 0.15.0 carry ironflock on the device, as /usr/bin/ironflock. IronFlockOS 0.15.0 and older do not: run the device’s commands from another computer with --host, as the device’s SSH user (SSH Access):

ironflock --host operator@kitchen-pc os update --reboot --yes

Note: The command’s messages and JSON fields say swarm for what IronFlock Studio and these docs call a project, and “swarm owner” for the project owner. For example, the field agent.swarm of ironflock status --json names the device’s project.

The project, device and app groups call the platform from your computer. app dev builds a pushed branch or the cloud IDE working copy on a device; app release publishes a version. They do not use --host.

In This Section

  • App Commands: list, inspect, install, update, start and stop apps; build DEV and release a version.

  • Installation: the install lines for Linux, macOS and Windows, verifying the script, the download base and an appliance’s mirror, tab completion, ironflock version and ironflock self-update.

  • Flags, Output & Exit Codes: the global flags, stdout and JSON, questions, root, secrets and exit codes, which hold for every command.

  • Log In & Manage Devices: login, whoami and logout for an API key, device create, list and delete, and --project and --name for a new device.

  • Remote Machines over SSH: --host for one machine, --hosts and --parallel for many.

  • Device Agent Commands: install, configure, update, remove, restart, stop and start the device agent on Linux and Windows, and read its log.

  • Status & Doctor: what of IronFlock runs on a machine, and whether the machine can run the device agent.

  • Write IronFlockOS to a Drive: list the images and drives, and write IronFlockOS with a device’s .flock file.

  • Replace Linux with IronFlockOS: turn a running Linux machine into an IronFlockOS device.

  • Update, Roll Back & Reset: keep an IronFlockOS device current, go back a release, or reset it.

  • Appliance Commands: install, configure, update and look after an IronFlock appliance on a machine.

Last updated on