Slice · AI prompt
React terminal: 17 built-ins on an in-memory fs, arrow-key history — wire exec for real one-shot shell passthrough.
# Install `os-terminal` — Terminal — shell emulator with live passthrough + PTY seam
> React terminal: 17 built-ins on an in-memory fs, arrow-key history — wire exec for real one-shot shell passthrough.
📚 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`
## 3. Wire it up
Stack: Next 16 + React 19 + Tailwind 4 + shadcn/ui. Shell emulator with optional live passthrough. Fully client-side by default.
STEP 1 — Install. `npx rr add os-terminal`. Ensure `@/features/os-terminal` resolves and Tailwind scans the slice folder.
STEP 2 — Deps. npm: `lucide-react`. No shadcn components required.
STEP 3 — Mount. `<Terminal />` in a height-bearing box — mock mode runs entirely on the in-memory FsModel. Or register `osTerminalApp` in an appshell manifest.
STEP 4 — Go live. `configureTerminal({ mode:"live", fs:{list,read,write,mkdir,remove,move,copy}, exec:{run} })`. In live mode ls/cat read through your fs, mutations mirror, and unknown commands hit exec.run (one-shot; treat the endpoint like SSH).
## 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.