Skip to main content
Manage Lager Box names, IP addresses, and configurations for local development.

Syntax

Commands


Command Reference

add

Add a new Lager Box configuration.
Options:
  • --name (required) - Name to assign to the box
  • --ip (required) - IP address of the box
  • --user (required) - SSH username for the box (the account you log in as)
  • --version - Lager Box version/branch (e.g., staging, main)
  • --yes - Confirm without prompting
--user is required. It previously defaulted to lagerdata, but since most boxes use a different login account, the default was removed so the correct user is always recorded for SSH, updates, and lager ssh.
Examples:

add-all

Automatically add all Lager Boxes found on your Tailscale network.
Options:
  • --yes - Confirm without prompting
This command scans your Tailscale network for devices with names 5-8 characters long, the typical Lager Box naming convention. It adds each one as a box with an uppercase name. How it works:
  1. Runs tailscale status to discover devices
  2. Filters for devices with names 5-8 characters long
  3. Converts names to uppercase
  4. Skips boxes that already exist with the same IP
  5. Adds new boxes to your configuration
Example:

delete

Delete a box configuration.
Examples:

edit

Edit an existing box configuration.
Options:
  • --name (required) - Name of the box to edit
  • --ip - New IP address
  • --user - New SSH username
  • --version - New Lager Box version/branch
  • --new-name - Rename the box
  • --yes - Confirm without prompting
Examples:

list

List all configured boxes with live version status. This is also the default behavior when running lager boxes with no subcommand.
The command queries each box API on port 9000 (/lock and /status) to display real-time version, status and lock information. All boxes are queried at the same time. A box that is powered down or mid-update now costs only its own timeout. It no longer delays the others. On a terminal the table is printed straight away, with every row reading pending. A spinner turns beside each unanswered status and locked by cell. Each row fills in as its box answers. A countdown shows how long the outstanding boxes have left:
The live table always shows locked by, because no lock is known until a box answers. A column that arrives later shifts every row below it. Press Ctrl+C to stop waiting without losing the boxes that did answer: the rest are marked cancelled and the table prints immediately. A box that never answers is given up on shortly after the countdown reaches zero and marked no response, so the command always terminates. Piped into a file or a CI log, the command uses none of the live display. It prints the final table once, exactly as shown above. Output:
In this final table the locked by column appears only when a box is locked. A version from a branch or a commit shows the ref in brackets, for example 0.47.0 (main). A box on a release tag shows only the version. lager hello prints the full ref with the commit. Status Colors: If a box shows root in the locked by column, the command prints a warning. Such a lock usually comes from inside a Docker container. Use lager boxes lock --user to name the user next time.

delete-all

Delete all box configurations.

export

Export box configuration to JSON file.
Options:
  • --output / -o - Output file path (prints to stdout if not specified)
Examples:

import

Import box configuration from JSON file.
Options:
  • FILE - Path to JSON file to import
  • --merge - Merge with existing boxes (default: replace)
  • --yes - Confirm without prompting
Examples:

lock

Lock a box to prevent other users from using it. See Box Locking for full details.
Options:
  • --box (required) - Name of the box to lock
  • --user - Username to lock as. Use it inside a Docker container, where the user is otherwise root
Example:

unlock

Unlock a box to allow other users to use it. See Box Locking for full details.
Options:
  • --box (required) - Name of the box to unlock
  • --user - Holder to unlock as, for a lock recorded under a name other than your user name
  • --force - Force unlock even if locked by another user
Without --force, unlock releases a lock that the CLI counts as yours, such as the automatic lock of your own CI job. Examples:

Configuration Storage

The boxes commands write box configurations to ~/.lager in your home directory. If LAGER_CONFIG_FILE_DIR is set, they write .lager in that directory instead. The boxes are under the BOXES key:
Entries can be:
  • Simple: Just an IP address string
  • Full: Object with ip, user, and version fields
To read boxes, the CLI merges the global file with the .lager files that it finds in your project directories. The file closest to the current directory wins.

Validation

The boxes commands perform validation:
  • Duplicate detection: Prevents adding boxes with same name or IP
  • IP validation: Validates IP address format
  • Confirmation: Shows before/after state for edit operations

Examples


Notes

  • Box names must be unique
  • IP addresses must be unique (no duplicate IPs)
  • --user is required for lager boxes add. add-all stores entries without a user, and commands then use lagerdata
  • Use --merge when importing to preserve existing boxes
  • lager boxes list needs each box to answer on port 9000 to show its version and lock state