Docs· Reference

The lifo-sh CLI

View as Markdown
bash
npx lifo-sh [command] [options]
npm install -g lifo-sh     # adds `lifo-sh`, and from 0.11 also `lifo`

Node.js 20+. lifo-sh --help prints this list; lifo-sh --version the version. Guide: In your terminal.

Boxes

lifo-shan interactive shell in a new box; the box ends with the shell
lifo-sh newa box that keeps running, attached now (Ctrl+D detaches)
lifo-sh --detacha box that keeps running, in the background; prints its id
lifo-sh listrunning boxes
lifo-sh attach <id>a shell in a running box
lifo-sh attach <host>:<port>the same, over TCP (a box started with --port)
lifo-sh stop <id>stop a box

Options for lifo-sh, new and --detach:

--mount <dir>, -ma folder on this machine at /mnt/host (default: a new temp folder)
--expose <port>[:<hostPort>]publish a box port on 127.0.0.1 (hostPort defaults to port); repeatable; WebSockets included
--port <tcp>with --detach or new: also accept attaches over TCP, on every interface, without authentication

Snapshots

lifo-sh snapshot save <id> [--output <file>]save a running box (default ~/.lifo/snapshots/<id>-<time>.tar.gz)
lifo-sh snapshot restore <file> [--mount <dir>]a new box from a snapshot, attached; mounts --mount, else the original folder if it exists, else a temp folder
lifo-sh snapshot listsaved snapshots

lifo.sh

lifo-sh login [--base-url <url> | --local] [--no-browser]log in through the browser; --no-browser only prints the link and asks for the code
lifo-sh whoamiwho's logged in, and to which site
lifo-sh logoutforget the login and revoke its key
lifo-sh tunnel <port> [--name <name>]put localhost:<port> on a public URL; see Tunnels
lifo-sh cloud push <name> [--port N] [--start cmd]run the current folder on Lifo Cloud (as /home/user/app, without .git); lifo-sh cloud pull <name> saves it as .tar.gz; lifo-sh cloud shell <name> opens a shell there, like ssh; lifo-sh cloud stats <name> and lifo-sh cloud usage show what it used; see Cloud boxes (preview)

Inside a box it starts

git, vi, nano and less are available; tunnel <port> and lifo tunnel <port> share the box's own port; the CLI's login is passed in (LIFO_AUTH_TOKEN, LIFO_BASE_URL).

Files

~/.lifo/sessions/running boxes
~/.lifo/snapshots/saved snapshots
~/.lifo/auth.jsonlogins, one per site

Edit this page on GitHub