Building a PHP CLI for humans and AI agents with almost no hand-written code original

by Freek Van der Herten – 6 minute read

We recently released the Flare CLI, a command-line tool to manage your errors and performance data. It also ships with an agent skill that lets AI coding agents use Flare on your behalf.

The CLI has dozens of commands and hundreds of options, yet we only wrote four commands by hand. Our laravel-openapi-cli package made this possible: point it at an OpenAPI spec, and it generates fully typed artisan commands for every endpoint automatically.

Here's how we put it all together.

Read more

Let your AI coding agent fix your errors and review performance original

by Freek Van der Herten – 4 minute read

The Flare CLI lets you manage errors and performance monitoring from the terminal. It was built with almost no hand-written code, generated from our OpenAPI spec. Having a CLI is useful on its own, but where it gets really interesting is when you let an AI coding agent use it.

The Flare CLI ships with an agent skill that teaches AI agents like Claude Code, Cursor, and Codex how to interact with Flare on your behalf. Let me show you how it works.

Read more

Join 9,500+ smart developers

Get my monthly newsletter with what I learn from running Spatie, building Oh Dear, and maintaining 300+ open source packages. Practical takes on Laravel, PHP, and AI that you can actually use.

"Always fresh, useful tips and articles. Carefully selected community content. My favorite newsletter, which I look forward to every time."

Bert De Swaef — Developer at Vulpo & Youtuber at Code with Burt

No spam. Unsubscribe anytime. You can also follow me on X.

Introducing the Flare CLI original

by Freek Van der Herten – 4 minute read

At Flare, we track errors and monitor performance for your applications. Until now, that meant opening the Flare dashboard in your browser whenever you wanted to check on things.

We just released the Flare CLI, a command-line tool that lets you manage your errors, projects, and performance monitoring data directly from the terminal. It also ships with an agent skill that lets AI coding agents like Claude Code and Cursor use Flare on your behalf. And the fun part: the entire CLI was built with almost no hand-written code, generated from our OpenAPI spec.

Let me walk you through how to install and use the CLI.

Read more

Adding a custom status line to Claude Code original

by Freek Van der Herten – 2 minute read

Claude Code has a nice little feature called the status line that lets you add a custom bar at the bottom of the terminal. I use it to show the current repo name and how much of the context window I've used. To set this up, first create a script at ~/.claude/statusline.sh: #!/bin/bash # Read JSON…

Read more

Tempest 3.0

tempestphp.com

Tempest 3.0 has been released with a new exception handler, PHP 8.5 as minimum requirement, improved CSRF protection using browser headers, database performance improvements, and closure-based validation rules.

Read more [tempestphp.com]

A clean API for reading PHP attributes original

by Freek Van der Herten – 3 minute read

PHP 8.0 introduced attributes, and they're a great way to add structured metadata to classes, methods, properties, constants, and parameters. The concept is solid, but the reflection API you need to actually read them is surprisingly verbose. What should be a simple one-liner ends up being multiple lines of boilerplate every time. And if you want to find all usages of an attribute across an entire class, you're looking at deeply nested loops.

We just released spatie/php-attribute-reader, a package that gives you a clean, static API for all of that. Let me walk you through what it can do.

Read more

How to set up PHP autoformatting in Zed using Pint and PHP CS Fixer original

by Freek Van der Herten – 3 minute read

I only switched to Zed last week (you can see my full setup on my uses page), so I'm still learning the ropes. One thing I ran into is that its external formatter configuration is global. You configure one formatter command for PHP, and that's what gets used in every project you open.

The problem is that not all of my projects use the same formatter. Some use Pint, some use PHP-CS-Fixer directly. My Zed config originally pointed to ./vendor/bin/pint, which meant it silently did nothing in projects that don't have Pint installed.

Let me walk you through how I solved this.

Read more

Laravel Response Cache v8 is here: now offers flexible caching original

by Freek Van der Herten – 6 minute read

Our laravel-responsecache package speeds up your app by caching entire responses on the server. When the same page is requested again, the cached response is served without hitting your controller at all.

We just released v8, a new major version with a powerful new feature: flexible caching. It uses a stale-while-revalidate strategy, so that every visitor gets a fast response, even when the cache is being refreshed.

Let me walk you through it.

Read more