<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Matt Venables</title><description>A humble Astronaut’s guide to the stars</description><link>https://venabl.es</link><item><title>Give Herdr macOS keyboard shortcuts with Ghostty</title><link>https://venabl.es/herdr-macos-shortcuts</link><guid isPermaLink="true">https://venabl.es/herdr-macos-shortcuts</guid><description>Remap Herdr&apos;s keybindings to native macOS chords in Ghostty so you don&apos;t need a cheat sheet.</description><pubDate>Fri, 17 Jul 2026 00:00:00 GMT</pubDate><content:encoded>&gt; [!NOTE] I recommend just learning the Herdr prefix (`ctrl+b`) and skipping all
&gt; of this. Herdr is great out of the box.

I got tired of keeping a cheat sheet open for [Herdr](https://herdr.dev)&apos;s
keyboard shortcuts, so I made them match the macOS native shortcuts: `cmd+t` for
a new tab, `cmd+w` to close, `cmd+d` to split, `cmd+1..9` to jump workspaces.

It&apos;s just two changes. First, in your Ghostty config, map the native chords to
the sequences Herdr listens for (`\x02` is Herdr&apos;s `ctrl+b` prefix):

```
# ~/.config/ghostty/config

# macos/chrome-style herdr actions
keybind = cmd+KeyT=text:\x02t
keybind = cmd+t=unbind
keybind = cmd+KeyN=text:\x02n
keybind = cmd+n=unbind
# cmd+w closes the focused pane; cmd+shift+w force-closes the whole tab
keybind = cmd+KeyW=text:\x02x
keybind = cmd+w=unbind
keybind = cmd+shift+KeyW=text:\x02W
keybind = cmd+shift+w=unbind

# rename: cmd+r -&gt; tab, cmd+shift+r -&gt; workspace
keybind = cmd+KeyR=text:\x02T
keybind = cmd+r=unbind
keybind = cmd+shift+KeyR=text:\x02N
keybind = cmd+shift+r=unbind

# splits: cmd+d vertical, cmd+shift+d horizontal
keybind = cmd+KeyD=text:\x02v
keybind = cmd+d=unbind
keybind = cmd+shift+KeyD=text:\x02-
keybind = cmd+shift+d=unbind

# zoom active pane
keybind = cmd+shift+enter=text:\x02z

# pane navigation: cmd+opt+hjkl
keybind = cmd+alt+KeyH=text:\x02h
keybind = cmd+alt+KeyJ=text:\x02j
keybind = cmd+alt+KeyK=text:\x02k
keybind = cmd+alt+KeyL=text:\x02l

# pane cycling: cmd+[ prev, cmd+] next
keybind = cmd+left_bracket=text:\x02i
keybind = cmd+right_bracket=text:\x02u

# cmd+1..9 -&gt; herdr workspaces
keybind = cmd+1=text:\x1b[49;6u
keybind = cmd+2=text:\x1b[50;6u
keybind = cmd+3=text:\x1b[51;6u
# ...through cmd+9
```

Then, in your Herdr config, remap a few keys to match the chords above:

```toml
# ~/.config/herdr/config.toml

[keys]
prefix = &quot;ctrl+b&quot;

new_tab = &quot;prefix+t&quot;
new_workspace = &quot;prefix+n&quot;
close_tab = &quot;prefix+shift+w&quot;
rename_workspace = &quot;prefix+shift+n&quot;
cycle_pane_previous = &quot;prefix+i&quot;
cycle_pane_next = &quot;prefix+u&quot;
```

Gist here: https://gist.github.com/venables/1b634058f9f4eafe1327d73930a3d3cd</content:encoded></item><item><title>Cleaning up after your agents with wt done</title><link>https://venabl.es/wt-cleanup</link><guid isPermaLink="true">https://venabl.es/wt-cleanup</guid><description>Updates to wt: &apos;wt done&apos; to finish a branch in one command, a &apos;wt cleanup&apos; picker that shows how stale each worktree is, and hooks that run your setup on create.</description><pubDate>Mon, 15 Jun 2026 00:00:00 GMT</pubDate><content:encoded>![wt cleanup picker](./wt-cleanup.png)

Quick follow-up to [`wt`](https://github.com/venables/wt), my git worktree
wrapper.

Run a few agents in parallel for a week and you end up with a drawer full of
worktrees. Some merged, some abandoned, a couple you forgot you made.

So the last round of updates is about the rest of a worktree&apos;s life: tearing
them down cleanly when you&apos;re done, and running your own setup on the way in.

## wt done

This is the one I reach for constantly. You&apos;re finished with a branch, the PR&apos;s
merged, you want out:

```sh
wt done
```

It removes the worktree you&apos;re standing in and drops you back in main, in the
right directory, with no path to type and no `cd`. If there are uncommitted
changes it&apos;ll stop and tell you, or `wt done -f` to force it.

That covers 90% of cleanup, right when you finish each branch.

## wt cleanup

For the other 10%, the worktrees you didn&apos;t `wt done` out of, there&apos;s the
periodic sweep. `wt cleanup` used to show a flat list and ask you to type index
numbers, so you were kinda guessing which ones were safe to delete.

Now it opens an interactive picker. Arrow keys to move, space to toggle, enter
to confirm. And every row tells you how stale the worktree is:

- whether the branch is merged into main
- how many commits ahead and behind main it sits
- when it last changed

```
Select worktrees to remove (merged pre-checked; space toggles, enter confirms)

  ✓ merged     old-spike      ↑0 ↓42  3 weeks ago     ../myrepo-old-spike
  ✓ merged     fix/login      ↑0 ↓11  6 days ago      ../myrepo-fix-login
  • unmerged   wip/billing    ↑3 ↓2   20 minutes ago  ../myrepo-wip-billing
```

Merged branches come pre-checked, since a branch that&apos;s already in main is the
safe one to drop. So most of the time you just hit enter. The unmerged stuff,
like the one you touched 20 minutes ago, you leave alone unless you toggle it
on.

The picker is built on [`gum`](https://github.com/charmbracelet/gum) from Charm.
Install `wt` with Homebrew and gum comes along for the ride. Grab it some other
way and cleanup falls back to the old numbered prompt, same staleness columns,
you just type the numbers.

## Hooks, on both ends

The first post copied your `.env` files into a new worktree. Now you can run
real commands. Drop an executable script at
`~/.config/wt/hooks/post-worktree-add` and `wt` runs it right after creating the
worktree:

```sh
# ~/.config/wt/hooks/post-worktree-add
#!/usr/bin/env bash
set -euo pipefail
cd &quot;$WT_PATH&quot;
pnpm install --frozen-lockfile
```

So `wt feature/login` can hand you a worktree that&apos;s ready to run. Install deps,
trust your mise config, seed a scratch database, whatever the repo needs to
boot.

There are matching hooks on the way out too (`pre-` and `post-worktree-remove`),
so `wt done` and `wt cleanup` can tear down whatever you set up. Each hook gets
`WT_PATH`, `WT_BRANCH`, `WT_REPO_ROOT`, and `WT_REPO_NAME` in its environment.

## Upgrade

```sh
brew upgrade wt
```

Run `wt doctor` to confirm gum got picked up.

[Repo&apos;s on GitHub.](https://github.com/venables/wt)</content:encoded></item><item><title>Your Agent Still Needs an Identity. But the Reason Has Changed.</title><link>https://venabl.es/your-agent-still-needs-an-identity</link><guid isPermaLink="true">https://venabl.es/your-agent-still-needs-an-identity</guid><description>People started running their agents on their home computers. Now how the hell do we tell them apart?</description><pubDate>Wed, 11 Feb 2026 00:00:00 GMT</pubDate><content:encoded>_A follow-up to
[Your Agent Needs an Identity. And It Should Be Decentralized.](https://venabl.es/your-agent-needs-an-identity)_

---

A few months ago, I wrote about
[why AI agents need decentralized, cryptographic identity](https://venabl.es/your-agent-needs-an-identity).
My argument was simple: agents are going to be acting on your behalf across the
internet, so they&apos;ll need a way to prove who they are without leaking your
personal information.

I still believe all of that. But the way people run agents has changed, and so
has the reason they need an identity.

## My agent is me

When I wrote that post, the mental model was: your agent runs in the cloud,
talks to APIs, and acts _on your behalf_. It needs credentials, permissions, and
identity (everything to prove it should be there) because it&apos;s operating
remotely and autonomously, in cloud environments that don&apos;t know you.

That was the trajectory. And for enterprise and cloud-native agents, it still
is.

But what actually happened (and I didn&apos;t see this coming) is that agents started
running on your Mac Mini at home, logged into your browser, using your cookies,
your OAuth tokens, your everything. They act _as you_.

![On the internet, nobody knows you&apos;re a lobster.](nobody-knows-youre-a-lobster.png)

[OpenClaw](https://openclaw.ai) is probably the best example of this shift. It
runs on your machine, connects to your messaging apps, browses the web in your
browser sessions, reads your files, and manages your calendar, all with your
existing credentials. It didn&apos;t wait for an identity layer, it just shipped. And
it works well because it sidesteps the identity problem entirely. Your agent
doesn&apos;t need to prove it&apos;s allowed to use your Gmail, because it&apos;s already
logged in. **As far as Gmail can tell, it _is_ you.**

[Claude Code](https://docs.anthropic.com/en/docs/claude-code) and a growing pile
of similar tools do the same thing: agents inherit their operator&apos;s identity by
default.

It&apos;s pragmatic, and in hindsight, inevitable. Why would every service on the
internet drop everything to support agents natively, especially while the
definition of &quot;agent&quot; keeps changing? So here we are.

## But Your Agent Still Needs an Identity

Running as you works fine with 1 agent. But once you have more than one, &quot;it was
me&quot; stops being a useful answer.

### Cryptographic Guardrails

Right now, if your agent is running with your credentials, it can do _anything
you can do_. It can send emails, delete files, make purchases, and post on
social media, with no way to scope any of it down.

Cryptographic identity fixes this. Give your agent a keypair, issue it signed
credentials that scope its permissions, and now it can&apos;t accidentally spend
money because it can&apos;t sign the transaction. The agent can&apos;t escalate its own
permissions because it can&apos;t forge the signature. Least privilege, enforced by
math instead of a config file.

And if the credential is _bound_ to the agent with a cryptographic proof, then
even if the agent fumbles the credential and exposes it, nobody else can use it.

### The Audit Trail

If you&apos;re running one agent, identity is simple: you know who did it.

When you have two or three (a coding agent, a personal assistant, something
monitoring your email), things get murky. Which one sent that message? Which one
made that API call that burned through your rate limit? OpenClaw alone can spawn
sub-agents for different tasks. When you&apos;ve got multiple agents using the same
credentials, &quot;show me the receipts&quot; becomes a real need.

And once agents start touching money (making purchases, managing subscriptions,
executing transactions), you need a clear, auditable trail of which agent did
what, when, and under what authority. At that point, identity infrastructure
like [ACK-ID](https://www.agentcommercekit.com/ack-id/introduction), or
something like it, becomes a painkiller instead of a vitamin.

## SSL: Yes, that analogy again

In my original post, I compared agent identity to SSL certificates for the web.
That comparison holds up even better now.

SSL didn&apos;t launch with the web. The early web was plaintext everything: HTTP,
not HTTPS. And it worked fine until people started shopping online, entering
passwords, and sending sensitive data. Then SSL went from &quot;nice to have&quot; to &quot;the
browser literally won&apos;t let you visit this site without it.&quot;

Agents are in their HTTP era right now. Everything runs on ambient trust: your
credentials, your machine, your implicit authorization. And it works great.
OpenClaw users are busy getting things done, and agent identity isn&apos;t keeping
them up at night.

But agents are about to start doing commerce: making purchases, managing money,
and coordinating with other agents they&apos;ve never met. Your agent will need to
verify that it&apos;s dealing with Amazon&apos;s agent and not a phishing agent. Amazon&apos;s
agent will need to verify that your agent is allowed to make purchases on your
behalf. At that point, ambient trust stops being enough.

The tools for this already exist. It&apos;s just cryptography (keypairs and
signatures, the same primitives we already use for everything else), and
protocols like ACK-ID package it up for agents. We just need to start using
them.

## What I Think Happens Next

Bear with me while I speculate a bit, I&apos;m only an oracle-in-training. Here&apos;s how
I imagine it goes down:

**Short term (now):** Agents continue running locally with ambient credentials.
Identity is implicit. The ecosystem grows fast because there&apos;s zero friction.

**Medium term:** Multi-agent setups become common. People want audit trails,
permission scoping, and the ability to tell their agents apart. Local identity
(even if it&apos;s just &quot;this agent has a keypair and signs its actions&quot;) starts to
matter. Agent runtimes begin building this in.

**Long term:** Cloud-based agents explode. Personal agents will still run
locally, but corporate agents won&apos;t be running on Mac Minis. Agent-to-agent
communication scales up. The external trust problem from my original post comes
roaring back, but now there&apos;s a foundation of local identity to build on.

In my original post, I got the order wrong. I assumed agents would need identity
_first_, before they could operate. Instead, they started operating and identity
is catching up, which is how the internet has always worked.

## So ... keypairs?

Your agent still needs an identity, and the cryptography behind it is simpler
than it sounds. Under the jargon (DIDs, VCs, W3C specs), it&apos;s just keypairs and
signatures.

Give your agent a keypair, have it sign its actions, and scope its permissions
with signed credentials. That gets you an audit trail on your own machine today,
and something to build on when your agents start dealing with the rest of the
internet.

We&apos;re in a golden age of agent development, one we&apos;ll look back on with
nostalgia, but your agents are running around wearing your clothes. Sure, it&apos;s
pragmatic for now, but soon we&apos;ll want to know which one is which.

---

_At [Catena](https://catena.com), we&apos;re building agent-native financial
infrastructure on top of the [Agent Commerce Kit](https://agentcommercekit.com).
The identity layer,
[ACK-ID](https://www.agentcommercekit.com/ack-id/introduction), is built for
exactly this shift: from local agent identity to internet-scale trust. If you&apos;re
building in this space, [let&apos;s talk](https://catena.com/)._</content:encoded></item><item><title>wt: A Git Worktree Helper</title><link>https://venabl.es/wt</link><guid isPermaLink="true">https://venabl.es/wt</guid><description>A simple wrapper for managing git worktrees, built for running multiple coding agents in parallel.</description><pubDate>Wed, 21 Jan 2026 00:00:00 GMT</pubDate><content:encoded>Git worktrees are having a moment. With tools like
[Claude Code](https://code.claude.com), [opencode](https://opencode.ai), and
[Amp](https://ampcode.com), you can run multiple coding agents in parallel. But
they step on each other&apos;s toes when they run in the same directory (and I&apos;m
looking for maximum efficiency here!)

Git worktrees are a clean way to give each agent its own space, but they suffer
from a major problem: they don&apos;t copy over `.env` (and other gitignored) files,
so you can&apos;t test the changes without some manual setup.

So I created a git worktree wrapper called
[`wt`](https://github.com/venables/wt).

![wt git worktree helper](./wt.png)

## What it does

```sh
# Create a worktree for an existing branch
wt feature/login

# Worktree ends up at ../myproject-feature/login
```

It handles the path for you and copies over everything that was in your
`.gitignore`. Worktrees live at `../&lt;repo&gt;-&lt;branch&gt;`, which keeps them organized
and out of the way. And you can have it auto-cd you into the new worktree
directory, too.

A few other commands:

```sh
# List worktrees
wt ls

# Clean up
wt rm feature/login
```

## .worktreeinclude

Building on what Claude Desktop (oddly not Claude Code, yet) and Cline already
promote, `wt` supports a `.worktreeinclude` file, which is the same format as
`.gitignore` but allows you to copy over just a subset of items.

Create a `.worktreeinclude` file to specify what gets copied:

```
.env
.env.local
```

If the file doesn&apos;t exist, `wt` falls back to copying everything in `.gitignore`
that exists in the source worktree. If you don&apos;t want any files copied, you can
always opt-out with `--no-copy`.

## Bonus: Even more speed

Add a `wtc` function to your `.zshrc` or `.bashrc` that creates a worktree and
launches Claude Code in one go:

```sh
wtc() { wt &quot;$@&quot; &amp;&amp; claude; }
```

## Install

```sh
brew install venables/tap/wt
```

[Check out the repo on GitHub.](https://github.com/venables/wt)</content:encoded></item><item><title>Your Agent Needs an Identity. And It Should Be Decentralized.</title><link>https://venabl.es/your-agent-needs-an-identity</link><guid isPermaLink="true">https://venabl.es/your-agent-needs-an-identity</guid><description>The internet is going agent-native. Identity and trust need to scale with it.</description><pubDate>Sat, 27 Sep 2025 00:00:00 GMT</pubDate><content:encoded>By the time ChatGPT launched at the end of 2022, nearly half of all internet
traffic was driven by bots[^1]. And today, we&apos;ve already blown past that number.

Now, fast forward a few years and it&apos;s not hard to imagine how this story goes:
as more and more people bring AI agents into their lives, the lion&apos;s share of
traffic on the internet will be automated. Some of these agents will work
directly with you on your phone, and others will run behind the scenes while you
sleep.

And these agents will talk to each other. Your scheduling agent will work with
your shopping agent, and both of them will negotiate with outside agents and
services.

Call them agents, bots, or clankers. Either way, the internet will become more
of an agent-to-agent network than a human-to-human one.

![On the Internet, nobody knows you&apos;re an agent](./nobody-knows-youre-an-agent.png)

## Proving Who You Are

When agents start operating at this scale, doing real work and making real
transactions, they&apos;re going to need to prove who they are. They&apos;ll need to prove
it to you (so you know you&apos;re talking to your own agent and not a phony), and to
every service they interact with. They&apos;ll often also need to prove that they&apos;re
not working for a bad actor.

Humans solve this with social constructs: driver&apos;s licenses, social security
numbers, credit scores, the whole bureaucratic apparatus. These are workarounds
we created because we can&apos;t do cryptography in our heads.

But agents are computers, and computers are pretty damn good at signing and
verifying cryptographic messages. They don&apos;t get signature fatigue like we do,
so they won&apos;t sign away valuable assets out of laziness. They can verify every
signature, every time.

## Why Centralized Systems Won&apos;t Scale

It&apos;s tempting to think we need one big, centralized identity system for all
these agents. I&apos;ve talked to a few BigCos who think this is the answer. But the
internet doesn&apos;t work that way.

The internet doesn&apos;t have a single point of control. When one ISP goes down,
traffic routes around the failure. The architecture is distributed and
decentralized by design, because it has to handle global scale and stay up when
parts of it fail.

Agent identity needs to work the same way. It has to be internet-native,
globally scalable, and decentralized. Any centralized approach will become a
bottleneck, a security risk, or both. Verifying an agent&apos;s identity shouldn&apos;t
depend on some centralized API&apos;s rate limits, uptime, or license agreement.

The only way to make identity work at internet scale is to decentralize it, with
**open standards that _anyone_ can tap into**, like Verifiable Credentials
([VCs](https://www.w3.org/TR/vc-data-model-2.0/)) and Decentralized Identifiers
([DIDs](https://www.w3.org/TR/did-1.0/)). These work as globally-unique,
verifiable, and self-controlled usernames, profiles, and permission slips.
They&apos;re already in use and growing: social apps like
[BlueSky](https://bsky.social/about) are built on DIDs via the
[AT Protocol](https://atproto.com/), while governments and traditional
OpenID/OAuth companies are issuing VCs via
[OIDC4VC](https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0.html).

These decentralized, cryptographic &quot;proofs&quot; let any agent prove that they have
permission to do something, that they have done something in the past, that they
have a specific attribute, or that they are operating on behalf of a person or
business, all while respecting the owner&apos;s privacy.

## Privacy by Design

No agent should ever leak their owner&apos;s personally identifiable information
(PII). Sounds pretty obvious when you say it out loud, but you&apos;d be surprised at
how much of your personal information is sent in plaintext every day.

The only way to guarantee that an agent can&apos;t leak your information is to never
give it to them in the first place. With **cryptographic trust chains** built on
Verifiable Credentials, agents can prove they&apos;re authorized to act and that
their owner is legitimate, without exposing any personal information.

When you visit Amazon.com, your browser shows you a lock icon and you know
you&apos;re on the real Amazon website. Behind that icon is a whole set of
cryptographic operations and proofs that your browser went through to verify
that this website is Amazon&apos;s and not an imposter. But it doesn&apos;t need to give
you Jeff Bezos&apos;s address to prove it.

Emerging protocols like
[ACK-ID](https://www.agentcommercekit.com/ack-id/introduction) do the same thing
for agents. It&apos;s like SSL for agents. Recipients can verify they&apos;re dealing with
a legitimate agent backed by a verified owner, **all in a legally compliant
way**, while the agent owner&apos;s privacy stays protected. When regulations require
more information (e.g., in payments), the owner can share only the minimum
details needed.

This beats identity systems that rely on names and static identifiers. Your
9-digit social security number has almost certainly leaked already, and anyone
who has it can pretend to be you. A cryptographic identity is close to
impossible to fake.

![I am agent spartacus](./i-am-spartacus.png)

## Why Now

Agent traffic is about to explode across the internet. Gartner predicts that
within 3 years, a third of user experiences will shift from native applications
to agentic front ends[^2].

Today&apos;s identity systems weren&apos;t designed for this new wave of actors. So we
have a rare chance to build global identity infrastructure correctly, after
decades of &quot;Equifax leaked 143 million social security numbers&quot; and &quot;sorry, your
identity was stolen because we stored everything in plaintext.&quot; That means
cryptographic proof that can&apos;t be faked, verifiable credentials based on open
standards, and a decentralized architecture with no central database to attack.

Given where things are heading, decentralized agent identity is a requirement.
We can build it on purpose now, or wait for yet-another centralized identity
failure to force it on us.

At [Catena](https://catena.com), we&apos;ve been building this kind of infrastructure
on top of the [Agent Commerce Kit (ACK)](https://agentcommercekit.com). The
identity layer, [ACK-ID](https://www.agentcommercekit.com/ack-id/introduction),
creates verifiable links between agents and their owners using these
cryptographic standards.

The agents are coming, and they need an identity system that works at internet
scale, protects their owners&apos; privacy, and lets them do business with each
other. Let&apos;s build it right.

[^1]:
    [Imperva Bad Bot Report 2025](https://www.imperva.com/resources/gated/reports/2025-Bad-Bot-Report.pdf)

[^2]:
    [Gartner Predictions Aug 26, 2025](https://www.gartner.com/en/newsroom/press-releases/2025-08-26-gartner-predicts-40-percent-of-enterprise-apps-will-feature-task-specific-ai-agents-by-2026-up-from-less-than-5-percent-in-2025)

---

_We&apos;re building agent-native financial infrastructure at
[Catena](https://catena.com/). If you&apos;re building in this space, we should
talk._</content:encoded></item><item><title>Key Repeat for Vim in Cursor</title><link>https://venabl.es/key-repeat-in-cursor-vim</link><guid isPermaLink="true">https://venabl.es/key-repeat-in-cursor-vim</guid><description>How to enable key-repeat on MacOS in Cursor for tools like VSCode Vim</description><pubDate>Tue, 14 Jan 2025 00:00:00 GMT</pubDate><content:encoded>&gt; [!NOTE] This post is primarily a reminder for myself for when I set up a new
&gt; laptop.

I love vim (and neovim). But I also love the niceties of a modern editor,
especially ones with AI agents built-in, like [Cursor](https://cursor.com).

![The agents are in the computer?](./ai-agents-in-the-computer.jpg)

But using Vim keybindings on MacOS and Cursor (or VSCode) needs a bit of
tweaking. Specifically, you have to enable key-repeat so you can hold a key to
move around.

Here&apos;s how to do it:

```sh
defaults write $(osascript -e &apos;id of app &quot;Cursor&quot;&apos;) ApplePressAndHoldEnabled -bool false
```</content:encoded></item><item><title>Type-safe API Routes in Next.js</title><link>https://venabl.es/type-safe-api-routes-in-nextjs</link><guid isPermaLink="true">https://venabl.es/type-safe-api-routes-in-nextjs</guid><description>Introducing &apos;typed-route-handler&apos;, the easiest way to add type-safety to Next.js Route Handlers</description><pubDate>Tue, 09 Jan 2024 00:00:00 GMT</pubDate><content:encoded>Since the release of Next.js 14, I&apos;ve been moving all of my products (old and
new) to the app directory and Server Components. It&apos;s been fun, with its fair
share of bumps in the road. But one of my favorite new features is **Route
Handlers**. Built on web standards, these handlers let you return _anything_
from a route: a JSON API response, an image, a stream, React Components...
_anything_!

But all that flexibility comes with very few guard-rails. These handlers are
minimal by default, and since you can return anything from them, there&apos;s no
contract that you&apos;re responding with the right thing, or even responding at all.
And if you are responding with something, is it what you promised?

## The missing API features for Next.js

So I built `typed-route-handler`, a small node module for Next.js Route
Handlers. With a couple of lines, you get a type-safe API endpoint, automatic
validation handling, and request logging and timing.

Here&apos;s a minimal example of how it works:

```ts
import { handler } from &quot;typed-route-handler&quot;

type ResponseData = {
  result: string
  over: number
}

export const GET = handler&lt;ResponseData&gt;((req) =&gt; {
  // This response must match ResponseData
  return NextResponse.json({
    result: &quot;this response is type-checked&quot;,
    over: 9000
  })
})
```

Or, a more complete example with URL parameter types:

```ts
import { handler } from &quot;typed-route-handler&quot;

import { auth } from &quot;@/auth&quot;

type ResponseData = {
  result: string
  over: number
}

type Context = {
  params: {
    id: string
  }
}

/**
 * GET /api/articles/:id
 */
export const GET = handler&lt;ResponseData, Context&gt;(async (req, context) =&gt; {
  // If the user is not authenticated, we can call `unauthorized()` which will
  // automatically be caught by the handler, and respond with an HTTP 401.
  const session = await auth()
  if (!session) {
    unauthorized()
  }

  // `context` is type-safe here
  const article = findArticle(context.params.id)

  // This response must match ResponseData
  return NextResponse.json({
    result: &quot;this response is type-checked&quot;,
    over: 9000
  })
})
```

## Going further with zod

I use `zod` for schema validation all the time, and wanted to bring some of that
to `typed-route-handler`.

If you use zod within a handler, any validation errors get caught and returned
to the client as a `400 Validation Error`. This works even if you don&apos;t specify
any return types. For example:

```ts
import { z } from &quot;zod&quot;

const bodySchema = z.object({
  name: z.string().min(3),
  age: z.number()
})

/**
 * POST /api/settings
 */
export const POST = handler(async (req) =&gt; {
  // Any parsing error here will throw a Validation Error
  const { name, age } = bodySchema.parse(await req.json())

  return NextResponse.json({
    ok: true
  })
})
```

You can use zod with route parameters, search params, and pretty much everything
else, and `typed-route-handler` will handle it.

## Making your APIs better

While building this, I realized it was **the missing API endpoint layer for
Next.js**. Wrapping my existing API routes with `handler` gave me a handful of
basic features that I&apos;d expect Next.js to ship with:

- **Response type-checking:** Make sure your API endpoints are honoring their
  side of the contract.
- **Request Parameter type-checking:** Your route can be defined with a `zod`
  schema, so you can validate and coerce URL parameters. You can validate that a
  token is a uuid/cuid, or coerce an ID to a number.
- **Deep `zod` compatibility:** When you call a zod schema&apos;s `parse` method
  within a handler, any exceptions are caught and returned as a
  `400 Validation Error`
- **Helpful error methods:** Following Next&apos;s `notFound()` standard, we exposed
  `unauthorized()` (HTTP 401) and `validationError()` (HTTP 400) methods, which
  are of type `never` so they can be used anywhere in the handler.
- And, at a more basic level, I get request logging and timing.

## Give it a try

```sh
npm i typed-route-handler

# or better yet:
pnpm add typed-route-handler
```

[Check out the README for more examples](https://github.com/venables/typed-route-handler),
and let me know what you think.

The code is MIT-licensed and free to use. As always, pull requests and
improvements are welcome!</content:encoded></item><item><title>Say hello to npx hello</title><link>https://venabl.es/npx-hello</link><guid isPermaLink="true">https://venabl.es/npx-hello</guid><description>Introducing &apos;npx hello&apos;, the easiest way to browse GitHub profiles from the command line.</description><pubDate>Mon, 20 Nov 2023 00:00:00 GMT</pubDate><content:encoded>If you&apos;re anything like me, you spend your entire day in and out of the
terminal. And, often you want to learn more about the developers behind some of
your favorite code. But that requires the immense effort of opening up a browser
and going to GitHub and looking through their profile.

Suffer no more, my friend. Because today, I put together a tiny, fun npm package
called [`hello`](https://www.npmjs.com/package/hello) which lets you browse
Github profiles directly from the command line. Now you have one less reason to
leave the terminal.

The package is intentionally limited and simple. Just type: `npx hello` followed
by a Github username and it will print out a summary of the user&apos;s profile,
including their name, bio, location, and links to their website, Twitter, and
Github.

For example, my profile:

```sh
npx hello venables
```

![npx hello venables](./npx-hello.png)

## But ... why?

I reserved the `hello` name a long time ago, and never found a good use for it.
At first, it was going to be a websocket-based web framework (think: a node.js
version of rails that runs entirely via sockets), but the world has plenty of
frameworks. Then I thought it would be a good name for a package that will just
print &quot;Hello, world!&quot; in a random language. But that&apos;s not very useful outside
of maybe a demo or two.

So the name sat there, unused, until today.

While browsing Github profiles for candidates at [Catena](https://catena.com)
(psst: **We&apos;re hiring!**), the thought occurred to me: **wouldn&apos;t it be great if
everyone had a consistent CV?** And even better, it should be accessible via the
command line! So, I tossed together v0 of this project.

Check out the [source code](https://github.com/hello-js/hello) if you&apos;re
interested. It&apos;s a simple Typescript project built from the
[`startkit typescript`](https://github.com/startkit-dev/typescript) starter
template.</content:encoded></item><item><title>This stack</title><link>https://venabl.es/stack</link><guid isPermaLink="true">https://venabl.es/stack</guid><description>How this site is built.</description><pubDate>Sat, 04 Nov 2023 00:00:00 GMT</pubDate><content:encoded>**Update (Oct 15 2025):** This site is now running on Cloudflare instead of
Vercel.

I&apos;m always curious about the tech stack for products I use daily. Sometimes the
most wonderful user experiences are backed by the wildest tech choices (but,
like I&apos;ve said before, an ugly backend that ships is better than a perfect
backend that nobody sees).

For my personal site (this site), I&apos;ve changed stacks several times over the
years. It started retro with static HTML, then I migrated it to Ruby using
Jekyll, then to Javascript with Gatsby, then to TypeScript with Next.js. But
once I discovered Astro, I knew it&apos;d be the perfect match for me.

### Tech used:

- [Astro](https://astro.build) using Typescript, hosted on
  [Cloudflare](https://cloudflare.com). You can&apos;t beat Astro for content sites.
  It has it all built-in, and bundles everything into a tiny package.
- [Tailwind CSS](https://tailwindcss.com) for styling. Nothing compares.

The stack couldn&apos;t be simpler, thanks to Astro.

---

**Previous stack, circa 2023-&gt;2024:**

- [Next.js](https://nextjs.org) using Typescript, hosted on
  [Vercel](https://vercel.com). I don&apos;t care that Vercel is &quot;expensive&quot;, it&apos;s a
  dream to work with. And Next for building static content, like it was
  originally intended. The dream.
- [StartKit](https://startkit.dev) for the Next.js boilerplate, running on
  CloudFlare. I wrote it, so I&apos;m biased. But it got me running quickly and lets
  me git pull the latest and greatest with no headaches.
- [Tailwind CSS](https://tailwindcss.com) for styling. I have too much love for
  Tailwind.
- [Contentlayer](https://contentlayer.dev) for markdown content. I previously
  used [MDX](https://mdxjs.com) directly but Contentlayer was just too easy to
  use.

I once wrote that &quot;we&apos;ve gone too far&quot; with all the tech needed to host a static
site like this. I still believe that to an extent, but I love to write in
[markdown](https://daringfireball.net/projects/markdown/), and I love how this
site is built.

So I may be a hypocrite, but I&apos;m a happy hypocrite.</content:encoded></item></channel></rss>