Emre Kurt — A full-stack developer in Antalya, building fast and accessible web products.

ekurt.dev, Now in Your Terminal

This site has a Terminal app. Open it and you get ekurtsh, a little shell over the site's real content: ls the projects, cat about-me.md, play bugsweeper. It was always the most "me" corner of the OS, so the obvious next step was to let it leave the browser.

npx ekurt

That's the whole install. With Node.js 22 or newer, it boots the way this site does — the e_ mark, a progress bar, skip it with any key — and leaves you at a prompt:

visitor@ekurt ~ % ls
blog/
projects/
about-me.md
bookmarks.txt
cv.pdf

Same files, same commands, same colours. This post is about what changed on the way, and the parts that took longer than they should have.

One source of truth

The CLI doesn't have its own copy of anything I would have to keep up to date by hand. A sync script reads this site's repository — the posts, the projects, the about text, the bookmarks — and applies the same rules the site does: drafts stay out, a title like REACT106 - … puts a post in the React series, project covers are lifted out of the text. Run it, publish a new version, and both shells say the same thing.

The only hand-written pieces are the CV and an about text reworded for a terminal. "Drag the windows around" reads oddly when there are no windows.

What a real terminal adds

In the browser, cat on a blog post shows a summary and a link: the window next to it is a much better reader. In a terminal there is no window next to it, so the CLI does the job itself. cat renders whole posts and project pages from markdown: wrapped to the width of your terminal, with lists, tables and highlighted code. At the end of every lesson it tells you which file comes next, so you can work through a whole series without leaving the prompt.

A few things only make sense there:

  • cv prints the résumé, and npx ekurt --export md writes it to a file.
  • search looks through projects, posts and bookmarks at once.
  • Every command works on its own. npx ekurt cat about-me.md prints the page and exits, and the output pipes cleanly into whatever you like.
  • contact is the Mail app as a prompt: name, email, a few lines of message, send. It goes through the same endpoint as the form on this site.

Games on the alternate screen

Bugsweeper and Memory from the Arcade play right in the terminal, with the arrow keys. The rules are the exact same module as on the site; only the drawing is new. Cells are three characters wide, because terminal cells are roughly twice as tall as they are wide, and three characters make a cell look square.

They run on the terminal's alternate screen, the same trick vim and less use. Quit a game and your scrollback is exactly as you left it. The tricky part is handing the keyboard over. The shell reads lines with Node's readline, and merely pausing it isn't enough: it would still see every keypress, and arrow keys meant for the game would end up in the prompt's history. So the shell steps aside completely. Its input closes while a game runs, and a fresh one with the same history takes over when it ends.

The first version also had the board drifting sideways whenever the status line below it changed length, because everything was centred on the widest line. Now it is centred on the board itself, and the text can do what it likes.

The small things

  • Ctrl+C behaves like a shell. It prints ^C, drops the line, and gives you a fresh prompt. Inside the contact form it discards the message instead.
  • Tab completes commands, then files and options. cd b and Tab gives you blog/.
  • Typos get a suggestion. Type about-me.md on its own and the shell asks if you meant cat about-me.md.
  • Links are clickable in terminals that support it; everywhere else they stay plain text instead of turning into escape-code soup.
  • panic still works. You'll see.

Publishing it

This was my first package on npm, and the last step held a surprise. Publishing needs two-factor authentication now, and right after a successful publish, the registry showed a placeholder called 0.0.0-stage instead of my package. It turns out npm processes a new package for a few minutes before it goes live. It was there five minutes later, and nothing had gone wrong; I just looked too early.

If you have a terminal open, give it a try:

npx ekurt

And if you're reading this in the Terminal app here, type install — it will tell you the same thing.