A Terminal-Style Link Page
November 4, 2026
I published me.sotamisaki.com on November 5, 2026. It is a link page — the kind of thing that usually lists a few buttons — except it is a fake terminal. You type ls, cat links.txt, open github, or run something silly like sl and matrix.
It is a toy, but a few parts of it are reusable ideas. This post walks through them.
What it is
- A single static page built with Astro, Tailwind CSS 4 and plain TypeScript (no React)
- Deployed to Cloudflare Workers (static assets) on a custom domain
- About 1,200 lines of TypeScript for the shell, with about 60 commands
- Everything runs in the browser. There is no server code and no backend
Try help first. Then ls, cat readme.md, tree, neofetch, links.
One data tree, two interfaces
The part I like most: the files you see with ls are also real files on the web.
// src/data/files.ts
export const files = {
"readme.md": "# Sota Misaki ...",
"links.txt": "GitHub https://github.com/...",
projects: { /* one .md per project */ },
}
The shell reads this tree for ls, cat and cd. A single catch-all route turns the same tree into static files at build time:
// src/pages/[...path].ts
export const getStaticPaths = (() =>
flatFiles().map(([path, body]) => ({ params: { path }, props: { body } }))
) satisfies GetStaticPaths
export const GET: APIRoute = ({ props }) =>
new Response(props.body + "\n", {
headers: { "content-type": "text/plain; charset=utf-8" },
})
So cat links.txt in the terminal and curl https://me.sotamisaki.com/links.txt always return the same thing. There is no second copy to keep in sync, and people who prefer curl to a browser get a clean plain-text answer.
Two small details make this work well:
- Markdown shows in the browser. Browsers tend to download
.mdfiles. A_headersrule on Cloudflare setsContent-Type: text/plain; charset=utf-8for/*.md, so they render inline. - Plain text, not HTML. Returning
text/plainmeans scripts, CLIs and AI agents can read the files without parsing markup.
ask: on-device AI grounded in open data
The most experimental command is ask. It answers questions about me using the AI model built into Chrome, so nothing is sent to an AI API.
❯ ask what does Sota work on?
It uses Chrome’s Prompt API (LanguageModel), which runs Gemini Nano locally. The flow:
- Fetch my open data from
https://sotamisaki.com/data/me.json. - Turn it into prompt sections in priority order: profile, experience, skills, projects, blog posts.
- Create a session with that text as the system prompt, and tell the model to use only those facts and say “I don’t know” otherwise.
- Stream the answer back into the terminal.
A few lessons from building it:
- Context is small. On-device models have a limited context window. I try a descending list of budgets (14,000 → 9,000 → 6,000 → 3,500 → 2,000 characters) and cut the lowest-priority sections until session creation succeeds and leaves enough room for the question and the answer. Order your data by importance before you truncate it.
- Check
inputUsageagainstinputQuota. A session can be created and still have almost no room left. I discard sessions that use more than 70% of their quota. - Streaming differs between builds. Some versions stream chunks, others stream the whole text so far. A one-line check (
value.startsWith(acc)) handles both. - Pick the output language up front. The Prompt API wants
expectedOutputslanguages declared. I detect Japanese characters in the question and setjaorenaccordingly. - Always feature-detect. If
LanguageModeldoes not exist, the command prints a hint instead of failing. First use may download the model, so I show the download progress.
The model can still be wrong, so every answer ends with a note that it was generated on-device and may be inaccurate. Grounding it in structured data makes it much better than asking a model with no context, but it is not a guarantee.
To try it you need desktop Chrome with the Prompt API and Gemini Nano available. Other browsers just show the hint.
Small things I enjoyed
/ultrafast. The intro text types itself out. There is a toggle (also?ultrafastin the URL) that speeds it up and turns the label into a rainbow. The choice is remembered inlocalStorage, andprefers-reduced-motionskips the animation entirely.qrandavatar.qrdraws a QR code of the page in the terminal usingqrcode-generator, which is handy for handing the page to someone next to you.- Terminal-style focus. Keyboard focus rings follow the terminal look, so tabbing around stays visible and accessible.
- Real commands, real data.
pinganddigperform actual HTTPS round-trips and DNS-over-HTTPS lookups instead of printing fake output.cracker, on the other hand, is animation only, and says so. - Plain Astro, no framework. The page is static HTML plus one script. It loads quickly and there is nothing to hydrate.
Tips if you want to build your own
- Start from a single source of truth. Define your links and profile once, and derive the terminal, the plain-text files and the metadata from it.
- Publish plain-text versions. It costs one catch-all route and makes the site useful to scripts and AI tools.
- Respect motion and keyboard users. Gate animation on
prefers-reduced-motionand give interactive elements a visible focus style. - Treat on-device AI as progressive enhancement. Feature-detect, show progress, and have a graceful message when it is unavailable.
- Budget your prompt. Prioritize your data, then trim from the bottom until it fits.