{
  "id": 16708693,
  "title": "Building a K Command Palette (and a Fake Terminal) for My Portfolio",
  "url": "https://urgent.news/2026/10/27/building-a-k-command-palette-and-a-fake-terminal-for-my-portfolio",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-27T05:00:02.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/asimplecode/building-a-k-command-palette-and-a-fake-terminal-for-my-portfolio-4976"
  },
  "original_language": "en",
  "account": "Pressing ⌘K or Ctrl+K on the site brings up a search box that can jump to a variety of pages, including case studies, games, blog posts, or Dota 2 heroes. Similarly, pressing ~ opens a terminal, although it's not a necessity. These features give the developer's site a more personal touch.\n\nThe functionality for both features relies mainly on logic, with React used sparingly. They are built using pure functions that take in lists like posts, heroes, and work, and output a flat list of objects containing information like group, label, URL, and keywords. The items are then filtered based on a user's query.\n\nThe terminal feature is built using a switch statement with a personality, where commands like help, ls projects, and play chess perform actual actions. Commands like sudo remind the user that simplicity is non-negotiable, and exit works as expected. The terminal also uses the site's dark theme tokens, ensuring it looks consistent without any out-of-place colors.\n\nThe terminal's history, tab completion, and clear command are functional, and it records anonymous usage events to track whether users are actually utilizing it. The recorded information includes the command word, unless it's something unknown, in which case it's marked as other. This way, even if someone types a sentence into the terminal, it remains within their browser.\n\nTo see these features in action, go to simplecode.ca, press ⌘K and type chess, or press ~ and type help. If you have any suggestions for additional commands, feel free to share.",
  "summary": "Press ⌘K (or Ctrl+K) anywhere on my site and you get a search box that jumps to any page, case study, game, blog post or Dota 2 hero. Press ~ and you get a terminal. Neither is essential. Both are the kind of detail that makes a developer's site feel like it was made by a developer. Here's how they're built, and the few decisions that kept them simple. Logic first, UI second Both features are…",
  "key_points": [
    "⌘K and ~ shortcuts open search box and terminal",
    "Pure functions generate flat list of objects for features",
    "Terminal commands perform actions, track usage anonymously"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}