Command line
This page describes the iguana command line tool: what each subcommand does, how commands
reach the running app, and what the exit codes mean.
The tool is the same binary that runs the app. It is inside the app bundle at
Iguana.app/Contents/MacOS/iguana. Install shows how to put it on your
PATH.
Synopsis
Section titled “Synopsis”iguana daemoniguana config initiguana config pathiguana config check [file]iguana settingsiguana touriguana helpiguana versioniguana <command>Subcommands
Section titled “Subcommands”iguana daemon
Section titled “iguana daemon”Runs the window manager. This is what Iguana.app does when you open it, so you rarely need
to type it. If Iguana is already running, it prints Iguana is already running. and exits.
iguana config
Section titled “iguana config”| Form | What it does |
|---|---|
iguana config init |
Writes the default config file, and iguana.schema.json beside it. An existing config file is left untouched. |
iguana config path |
Prints where the config file lives. |
iguana config check [file] |
Checks the config file, or the file you name, the way Iguana would load it, and prints every problem. |
These work whether or not Iguana is running. See Configuration.
config check exits with status 0 when the file loads, with or without warnings, and also
when there is no file, in which case it says that the built-in settings apply. It exits with
status 1 when the file cannot be loaded because of a syntax error, or cannot be read.
iguana settings
Section titled “iguana settings”Opens the settings window. This is the
settings command, sent to the running app like any other,
so Iguana has to be running.
iguana tour
Section titled “iguana tour”Shows the welcome tour again. This is the
tour command, so Iguana has to be running.
iguana help
Section titled “iguana help”Prints the usage text and the list of commands. -h and --help do the same.
iguana version
Section titled “iguana version”Prints the version number. --version does the same.
iguana with no arguments
Section titled “iguana with no arguments”In a terminal, prints the usage text. When the binary is launched as an app, with no terminal attached, it runs the window manager.
Sending commands
Section titled “Sending commands”Anything else on the command line is sent to the running app as a command:
iguana focus leftiguana resize grow widthiguana move-to-space 3 --stayiguana statusWhat happens:
- The tool checks that the command is well formed. If it is not, it prints the reason and stops, without contacting the app.
- It sends the command to the running app over a socket in your own Library folder,
~/Library/Application Support/Iguana/iguana.sock. Only your user account can use it. - The app runs the command and sends back its reply, which the tool prints.
Because every command works this way, anything a shortcut can do can also be scripted.
Exit codes
Section titled “Exit codes”| Code | Meaning |
|---|---|
0 |
The reply did not start with error. This includes replies such as ok: nothing in that direction. |
1 |
The reply started with error, or Iguana is not running. |
2 |
The command was not well formed, so it was not sent. |
When Iguana is not running the tool prints:
iguana: the window manager is not running (open Iguana.app or run `iguana daemon`)Diagnostics
Section titled “Diagnostics”| Command | Shows |
|---|---|
iguana status |
Whether Iguana is tiling, config problems, how many shortcuts are active, and the last shortcut received with its answer. |
iguana list-windows |
Every window Iguana knows about and how it treats it. |
iguana tree |
The layout tree of the desktops that are showing. |
iguana list-spaces |
Which desktop each display is showing. |
The log is at ~/Library/Logs/Iguana.log. To watch it:
tail -f ~/Library/Logs/Iguana.logFiles Iguana uses
Section titled “Files Iguana uses”| Path | What it is |
|---|---|
~/.config/iguana/iguana.toml |
The config file. Optional. |
~/.config/iguana/iguana.schema.json |
The schema for editors. Iguana writes it beside the config file whenever it creates or changes that file: iguana config init, Edit Config File in the menu, or a change in the settings window. |
~/Library/Application Support/Iguana/state.json |
Saved layouts, so they survive a restart of Iguana. |
~/Library/Application Support/Iguana/iguana.sock |
The socket the command line tool talks to. It exists while Iguana runs. |
~/Library/Logs/Iguana.log |
The log. |
~/Library/Preferences/xyz.onlychan.iguana.plist |
Whether the welcome tour has been shown. |