Haven CLI
Haven ships a small command-line tool called haven that lets you
browse and attach to your Haven sessions from any terminal — useful
when you SSH directly into a machine without going through the Haven app.
The CLI and the daemon are the same binary. There is nothing extra to install if you already use the Haven app — the
havencommand is a symlink tohaven-session-daemonplaced next to it at install time. Same 4MB binary, same process model, same auditable source.
Install
1. You already use the Haven app
When Haven connects to a remote host it installs the session daemon at
~/.haven/bin/haven-session-daemon and drops a haven
symlink alongside it. To put haven on your $PATH:
ln -sf ~/.haven/bin/haven ~/.local/bin/haven
On most modern Linux distros ~/.local/bin is already on your
PATH via ~/.profile. If not, add it:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc 2. Standalone (no Haven app)
One-line install script — no root, no system packages, drops the binary
and the haven symlink under ~/.haven/bin/ and
starts the daemon:
curl -fsSL https://haventerminal.com/install-daemon.sh | bash Supports x86_64 and aarch64 Linux. For other platforms or if you'd rather build from source:
git clone https://github.com/christiansafka/haven-daemon
cd haven-daemon
cargo build --release -p haven-daemon
# binary at target/release/haven-session-daemon
ln -sf haven-session-daemon target/release/haven Quick start
The CLI is attach-only: sessions are created from the Haven
app, and haven on a remote host lets you jump back into any of
them. Start with the bare command — it always does the right thing:
haven (no args) | Behavior |
|---|---|
| No sessions | Prints a hint to create one from the app |
| One session | Attaches to it |
| Two or more | Opens the interactive picker |
The full command set:
haven # smart default (see above)
haven ls # list sessions
haven attach <target> # attach by name, index, or id prefix
haven kill <target> # kill a session
haven rename <target> <name>
<target> can be any of: a session name, a 1-based index
from haven ls, or a UUID prefix (minimum 4 characters). So
haven attach 2, haven attach training, and
haven attach 7f3a all work.
The daemon is auto-started on first use. If ~/.haven/daemon.sock
doesn't exist, haven spawns the daemon in the background (its
output goes to ~/.haven/daemon.log) and waits a few hundred
milliseconds for it to bind.
Chord keys (detach, switch, help)
While attached, Haven intercepts a small set of chord-key sequences before
forwarding your keystrokes to the session. The prefix is
Ctrl-\ (Control + backslash). For muscle memory
from tmux, Ctrl-B also works.
| Keys | Action |
|---|---|
Ctrl-\ d | Detach — leave the session running, return to your local shell |
Ctrl-\ s | Switch — open the picker and attach to a different session |
Ctrl-\ ? | Help — show this list as an in-terminal overlay |
Ctrl-\ Ctrl-\ | Send a literal Ctrl-\ to the program inside the session |
If you press the prefix and don't follow it with a bound key within one second, the prefix is dropped and nothing is sent to the session — so a stray keypress never leaves you stuck.
Security model
The haven CLI inherits the daemon's security model exactly,
because it is the daemon. Per-user isolation is enforced by the
Unix filesystem, not by anything the CLI does:
- One daemon per Unix user, sockets under
~/.haven/(mode0700) ~/.haven/daemon.sockis mode0600, owned by you~/.haven/daemon.tokenis a 256-bit random token, mode0600- Every connection presents the token as its first frame or gets dropped
- Other users on the same box cannot even
connect()your socket — the kernel denies it before auth runs - No network ports, no outbound connections, no telemetry
On shared service accounts where multiple humans use the same UID, this filesystem-based isolation does not help — that is an inherent limitation of any per-user daemon.
The CLI is fully open source, same repo and same MIT license as the daemon. Read everything that runs on your machine.
Uninstall
Important: the CLI and the daemon are the same binary,
and all session state lives in ~/.haven/. Removing either one
removes everything, including:
- The daemon and the
havensymlink (same binary) - All running sessions and their encrypted transcripts
- The auth token and socket
- Cached history and scrollback
rm -rf ~/.haven
rm -f ~/.local/bin/haven # if you symlinked it into your PATH
That's the entire uninstall. No system services, no leftover files in
/etc or /var, no config under any other prefix.
Source
Everything described here lives at
github.com/christiansafka/haven-daemon.
The CLI is in the haven-daemon crate (module cli_haven),
the shared attach / chord-key machinery is in the haven-client
crate, and the wire protocol is in haven-protocol. MIT licensed.