Ttyd

From NazmusSayad/.dotfiles · View interactive version

Ttyd is an AI agent skill from the GitHub repository NazmusSayad/.dotfiles. Opens a terminal in the browser. Use when a shell needs to run in a browser tab.

How to use this skill

Skill file

Start a server

Run the command below from the directory the terminal should open in, in the background, and note its PID. If port 7681 is taken (check with lsof -nP -iTCP:7681 -sTCP:LISTEN), add -p <free port>. Do not stop, restart or reuse a ttyd server you did not start.

ttyd -i 127.0.0.1 -W \
  -t fontFamily="FiraCode Nerd Font" -t fontSize=14 -t lineHeight=1.35 -t cursorStyle=bar -t disableLeaveAlert=true \
  -t 'theme={"background":"#1E2227","foreground":"#ABB2BF","cursor":"#FFFFFF","selectionBackground":"#FFFF00","selectionForeground":"#000000","black":"#4A4F5A","red":"#EE5D69","green":"#97C775","yellow":"#B68353","blue":"#61AFEF","magenta":"#C678DD","cyan":"#56B6C2","white":"#CCCCCC","brightBlack":"#616A7B","brightRed":"#FE808A","brightGreen":"#C2DEAD","brightYellow":"#D1A47A","brightBlue":"#93CFFF","brightMagenta":"#E0A8F1","brightCyan":"#82D2DC","brightWhite":"#FFFFFF"}' \
  env -i HOME="$HOME" USER="$USER" LOGNAME="$LOGNAME" SHELL=/opt/homebrew/bin/bash TMPDIR="$TMPDIR" SSH_AUTH_SOCK="$SSH_AUTH_SOCK" \
  LANG=en_US.UTF-8 TERM=xterm-256color COLORTERM=truecolor \
  /opt/homebrew/bin/bash -lc 'exec bash -i' >/tmp/ttyd.log 2>&1 &

Open http://127.0.0.1:<port>. When done, stop only your server with kill <PID>.

Why the command looks like this

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.