Quick Start

This guide walks you through creating a vault, setting up a space, and syncing files with a collaborator using the TUI. If you’d rather work from the command line, see the CLI equivalents at the bottom.

1. Launch Hain

Run hain in your terminal. With no arguments on an interactive TTY, it opens the TUI.

hain

On first launch you’ll be prompted to pick a vault path. Type or tab-complete a directory like ~/my-vault and press Enter. The TUI opens to the file browser.

2. Create a space

Spaces are isolated workspaces within your vault. Each space syncs independently.

Press / to open the command palette, then run:

/space-create "Team Project"

Your new space is now active. You can see it, and switch between spaces, by pressing @.

3. Show the share key

Press Ctrl+Shift+S — or run /space-share in the palette — to display the share key. It’s a 64-character hex string that identifies your space on the P2P network. Send it to your collaborator through any secure channel.

4. Collaborator joins

On the second machine, after installing Hain, launch the TUI:

hain

Initialize the vault when prompted. Then press / to open the palette and paste the share key — the palette auto-detects 64-character hex strings and offers to join the space.

5. Add files

From the file browser:

Or use the palette:

/touch hello.txt
/import ~/Documents/notes.md

6. Verify sync

New files appear automatically in the collaborator’s file browser. The status bar at the bottom of the screen shows sync state — “Ready”, “Syncing”, connected peer count, and last sync time.

Next steps

Prefer the CLI?

Every TUI action has a CLI equivalent. The same flow from the command line:

hain vault init ~/my-vault
hain context create "Team Project"
hain context share-key

# on the second machine
hain vault init ~/my-vault
hain context join <share-key>

hain file touch /hello.txt
hain file ls /

See the CLI Reference for the complete command set.