Official website: cretli.com
Cretli is an open-source self-hosted PWA for remote coding and vibe coding with AI agents. Use it from your phone: terminal, prompts, diffs, and interactive widgets — talking to your own PC over HTTPS.
Backends: Cursor SDK, OpenRouter, and OpenCode. Multiple devices can share the same session live.
Status: early/experimental (
v0.2.0). The server exposes a full shell — read SECURITY.md before putting it on a network.Cretli is not affiliated with Anysphere or Cursor. “Cursor” is a trademark of its respective owners. See NOTICE.
Code and steer agents on the go without sitting at a desk. Install the PWA on your phone; the live terminal and chat stay on your PC.
Trigger prompts, review tool calls and diffs, and manage sessions over a lightweight web UI — Cursor SDK, OpenCode, or OpenRouter.
Bring your own API keys for Claude, GPT, or open-source models. OpenCode (local / Zen) and Cursor SDK are first-class alternatives.
No cloud workspace. The server runs on your machine. Default bind is localhost; LAN is opt-in. Read SECURITY.md before exposing it.
- Workspaces come from Settings: a
.code-workspacefile or folders you add yourself (no Cursor file required). Folder enable/disable is saved in Cretli settings immediately. Sync re-reads Cursor files on demand. - Terminal — a PTY (
node-pty) running your shell in the workspace CWD, rendered with xterm.js. One PTY per session; output is broadcast to every connected client. - Chat — an agent in the same workspace, rendered as a rich HTML view (tool calls,
markdown, plan/agent mode). Choose one harness per chat:
- OpenCode — local
opencode serve+ Zen (or your OpenCode auth) - OpenRouter — OpenRouter API + server-side workspace tools
- Cursor SDK — optional
@cursor/sdk(Cursor API key + Cursor ToS) - CodeBuddy — optional
@tencent-ai/agent-sdkplus thecodebuddyCLI
- OpenCode — local
- Tasks / Files / Git / Todo — VS Code tasks, workspace tree, git actions, lightweight todos.
- Same live view on every device: the in-app link/QR points at the LAN URL.
- Node.js 22.13+ (see
enginesinpackage.json) - Chat needs one backend (see Chat backends below). Terminal and files work with no API keys.
git clone https://github.com/cretli/cretli.git
cd cretli
npm install
npm run build:front:prod # build the SPA into public/dist
npm start # binds 127.0.0.1, HTTPSOpen https://localhost:3011. On first run you will be redirected to /login to
set the access password.
Without HTTPS: USE_HTTPS=0 npm start → http://localhost:3011.
Docker (host port published to localhost only):
export CRETLI_SETUP_TOKEN="$(openssl rand -hex 16)"
docker compose up --build
# then open https://localhost:3011 and paste CRETLI_SETUP_TOKEN on first-run setupSee docs/INSTALL.md for Linux, macOS, WSL2, and LAN/HTTPS.
Configure at least one path. Settings → Harness shows which backends are ready.
- Install the OpenCode CLI (or rely on the optional
opencode-ainpm package). - Set
OPENCODE_API_KEY(Zen) or runopencode auth loginon the host — also available in Settings. - Create a chat with harness OpenCode. First run may take 1–2 minutes while
opencode servestarts.
Details: docs/opencode/SETUP.md.
- Set
OPENROUTER_API_KEY(or paste it in Settings → Harness). - Create a chat with harness OpenRouter.
npm installalready tries to install optional@cursor/sdk. If you skipped optional deps:npm install @cursor/sdk.- Set
CURSOR_API_KEY(or Settings). Cursor CLI is needed for scheduled.cursor/agentsruns. - Create a chat with harness Cursor SDK.
Using Cursor API/CLI is subject to Cursor Terms of Service. MIT here covers only Cretli source code.
- Install the CodeBuddy CLI and optional
@tencent-ai/agent-sdk. - Set
CODEBUDDY_API_KEY(or Settings → Harness → CodeBuddy). - Create a chat with harness CodeBuddy.
Details: docs/codebuddy/SETUP.md.
- Default bind is 127.0.0.1 (localhost only). LAN is opt-in:
npm run start:lanorCRETLI_BIND=0.0.0.0. - Binding beyond localhost without a password requires
CRETLI_SETUP_TOKENor the process refuses to start (no first-run race on LAN). - Do not expose this directly to the Internet. Use a VPN or SSH tunnel.
The app ships a web manifest and a service worker. Add to Home Screen on a phone (or install in desktop Chromium). Live data (terminal/chat) always goes to the running server.
npm run gen-cert
# or set SSL_IP to your LAN address, then: node scripts/generate-ssl-cert.js
npm startOn the phone open https://<lan-ip>:3011 and accept the self-signed cert warning.
All variables are optional. Copy .env.example to .env — npm start
loads it automatically (Node's native --env-file). Highlights:
| Variable | Default | Purpose |
|---|---|---|
PORT |
3011 |
HTTP/WS port |
CRETLI_BIND |
127.0.0.1 |
Bind host (0.0.0.0 for LAN) |
CRETLI_SETUP_TOKEN |
— | Required for first-run setup when bound beyond localhost |
USE_HTTPS |
1 (via npm start) |
HTTPS with data/key.pem+cert.pem |
WORKSPACE_FILE |
cretli.code-workspace if present |
Optional default .code-workspace (you can also add folders in Settings) |
WORKSPACES_SCAN_DIR |
parent of the current workspace | Seed/sync scan root for *.code-workspace files |
CRETLI_DATA_DIR |
data |
Where chats, settings, auth and certs are stored |
CRETLI_LAN_HOST |
auto | Host used in the in-app link/QR |
OPENCODE_API_KEY |
— | OpenCode Zen key |
OPENROUTER_API_KEY |
— | OpenRouter chat |
CURSOR_API_KEY |
— | Cursor SDK chat |
AGENT_CALLBACK_TOKEN |
— | Required for agent callbacks when exposed on LAN |
Legacy CURSOR_REMOTE_* aliases still work. Documented names are CRETLI_*.
Runtime data lives in data/ (gitignored).
| Cretli | OpenCode TUI | code-server | Open WebUI | |
|---|---|---|---|---|
| Phone PWA + shared live session | yes | no | IDE in browser | chatbot UI |
| Full PTY terminal | yes | TUI only | yes | no |
| Pluggable agent backends | OpenCode / OpenRouter / Cursor | OpenCode | extensions | models |
| Self-hosted on your PC | yes | yes | yes | yes |
- HTTP —
public/, REST API (workspace, chats, settings, files, git, todos). - WebSocket —
/ws(terminal),/ws-agent-sdk(chat rooms for all harnesses). - Backend — Node.js, Express,
node-pty,ws, optional@cursor/sdk. - Frontend — SPA in
app_front/(webpack →public/dist/).
docs/ARCHITECTURE.md · docs/MULTI-INSTANCE.md
PRs and issues are welcome. See CONTRIBUTING.md and the
Code of Conduct. Run npm test before opening a PR.
Suggested starter tasks are listed in CONTRIBUTING.
MIT — see NOTICE for third-party terms (@cursor/sdk is proprietary
and optional).

