Last updated: 2026-05-10
Command Reference
hicli pair
Pair with your phone via QR code. This is the main setup command.
hicli pair
What it does:
- Gets your Tailscale IP (fails if Tailscale is not running)
- Checks dependencies: sshd, mosh, tmux
- Configures tmux mouse mode in
~/.tmux.conf - Installs AI tool notification hooks (Claude Code, Codex, Gemini)
- Starts a temporary HTTP server to receive the phone’s SSH public key
- Generates a QR code and waits for scanning (10-minute timeout)
Example output:
Checking Tailscale...
Tailscale IP: 100.64.0.1
Checking dependencies...
✓ sshd is ready
✓ mosh is ready
✓ tmux is ready
✓ Notification hooks installed
Key service: http://100.64.0.1:54321/ssh-key
SSH Connection Info:
Host: 100.64.0.1
Port: 22
Username: alice
Name: macbook-pro
Scan the QR code below with hitermux to add this PC:
Waiting for public key from phone (10min timeout)...
Public key received and added!
→ ~/.ssh/authorized_keys
You can now connect from hitermux!
If dependencies are missing, the command shows platform-specific install commands:
Checking dependencies...
⚠ sshd is not running
⚠ mosh is missing
sshd: sudo systemsetup -setremotelogin on
mosh: port install mosh
Install the missing tools above, then re-run: hicli pair
After pairing, the phone’s SSH public key is added to ~/.ssh/authorized_keys. The QR code contains: TailscaleIP|Port|Username|Hostname|KeyPort.
Tip: If the 10-minute timeout expires, the SSH host info is still saved on the phone. You can re-run
hicli pairto try again.
hicli doctor
Diagnose and auto-fix common configuration issues.
hicli doctor
Checks performed:
| Check | What it verifies | Auto-fixable |
|---|---|---|
| Tailscale | Running and logged in | No |
| Config | ~/.hiterm/config.json permissions (0600) | Yes |
| SSH Service | sshd is listening on configured port | No |
| mosh | mosh binary is installed | Yes (auto-install) |
| Notifications | AI tool hooks are properly configured | Yes |
Example output:
hicli Doctor
✓ Tailscale Running (100.64.0.1)
✓ Config OK (0600)
✓ SSH Service Listening on port 22
✓ mosh Installed (/usr/local/bin/mosh)
✗ Notifications Hooks not installed
4 passed, 1 failed
Found issues that can be auto-fixed. Fix now? [Y/n]
Non-interactive mode: When running in a pipe or CI, doctor skips the fix prompt and only reports issues.
Usage with other commands:
# Run doctor before pairing
hicli doctor && hicli pair
# Run doctor after update
hicli update && hicli doctor
hicli notify
Manage notification features. Notifications are always enabled and push to Android devices via Tailscale.
hicli notify
Running hicli notify without a subcommand shows the current hook status and available commands.
Example output:
Manage hicli notification features.
Notification is always enabled and pushes to Android devices via Tailscale.
AI tool hooks are managed automatically by 'hicli doctor'.
Hook Status:
✓ Claude Code
✓ Codex
✓ Gemini CLI
Usage:
hicli notify [command]
Commands:
hook Handle AI tool hook events (internal)
test Test notification delivery
notify test
Send a test notification to paired Android devices.
hicli notify test
Flags:
| Flag | Description | Default |
|---|---|---|
--title | Notification title | ”HiTerm Test Notification” |
--message | Notification message | ”This is a test notification message” |
Examples:
# Default test
hicli notify test
# Custom message
hicli notify test --title="Build Done" --message="All tests passed"
Example output:
Sending test notification to Android devices...
Found 2 device(s), sending...
Remote notification sent successfully
Test complete
notify hook
Handle AI tool hook events. This command is called automatically by AI tool hooks, not by users directly.
hicli notify hook --tool=<name> --event=<event>
Flags:
| Flag | Description | Values |
|---|---|---|
--tool | Tool name | claude, codex, gemini, or any custom name |
--event | Event type | stop, notification, complete |
How it works:
- Reads JSON from stdin (provided by the AI tool’s hook system)
- Extracts relevant information (last message, project name, etc.)
- Pushes a notification to all paired Android devices
- Outputs
{}to stdout (required by hook protocol)
stdin JSON format:
The hook reads a JSON object from stdin. Fields vary by tool:
{
"cwd": "/path/to/project",
"hook_event_name": "Stop",
"last_assistant_message": "The task is complete...",
"completion_reason": "end_turn",
"notification_type": "tool_use",
"message": "Tool execution finished",
"details": {
"tool_name": "bash"
}
}
| Field | Used by | Description |
|---|---|---|
cwd | All | Working directory, used to extract project name |
hook_event_name | Gemini | Hook event identifier |
last_assistant_message | Claude, Codex | Last message from the AI (truncated to 200 chars) |
completion_reason | Claude | Why the session ended |
notification_type | Claude, Gemini | Type of notification event |
message | Claude, Gemini | Notification message text |
details.tool_name | Claude, Gemini | Tool that triggered the event |
last-assistant-message | Codex | Last message (Codex uses hyphenated key) |
input-messages | Codex | Array of input messages |
Supported tools and events:
| Tool | Events | Data extracted |
|---|---|---|
| Claude Code | stop, notification | Last assistant message, notification type, tool name |
| Codex | notification, complete | Last assistant message, input messages |
| Gemini CLI | stop, notification | Session end reason, notification type |
Manual configuration for unsupported tools:
Any tool that supports running a command on events can use hicli. The hook command format:
<hicli-path> notify hook --tool=<name> --event=<event>
Example for Cursor (.cursor/settings.json):
{
"hooks": {
"Stop": [{
"hooks": [{
"type": "command",
"command": "<hicli-path> notify hook --tool=cursor --event=stop"
}]
}],
"Notification": [{
"matcher": "*",
"hooks": [{
"type": "command",
"command": "<hicli-path> notify hook --tool=cursor --event=notification"
}]
}]
}
}
Note: Replace
<hicli-path>with the actual path to the hicli binary (runwhich hiclito find it).
hicli update
Update hicli to the latest version.
hicli update
Download sources (priority order):
- GitHub Releases (default) — better global CDN
- HiCloud Mirror (yinbin.ink) — fallback for mainland China
Flags:
| Flag | Description | Default |
|---|---|---|
--check | Only check for new version, don’t install | false |
--source | Primary download source: github or hicloud | github |
--version | Install a specific version (GitHub only) | (latest) |
--skip-verify | Skip SHA256 checksum verification | false |
Examples:
# Check for updates without installing
hicli update --check
# Force HiCloud mirror (for China mainland)
hicli update --source=hicloud
# Install a specific version
hicli update --version=v0.9.0
# Skip checksum verification
hicli update --skip-verify
Example output:
Current version: v0.9.0
Checking for updates...
Latest version: v1.0.0
New version available: v0.9.0 → v1.0.0
Downloading...
✓ Download complete (8.2 MB)
Verifying file integrity...
✓ Verification passed
Updating...
✓ Update successful
How the update works:
- Checks the latest version from the primary source
- If the primary source fails, automatically falls back to the other
- Downloads the binary for your platform (
os/arch) - Verifies SHA256 checksum (unless
--skip-verify) - Replaces the current binary (old version backed up as
.old) - Removes the backup on success
hicli uninstall
Completely uninstall hicli.
hicli uninstall
What it removes:
- Config directory (
~/.hiterm/) - AI tool notification hooks (from Claude Code, Codex, Gemini settings)
What it does NOT remove:
- The hicli binary itself (you must delete it manually)
- Tailscale or its configuration
- mosh, tmux, or sshd
Example output:
Are you sure you want to uninstall hicli? This cannot be undone. [y/N]: y
Removing notification hooks...
Deleting config files...
✓ hicli uninstalled
Note: You need to manually delete the binary:
rm /Users/alice/.local/bin/hicli
Global Flags
| Flag | Short | Description |
|---|---|---|
--help | -h | Show help information |
--version | -v | Show version information |
# Show version
hicli --version
# Show help for any command
hicli pair --help
hicli notify --help
Configuration File
Path: ~/.hiterm/config.json
Permissions: 0600 (owner read/write only)
{
"version": "1.0",
"pc_info": {
"hostname": "macbook-pro",
"platform": "darwin",
"arch": "arm64",
"os_version": "14.0",
"username": "alice",
"ssh_port": 22,
"ssh_username": "alice"
},
"notify": {
"tools": ["claude", "codex", "gemini"]
},
"services": {
"systemd_enabled": false,
"launchd_enabled": false,
"service_name": "hicli",
"install_path": ""
}
}
Field descriptions:
| Field | Description |
|---|---|
pc_info.hostname | Display name shown on Android app |
pc_info.ssh_port | SSH port (default: 22) |
pc_info.ssh_username | SSH username (default: system username) |
notify.tools | List of AI tools with installed hooks |
services.* | System service configuration (managed by doctor) |
Note: You normally don’t need to edit this file manually.
hicli pairandhicli doctormanage it automatically.
See Also
- Quick Start — Get started in 3 steps
- PC Installation — Detailed install guide
- Troubleshooting — Common issues and solutions