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 lives at a folder on disk and syncs independently.
Press / to open the command palette, then run:
/new-space "Team Project"
Hain picks a folder for the space under your vault. If you’d rather point Hain at a folder you already have, run /designate-space instead and choose the path. Hain runs a safety scan over the folder before binding it, so private keys and other sensitive files surface as findings you can acknowledge or exclude.
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 /share-key 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:
Ctrl+N— new fileCtrl+Shift+N— new folderCtrl+O— import from your filesystem
Or use the palette:
/new-file 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
- TUI Reference — keyboard shortcuts, screens, and the full command palette
- CLI Reference — full command documentation for scripting
- FAQ — common questions
Prefer the CLI?
Every TUI action has a CLI equivalent. The same flow from the command line:
hain vault init ~/my-vault
hain space create "Team Project"
hain space share-key
# on the second machine
hain vault init ~/my-vault
hain space join <share-key>
hain file touch /hello.txt
hain file ls /
To bind an existing folder as a space instead of letting Hain pick the path, use hain space designate <path>. See the CLI Reference for the complete command set.