siinghd/codeshot

Self-hostable beautiful code screenshots with shareable permanent links

★ 0Forks 0CSSGitHub ↗Compare

README

codeshot

Paste code, pick a theme and background, get a shareable image. Like Carbon, but self-hosted and with permanent share links.

What it does

  • Renders code with syntax highlighting and a chosen background, padding, window chrome, and font size
  • POST /api/share saves the snippet config to SQLite and returns a short ID
  • GET /s/:id re-renders the same snippet from any device (the page injects the saved config as window.__SHARED_SNIPPET__)
  • Open Graph meta tags are generated server-side so links unfurl in chats

Stack

Bun + Hono server, bun:sqlite for snippet storage, static HTML/JS frontend in public/.

Run it

bun install
bun run dev   # or: bun run start

Then open http://localhost:3300.

Notes

  • No env vars required.
  • SQLite db at codeshot.db next to server.ts. Created on first run.

Contributors

siinghd

Issues