Start the Zedra Host daemon to enable remote control from the Zedra mobile app. Checks if zedra CLI is installed, installs it if missing, then launches the daemon and prints a QR code for pairing. Use when the user wants to connect their phone, start zedra, or pair a mobile device.
Launch the Zedra Host daemon so the user can pair their mobile device via QR code.
zedra CLI is installedcommand -v zedra && zedra --help 2>&1 | head -1 || echo "NOT_INSTALLED"
If NOT_INSTALLED, proceed to Step 2. Otherwise skip to Step 3.
zedra CLIAsk the user which installation method they prefer, then run it:
Option A — Pre-built binary (fastest, macOS Apple Silicon):
curl -fsSL https://raw.githubusercontent.com/tanlethanh/zedra/main/scripts/install.sh | sh
cargo install --git https://github.com/tanlethanh/zedra zedra-host
After installation, verify:
zedra --help 2>&1 | head -1
If it fails, check that ~/.local/bin or ~/.cargo/bin is in PATH and advise the user.
zedra status --workdir "." 2>/dev/null && echo "RUNNING" || echo "NOT_RUNNING"
If RUNNING, skip to Step 5 (open terminal on existing daemon).
If NOT_RUNNING, proceed to Step 4.
Start zedra-host in the background. The daemon itself does NOT take --launch-cmd;
the launch command is passed per-terminal via zedra terminal --launch-cmd.
nohup zedra start --workdir "." > /tmp/zedra-start.log 2>&1 &
sleep 3
cat /tmp/zedra-start.log
IMPORTANT: Display the full ASCII QR code from the output to the user. The QR code is essential — the user must scan it with the Zedra mobile app to pair. Also display:
zedra://connect?ticket=)If the log shows errors, diagnose and report them.
After the daemon is running and QR is displayed, open a terminal with the agent resume command so the phone gets a live session immediately (Step 5).
Open a new terminal with --launch-cmd to resume the current agent session.
Pick the right command based on which agent tool is invoking this skill:
| Agent tool | launch-cmd value | How resume works |
|---|---|---|
| Claude Code | claude --resume ${CLAUDE_SESSION_ID} | Resumes exact session by ID |
| Codex | codex resume --last | Resumes most recent session |
| OpenCode | opencode --continue | Continues last session |
| Gemini CLI | gemini --resume | Resumes most recent session |
| Unknown / none | (omit --launch-cmd) | Plain shell |
Detection logic:
${CLAUDE_SESSION_ID} is set and non-empty → Claude Codecommand -v codex succeeds → Codexcommand -v opencode succeeds → OpenCodecommand -v gemini succeeds → Gemini CLI--launch-cmd (plain shell)Claude Code:
zedra terminal --workdir "." --launch-cmd "claude --resume ${CLAUDE_SESSION_ID}"
Codex:
zedra terminal --workdir "." --launch-cmd "codex resume --last"
OpenCode:
zedra terminal --workdir "." --launch-cmd "opencode --continue"
Gemini CLI:
zedra terminal --workdir "." --launch-cmd "gemini --resume"
Report the result to the user.
/zedra:zedra-stop to stop it, or zedra list to see all instances--launch-cmd is per-terminal, not global — only terminals opened with it get the agent session/zedra:zedra-terminal opens additional terminals with agent resume/zedra:zedra-status checks if the daemon is healthy