TUI Reference
Launch the TUI by running hain with no arguments in an interactive terminal. The TUI provides a full-screen file browser, space management, and real-time sync status.
Launching
hain
On first launch, you’ll be prompted to initialize a vault if one doesn’t exist.
Keyboard shortcuts
Navigation
| Shortcut | Action |
|---|---|
Up / Down | Move selection |
Enter | Open directory or select file |
Backspace | Go to parent directory |
Esc | Dismiss overlay or go up |
Ctrl+Q | Quit |
File operations
| Shortcut | Action |
|---|---|
Ctrl+N | New file |
Ctrl+Shift+N | New folder |
Ctrl+O | Import from filesystem |
F2 or R | Rename selected item |
Delete or D | Delete selected items |
Space | Toggle file selection |
Ctrl+A | Select all |
Ctrl+C / Ctrl+X / Ctrl+V | Copy / Cut / Paste |
E | Edit selected file in terminal editor |
Command palette
| Shortcut | Action |
|---|---|
/ | Open command palette |
@ | Open space switcher |
Ctrl+K or ? | Show keyboard shortcuts |
Ctrl+Shift+S | Show share key |
Screens
File Explorer
The main screen. Shows a breadcrumb path, file list, and status bar. Use the command palette (/) for all operations — creating files, switching spaces, importing content.
Vault Init
Shown on first launch. Prompts for a vault path with tab completion.
Settings
Access via /settings in the command palette. Lets you change the accent color and toggle contextual hints.
Command palette
Press / to open the command palette. It supports three modes:
File mode (default)
Type to search files by name. The palette also recognizes share keys — paste a 64-character hex string and it will offer to join the space.
Quick action buttons at the bottom:
- New file
- New folder
- Import
- Switch space
- Join space
- Create space
- Settings
Command mode (prefix /)
Type / followed by a command name:
| Command | Description |
|---|---|
/touch <name> | Create new file |
/mkdir <name> | Create new folder |
/import <path> | Import from filesystem |
/edit or /e | Edit selected file |
/space-create [name] | Create a space |
/space-join <key> | Join space by share key |
/space-rename <name> | Rename active space |
/space-leave yes | Leave/delete active space |
/space-share | Show share key |
/settings | Open settings |
/details | Toggle details panel |
/help | Show shortcuts |
/accent | Cycle accent color |
Tab completion is available for all commands.
Space mode (prefix @)
Type @ to list all spaces. Fuzzy search to filter. Space indicators:
- Green dot — active space
- Blue dot — private space (single-writer, no sync)
- White dot — shared space (multi-writer, P2P sync)
Status bar
The bottom of the screen shows:
- Active space name and sync mode
- Sync status: “Ready”, “Syncing”, or error
- Connected peer count
- Last sync timestamp
Details panel
Toggle with /details. Shows metadata for the selected file:
- File name and type
- Full path
- Size
- Last modified timestamp