Box Commands

Every command the box module offers, from its declarations, in order of the resource each acts on. Each command's help says the same.

Box

lnk box check

Check a spec's attachments in a cloud account, or plan it for a cloud of one kind, making nothing

lnk box check [place] [--cloud <cloud>] [--json] [--plan <plan>] [--zone <zone>] [--spec <file>] [field flags]
  • --cloud, string: A cloud account (lnk cloud list)
  • --json, boolean: Print the answer as JSON for other programs
  • place, position 1, string: A cloud account (lnk cloud list): short for --cloud
  • --plan, string: A cloud's kind (aws, as lnk cloud list says): print what the spec asks of a box there instead, reading no account
  • --zone, string: A region or zone of the cloud, its table's region

It reads the box spec, from a file or its field flags. It answers box.checked.

lnk box copy

Copy files from this computer to a box, over SSH

lnk box copy <name> <files> <dest>
  • dest, position 3, string, required: A folder on the box, from its home folder
  • files, position 2, list of string, required: The files to copy, each keeping its name and permissions
  • name, position 1, string, required: The box (lnk box list)

It answers box.said.

lnk box create

Make a box in a cloud account, with lnk on it

lnk box create [place] [--bundle <bundle>] [--cloud <cloud>] [--here] [--image <image>] [--image-hash <image-hash>] [--name <name>] [--yes] [--zone <zone>] [--spec <file>] [field flags]
  • --bundle, string: Make it from a bundle you built: the name of one lnk bundle create kept, such as devbox (lnk bundle list), or its folder by a path, such as ./devbox. That bundle's own lnk makes the box and installs the bundle on it
  • --cloud, string: The one to make the box in (lnk cloud list)
  • --here, boolean: Make a box here, in its sandbox (or none, with --no-sandbox), its home in ~/Link/Boxes
  • --image, string: A new box's disk from one of your images in that account (lnk box image list)
  • --image-hash, string: A new box's disk from your newest ready image in that account saved with this hash (lnk box image create --hash)
  • --name, string: What to call a new box [default: <spec name, else account>-]
  • place, position 1, string: A cloud account, or here: short for --cloud or --here
  • --yes, boolean: Say yes to what it would ask
  • --zone, string: A region or zone of the cloud

It reads the box spec, from a file or its field flags. It answers box.said.

lnk box delete

Delete a box and its disk

lnk box delete [name] [--cloud <cloud>] [--id <id>] [--yes] [--zone <zone>]
  • --cloud, string: The cloud account of the machine --id names (lnk cloud list)
  • --id, string: Remove by immutable cloud ID; already gone is success
  • name, position 1, string: The box (lnk box list)
  • --yes, boolean: Say yes to what it would ask
  • --zone, string: The region or zone containing --id

It answers box.said.

lnk box forward

Offer a box a SOCKS proxy whose connections leave from this computer

lnk box forward <name> [--port <port>] --proxy-port <proxy-port> [--socket <socket>]
  • name, position 1, string, required: The box (lnk box list)
  • --port, integer: The port on the box's loopback
  • --proxy-port, integer, required: A port on this machine's loopback, a SOCKS proxy the box's connections go to, one that refuses this machine and its networks. Needed: ssh's own SOCKS, which refuses nothing, is never used
  • --socket, string: A Unix socket instead, at this path in the box's home folder: only its user reaches it, and no SSH setting opens it to the network

It answers box.said.

lnk box list

List your boxes: where, how big, their address and state

lnk box list [place] [--all-regions] [--cloud <cloud>] [--here] [--json] [--refresh] [--tag <tag>]
  • --all-regions, boolean: On AWS, look in every region the account has enabled, not only those your boxes are in (the default with none known)
  • --cloud, string: Only the boxes of this cloud account found by --tag (lnk cloud list)
  • --here, boolean: Only the boxes this computer knows, without asking the clouds
  • --json, boolean: Print the answer as JSON for other programs
  • place, position 1, string: A cloud account (lnk cloud list): short for --cloud , with --tag
  • --refresh, boolean: Ask each box's cloud for its state now
  • --tag, list of string: Filter by KEY=VALUE across owners and regions

It answers box.boxes.

lnk box run

Run lnk on a box

lnk box run <name> [-- <args>...]

It takes args, after --, list of string, required: lnk's arguments there. It takes name, position 1, string, required: The box (lnk box list). It answers box.said.

lnk box show

Show a box: where it is, how big, its address and state, as this computer last saw it

lnk box show <name> [--json]

It takes --json, boolean: Print the answer as JSON for other programs. It takes name, position 1, string, required: The box (lnk box list). It answers box.said.

lnk box ssh

Open a shell on a box, or run a command there

lnk box ssh [name] [-- <command>...]

It takes command, after --, list of string: A command to run instead of a shell: several words are a command and its arguments, each arriving whole; one word is a shell line of its own. It takes name, position 1, string: The box [default: the only one]. It answers box.said.

lnk box start

Start a stopped box again

lnk box start <name>

It takes name, position 1, string, required: The box (lnk box list). It answers box.said.

lnk box stop

Stop a box (its disk stays)

lnk box stop <name>

It takes name, position 1, string, required: The box (lnk box list). It answers box.said.

Image

lnk box image create

Save a box's disk as an image in its cloud account

lnk box image create <name> <image> [--hash <hash>] [--yes]
  • --hash, string: A hash of what made it (your setup script, its specs, a lockfile), which lnk box image list --hash and lnk box create --image-hash find it by: lowercase letters, digits and dashes, at most 63
  • image, position 2, string, required: What to call the image: lowercase letters, digits and dashes
  • name, position 1, string, required: The box (lnk box list)
  • --yes, boolean: Say yes to what it would ask

It answers box.said.

lnk box image delete

Delete an image, and its copy of the disk

lnk box image delete <image> [place] [--cloud <cloud>] [--yes]
  • --cloud, string: A cloud account (lnk cloud list)
  • image, position 1, string, required: The image (lnk box image list <cloud>)
  • place, position 2, string: A cloud account (lnk cloud list): short for --cloud
  • --yes, boolean: Say yes to what it would ask

It answers box.said.

lnk box image list

List the images Link made for you in a cloud account

lnk box image list [place] [--cloud <cloud>] [--hash <hash>] [--json]
  • --cloud, string: A cloud account (lnk cloud list)
  • --hash, string: Only the images saved with this hash, newest first
  • --json, boolean: Print the answer as JSON for other programs
  • place, position 1, string: A cloud account (lnk cloud list): short for --cloud

It answers box.images.

Key

lnk box key show

Print Link's SSH key to your boxes, its public half

lnk box key show [--secret-file]

It takes --secret-file, boolean: Print where its secret half is instead, for ssh's -i. It answers box.said.

Size

lnk box size list

List the machines a box could be, best first, making nothing

lnk box size list [place] [--cloud <cloud>] [--json] [--zone <zone>] [--spec <file>] [field flags]
  • --cloud, string: A cloud account (lnk cloud list)
  • --json, boolean: Print the answer as JSON for other programs
  • place, position 1, string: A cloud account (lnk cloud list): short for --cloud
  • --zone, string: A region or zone of the cloud

It reads the box spec, from a file or its field flags. It answers box.sizes.

User

lnk box user add

Let someone SSH into this box as a Linux user of their own, in their sandbox

lnk box user add <name> --public-key <public-key> --sandbox <sandbox> [--yes]
  • name, position 1, string, required: Their user's name: lowercase letters, digits, _ and -
  • --public-key, string, required: Their public key (ssh-ed25519 AAAA...), or its .pub file
  • --sandbox, path, required: Their sandbox's spec (lnk sandbox spec show --help), ~ their home. Its [commands] must let /bin/bash run, which their session is
  • --yes, boolean: Say yes to what it would ask

It answers box.said.

lnk box user list

List this box's users

lnk box user list [--json]

It takes --json, boolean: Print the answer as JSON for other programs. It answers box.users.

lnk box user remove

Remove a user and their key (their folder stays unless asked)

lnk box user remove <name> [--delete-folder]

It takes --delete-folder, boolean: Delete their folder too. It takes name, position 1, string, required: The user (lnk box user list). It answers box.said.