메뉴
HN
Hacker News 30일 전

스마트폰으로 PC 터미널·AI 에이전트를 원격 제어하는 'Loopsy'

IMP
7/10
핵심 요약

Loopsy는 스마트폰을 통해 원격으로 노트북의 터미널과 AI 코딩 에이전트(Claude Code, Cursor, Codex 등)를 제어할 수 있는 오픈소스 도구입니다. 포트 포워딩이나 공인 IP 없이 Cloudflare Workers 기반의 자체 호스팅 릴레이 서버를 구축하여 안전하게 연결을 중계하는 것이 특징입니다. 또한 LAN 내 여러 기기를 연결하여 한 컴퓨터의 AI 에이전트가 다른 컴퓨터를 직접 구동할 수 있는 에이전트 간 협업 기능도 제공합니다.

번역된 본문

Loopsy - 당신의 주머니 속 터미널

스마트폰에서 노트북의 Claude Code, Cursor, Codex 또는 모든 셸을 제어하세요. Cloudflare Workers에 자체 호스팅됩니다. macOS · Linux · Windows 지원 → loopsy.dev

사용 방법

1. 노트북에 설치 (모든 OS)

npm install -g loopsy

2. Cloudflare Workers에 자체 릴레이 배포 (~30초 소요, 무료 티어)

npx @loopsy/deploy-relay

워커 이름 및 선택적 커스텀 도메인 입력 프롬프트가 표시됩니다.

출력 결과: https://<본인-릴레이>.workers.dev

3. 데몬을 릴레이에 연결하고 시작

loopsy init loopsy relay configure https://<본인-릴레이>.workers.dev loopsy start

4. 스마트폰 페어링

loopsy mobile pair

스마트폰 카메라로 QR 코드를 스캔하고 4자리 코드를 입력하세요.

5. 스마트폰에서 https://<본인-릴레이>.workers.dev/app 열기

이게 전부입니다. 원하는 에이전트를 선택하고 타이핑하거나 음성으로 입력하면, 노트북이 이를 실행합니다.

작동 방식

┌─────────────┐ ┌──────────────────────┐ ┌─────────┐ │ 노트북 │◄──WSS──►│ Cloudflare Worker │◄──WSS──►│ 스마트폰 │ │ loopsy │ │ Durable Object │ │ /app │ │ 데몬 │ │ (본인 계정) │ │ │ └─────────────┘ └──────────────────────┘ └─────────┘

데몬이 작은 Cloudflare Worker로 아웃바운드 WebSocket을 엽니다. 스마트폰은 동일한 Worker에 연결됩니다. Worker가 두 연결을 서로 이어줍니다. 포트 포워딩, 공인 IP, VPN이 필요 없습니다.

릴레이는 온전히 사용자의 것입니다. 페어 토큰은 HMAC으로 서명되고, 비밀값은 저장 시 SHA-256으로 해시되며, 베어러 토큰은 쿼리 문자열이 아닌 Sec-WebSocket-Protocol 헤더를 통해 전송됩니다.

제공되는 기능

  • 실제 터미널: 완전한 PTY, ANSI, 스크롤백, 크기 조절 지원. TUI가 올바르게 렌더링됩니다.
  • 영구 세션: 탭을 전환하거나, 스마트폰을 잠그거나, 신호가 끊어져도 중단했던 곳에서 다시 시작할 수 있습니다.
  • 음성 입력: Web Speech API를 통해 받아쓰기 후, 전송 전에 편집할 수 있습니다.
  • 세션별 자동 승인: 세션별로 확인 프롬프트(--dangerously-skip-permissions, -y, --full-auto)를 건너뛰도록 선택할 수 있습니다. 기본값은 꺼짐이며, 최초 1회 macOS 확인 대화상자가 나타납니다.

릴레이 자체 호스팅

npx @loopsy/deploy-relay

CLI는 다음을 수행합니다:

  • 워커 이름 및 선택적 커스텀 도메인을 입력받습니다.
  • 새로운 PAIR_TOKEN_SECRET(32바이트 난수)을 생성합니다.
  • wrangler deploy를 실행합니다. 첫 실행 시 OAuth를 위해 브라우저가 열립니다.
  • stdin을 통해 시크릿을 설정합니다(클립보드나 프로세스 인자에 절대 노출되지 않음).
  • 릴레이 URL을 ~/.loopsy/relay.json에 저장합니다.

Cloudflare Workers 무료 티어는 개인 사용에 충분히 커버됩니다. SQLite 기반 Durable Objects 역시 무료 티어에 포함됩니다.

스마트폰 클라이언트

/app의 웹 클라이언트는 설치 없이 iOS Safari 및 Android Chrome에서 작동합니다. 네이티브 iOS 및 Android 앱은 현재 스토어 심사 중입니다.

기능 | 상태 웹 앱 (/app) | ✅ 서비스 중 iOS / iPadOS 네이티브 | ⏳ 앱스토어 심사 중 Android 네이티브 | ⏳ 플레이스토어 심사 중

CLI 스마트폰 제어 명령어

명령어 | 설명 loopsy mobile pair [--ttl <초>] | 페어 토큰 발급. QR 코드와 4자리 확인 코드를 출력합니다. loopsy phone list | 이 기기에 페어링된 스마트폰 목록을 표시합니다. loopsy phone revoke | 서버 측에서 페어링된 스마트폰의 권한을 취소합니다. loopsy relay configure | 데몬이 다른 릴레이를 가리키도록 설정합니다.

데몬 명령어

명령어 | 설명 loopsy init | 설정 파일 및 API 키 생성. loopsy start | 데몬 시작. loopsy stop | 데몬 중지. loopsy status | 데몬 상태 표시. loopsy doctor | 설정, 데몬, MCP, 피어 전반에 걸친 상태 진단. loopsy enable | 로그인 시 자동 시작 활성화 (launchd / systemd / 작업 스케줄러). loopsy disable | 자동 시작 제거.

로그 및 키 명령어

명령어 | 설명 loopsy logs [-f] | 감사 로그 확인. loopsy key show | 현재 API 키 확인. loopsy key generate | API 키 갱신.

LAN 내 에이전트 간 통신

이것이 원래의 Loopsy였습니다. 스마트폰 제어 기능은 그 위에 구축되었습니다. 가지고 있는 모든 기기에서 데몬을 실행하세요. 데몬들은 mDNS를 통해 로컬 네트워크에서 서로를 찾고, 한 번 페어링하면 이후 각 기기가 다른 기기에 일련의 기능을 노출합니다: 명령어 실행, 파일 전송, 공유 키/값 상태 저장 및 읽기, 메시지 송수신.

이러한 동일한 기능은 설치된 AI 코딩 에이전트(Claude Code, Codex CLI, Gemini CLI, Opencode)에 MCP를 통해 노출되므로, 한 기기의 에이전트가 다른 기기를 직접 구동할 수 있습니다.

설정

모든 기기에서 실행

npm

원문 보기
원문 보기 (영어)
Loopsy Your terminal, in your pocket. Control Claude Code, Cursor, Codex, or any shell on your laptop from your phone. Self-hosted on Cloudflare Workers. macOS · Linux · Windows → loopsy.dev Try it # 1. Install on your laptop (any OS) npm install -g loopsy # 2. Deploy your own relay to Cloudflare Workers (~30s, free tier) npx @loopsy/deploy-relay # prompts for worker name + optional custom domain # outputs: https://<your-relay>.workers.dev # 3. Wire the daemon to it and start loopsy init loopsy relay configure https:// < your-relay > .workers.dev loopsy start # 4. Pair your phone loopsy mobile pair # scan the QR with your phone camera, enter the 4-digit code # 5. Open https://<your-relay>.workers.dev/app on your phone That's the whole thing. Pick any agent, type or dictate, the laptop runs it. How it works ┌─────────────┐ ┌──────────────────────┐ ┌─────────┐ │ Laptop │◄──WSS──►│ Cloudflare Worker │◄──WSS──►│ Phone │ │ loopsy │ │ Durable Object │ │ /app │ │ daemon │ │ (your account) │ │ │ └─────────────┘ └──────────────────────┘ └─────────┘ The daemon opens an outbound WebSocket to a small Cloudflare Worker. Your phone connects to the same Worker. The Worker splices the two together. No port forwarding, no public IP, no VPN. The relay is yours: pair tokens are HMAC-signed, secrets are SHA-256 hashed at rest, and bearer tokens travel in Sec-WebSocket-Protocol headers — never query strings. What you get Real terminal. Full PTY, ANSI, scrollback, resize. TUIs render properly. Persistent sessions. Switch tabs, lock your phone, lose signal, pick up where you left off. Voice input. Dictate via Web Speech API, edit before sending. Per-session auto-approve. Opt in to skip confirmation prompts ( --dangerously-skip-permissions , -y , --full-auto ) on a per-session basis. Default: off, with a macOS confirmation dialog the first time. Self-host the relay npx @loopsy/deploy-relay The CLI: Prompts for a worker name and optional custom domain. Generates a fresh PAIR_TOKEN_SECRET (32 random bytes). Runs wrangler deploy — opens your browser for OAuth on first run. Sets the secret via stdin (never appears on your clipboard or in process args). Saves the relay URL to ~/.loopsy/relay.json . Cloudflare Workers free tier covers personal use comfortably. SQLite-backed Durable Objects are also free-tier eligible. Phone client The web client at /app runs on iOS Safari and Android Chrome with no install. Native iOS & Android apps are in submission review. Feature Status Web app ( /app ) ✅ Live iOS / iPadOS native ⏳ App Store review Android native ⏳ Play Store review CLI Phone control Command Description loopsy mobile pair [--ttl <seconds>] Issue a pair token. Prints QR + 4-digit verification code. loopsy phone list List paired phones for this device. loopsy phone revoke <id> Revoke a paired phone server-side. loopsy relay configure <url> Point the daemon at a different relay. Daemon Command Description loopsy init Generate config + API key. loopsy start Start the daemon. loopsy stop Stop the daemon. loopsy status Show daemon status. loopsy doctor Health check across config, daemon, MCP, peers. loopsy enable Auto-start on login (launchd / systemd / Task Scheduler). loopsy disable Remove auto-start. Logs & keys Command Description loopsy logs [-f] View audit logs. loopsy key show Show current API key. loopsy key generate Rotate the API key. Agent-to-agent on a LAN This is the original Loopsy. Phone control was built on top of it. Run a daemon on every machine you own. The daemons find each other on your local network via mDNS, you pair them once, and after that each machine exposes a small set of capabilities to the others: run a command, transfer a file, store and read shared key/value state, send and receive messages. Those same capabilities are also exposed to whatever AI coding agent you have installed (Claude Code, Codex CLI, Gemini CLI, Opencode) through MCP, so an agent on one machine can drive another machine directly. Setup # On every machine npm i -g loopsy loopsy init loopsy start # Pair two machines loopsy pair # on machine A, prints a 6-digit code loopsy pair 192.168.1.50 # on machine B, paste the code Pairing uses ECDH (P-256) with a 6-digit short authentication string that you compare visually. After pairing, restart both daemons; the loopsy_* MCP tools become available to your AI coding agent automatically. If mDNS doesn't reach (cross-subnet, locked-down corp networks), add a peer manually: loopsy peers add 192.168.1.50 MCP tools your agent gets When the Loopsy MCP server is wired into your agent, the agent gains: Tool What it does loopsy_list_peers Enumerate machines on the network with online/offline status. loopsy_peer_status Health check a specific peer. loopsy_execute Run a command on a remote machine. loopsy_session_start / _stop / _list / _remove Long-lived PTY sessions on a peer. Spawn, poll, tear down. loopsy_transfer_file Push a local file to a peer, or pull a peer's file. loopsy_list_remote_files Browse a peer's filesystem (within configured allowed paths). loopsy_context_set / _get / _list / _delete Shared key/value store on a peer. loopsy_broadcast_context Same key/value, written to every online peer at once. loopsy_send_message Protocol-compliant message to a peer's inbox, with envelope, outbox copy, TTL. loopsy_check_inbox Pull pending messages addressed to this machine. loopsy_check_ack / _ack_message Read receipts. What it actually looks like in practice A few real scenarios: Worker machine. I have a Mac Studio sitting in another room. I tell Claude on my laptop, "kick off the iOS build on kai and let me know when it finishes." Claude calls loopsy_session_start against kai with the build command, polls until it exits, and reports back. My laptop stays cool and responsive. Long-running agent tasks on bigger hardware. Spawn a Claude session on the Mac Studio, hand it a multi-file refactor, walk away. Check in from your laptop or phone hours later via loopsy_session_list (or the iOS app's session picker). Multi-agent pipelines. Agent on machine A writes results into loopsy_context_set under a known key. Agent on machine B polls loopsy_context_get and picks up the work. Both agents are blissfully unaware of each other's existence beyond the shared key/value protocol. Pair programming with another developer's machine. They run loopsy peers add <your_ip> , paste API keys, and now both your agents can transfer files and share context. Messaging protocol There's a standard for AI agents to message each other across machines reliably (delivery, ACKs, retries). It uses the context store as the medium so any new machine can join without coordinating clients. Convention: Pattern Stored on Purpose inbox:<recipient>:<msg_id> recipient's machine message addressed to that peer outbox:<msg_id> sender's machine local copy of sent message ack:<sender> sender's machine last message id the recipient processed Full envelope schema, polling intervals, TTL defaults, and the task queue protocol are in AGENTS.md . It works the same whether there are 2 peers or 20. LAN path security LAN agent-to-agent traffic does not go through the relay. Daemons talk directly over your local network. Bearer-auth on every request, API keys exchanged at pair time. If you want the daemon visible on the LAN you have to opt in ( loopsy start --lan ); the default is localhost-only. Security Threat model, read this first Loopsy is a control surface for your own machine, accessed by your own phone, routed through a relay you can self-host. Some sharp edges fall out of that: The relay can read your terminal content. The phone↔daemon connection is TLS-protected on the wire, but TLS terminates at the relay (your own Cloudflare Worker if you self-host, or relay.loopsy.dev if you use the default). Whoever operates that relay can see every byte of PTY input and output, including any password you type at a sudo prompt or any secret a script echoes. End-to-end encryption between phone and daemon is o