Slice · AI prompt
Native React + Svelte terminal: mock shell, live exec adapter, and host-injected interactive PTY.
# Install `os-terminal` — Terminal — shell emulator with live passthrough + PTY seam
> Native React + Svelte terminal: mock shell, live exec adapter, and host-injected interactive PTY.
📚 Knowledge base : https://resource.rahmanef.com/llms.txt
📦 Slice detail : https://resource.rahmanef.com/slices/os-terminal
🧠 JSON catalog : https://resource.rahmanef.com/api/knowledge?slice=os-terminal
🔗 Source : https://github.com/rahmanef63/resource-site/tree/main/frontend/slices/os-terminal
## 1. Install
```bash
npx rahman-resources add os-terminal
# alias: npx rr add os-terminal
```
The CLI copies `frontend/slices/os-terminal/` into your project + augments `.env.example` + installs npm deps automatically. Run it from your project root.
## 2. What it ships
- npm: `lucide-react`
- shadcn primitives: `button`
## 3. Wire it up
Run `npx rr add os-terminal` for React/default or `npx rr add os-terminal --framework sveltekit` for native Svelte 5. Mount <Terminal /> in a height-bearing box; mock mode is zero-backend. Wire configureTerminal({ mode:"live", fs, exec, sys }) for real host truth. Optionally configurePty({ transport, screen }) for an interactive shell; createSsePtyTransport() ships the os-vps SSE transport shape while the host owns the VT renderer. React-only osTerminalApp remains a convenience descriptor and is not invented for Svelte.
## Rules of engagement
- shadcn-only UI primitives. No raw `<button>` / `<dialog>` / native date or file inputs.
- 200-line hard cap per source file (extract neighbours when over).
- All Convex queries hit an index (`.withIndex(...)`); never bare `.collect()`.
- Public mutations/queries declare `args:` validators + authz.
- Full ruleset: https://resource.rahmanef.com/best-practice
The agent will fetch /llms.txt for the full ruleset and use /api/knowledge for the JSON catalog.