A TUI encyclopedia via SSH where every word is a link.
Inspired by Wikipedia and also the Library of Babel
TUI
- Terminal interface is build using OpenTUI by Anomaly
- Uses the React bindings for components and react patterns
- Connecting with the AI/LLM services by AI-SDK by Vercel
- Written in the beautiful TypeScript by Google
SSH Server
- Uses the amazing wish by charm to serve the TUI over SSH.
- Written in Go
Connect to a publicly served instance:
ssh mono.lucawang.me -p 23234Important
In case you haven't used SSh before:
Generate one with:
ssh-keygen -t ed25519 -N ""
(Press ENTER at all prompts.)
- Tab: Switch focus between input and article
- Arrow Keys / Vim keys (hjkl): Navigate article
- Enter: Submit selected word
- Shift+R: Random word
- Escape: Clear search (when in input)
- ` (backtick) / Ctrl+L: Toggle console
- Bun v1.3.10
- Go v1.26.1
- Set up .env (env is loaded automatically, by the godotenv package and bun natively)
- root directory:
- AI_GATEWAY_API_KEY (your Vercel's AI gateway Key)
- HOST
- PORT
- TUI_ENTRY e.g. packages/tui/dist/@mono/tui-darwin-arm64/bin/mono depending on your machines architecture
- packages/tui/
- AI_GATEWAY_API_KEY (your Vercel's AI gateway Key)
- root directory:
bun installgo mod tidy
For server:
bun run dev:sshdFor TUI-only:
cd packages/tui
bun run devbun run buildServer-Out: /bin directory contains the TUI-Out: packages/tui/dist contains the binaries for the different architectures.
The output of the build is in the /bin directory. Run the executable and you should be ready to go.
Possible breaking points:
- Firewall
- No permision to mount to the host
- Conflicting with other ssh services
- Permission misconfiguration
- No SSH Keys
- And lastly no .env file
If you use a new user for each app (which is good), you'll need to create them first:
useradd --system --user-group --create-home myapp/etc/systemd/system/myapp.service:
[Unit]
Description=Mono
After=network.target
[Service]
Type=simple
User=mono
Group=mono
WorkingDirectory=/home/mono/mono
EnvironmentFile=/home/mono/mono/.env
ExecStart=/home/mono/mono/bin/sshd
Restart=on-failure
[Install]
WantedBy=multi-user.target# need to run this every time you change the unit file
sudo systemctl daemon-reload
# start/restart/stop/etc:
sudo systemctl start myapp