logoalt Hacker News

Building a CLI for All of Cloudflare

165 pointsby soheilprotoday at 3:44 PM44 commentsview on HN

Comments

ks2048today at 7:20 PM

Kind of ironic that AI and Agents seems to be leading to more CLI/API stuff, when AI actually allows human-like computer use for the first time.

A very welcome development - much better for machines to the APIs - but it always would have been welcome without AI.

8cvor6j844qw_d6today at 4:16 PM

> Tell us your hopes and dreams for a Cloudflare-wide CLI

It'd be great if the Wrangler CLI could display the required API token permissions upfront during local dev, so you know exactly what to provision before deploying. Even better if there were something like a `cf permissions check` command that tells you what's missing or unneeded perms with an API key.

dcretoday at 4:54 PM

Wonderful post and I will be taking inspiration from it. Surprised not to see TypeSpec https://typespec.io/ mentioned, which is a TypeScript-like schema language that I like to describe as "what if OpenAPI was good". I'm guessing they considered and decided building their own would be both simpler and more flexible. The cost of BYO has come down a lot thanks to agents.

show 1 reply
porphyratoday at 5:13 PM

Ironically, with the advent of AI agents and stuff, we're going back from "checkbox engineering" in GUI webpages to CLI tools. Every time I need to clear cache in cloudflare when I upload a new version of an asset, I have to click through a bunch of things. Would be nice to just message my openclaw agent to do it.

show 1 reply
kodablahtoday at 4:18 PM

> You can try the technical preview today by running npx cf. Or you can install it globally by running npm install -g cf.

A couple of obvious questions - Is it open source (npmjs side doesn't point to repo)? And in general will it be available as a single binary instead of requiring nodejs tooling to install/use? If so, using recently-acquired Bun or another product/approach?

show 1 reply
amingilanitoday at 6:35 PM

> So we introduced a new TypeScript schema that can define the full scope of APIs, CLI commands and arguments, and context needed to generate any interface. The schema format is “just” a set of TypeScript types with conventions, linting, and guardrails to ensure consistency.

I'm confused though, why isn't that tool/framework being shown here. What is it and how does it work? It is similar to the TypeSpec tool someone else posted?

nzoschketoday at 5:45 PM

I have been experimenting with Open API spect -> CLI too. I have Go and specs auto-generated either with Huma or Fuego

https://github.com/danielgtaylor/huma https://github.com/go-fuego/fuego

The restish tool by the author of Huma is functionally correct, but I'm finding the models are not doing a great job at inferring the syntax. Admittedly I am having a hard time following the syntax too.

https://github.com/rest-sh/restish

I need to do proper evals, but it makes me wonder if `curl` or a CLI with more standard args / opts parsing will work better.

Thanks to Cloudflare for sharing their notes, anyone else figure this out?

cordwainersmithtoday at 4:59 PM

Finally. Jumping between wrangler, the dashboard, and raw API calls has been annoying for a while. I'm keen on the local explorer most, debugging Workers locally has always been clunky. Anyone know how this plays with Terraform-managed infra?

f-seriftoday at 5:37 PM

I wish there were CLI preview command when making changes in Cloudflare.

I have few domains on Cloudflare and when making some changes, I wish there were a way to apply the same changes to multiple domains for consistency.

CLI preview for UI action will make it possible.

anju-kushwahatoday at 7:03 PM

waiting this feature from long time

bensmoiftoday at 4:20 PM

Oh yes to this! I spent yesterday morning working this out when it smacked me in the face

show 1 reply
mfbx9da4today at 5:52 PM

BTW Speakeasy support generating customizable CLIs written in Go from OpenAPI specs. https://www.speakeasy.com/docs/cli-generation/create-cli

(Disclaimer: I work for Speakeasy)

kodama-lenstoday at 4:18 PM

I'm happy that there will be more tooling, but the reason for that (and the target audience) should not be ai agents. It should be a good experience for humans!

Tools should be tested and quality assured. Something that was utterly missing for cloudflare's unusable v5 terraform provider. Quality over quantity with a ux that has humans in mind!

show 1 reply
acedTrextoday at 5:30 PM

Its so depressing that it took widespread LLM psychosis to finally get company leadership to invest in actual CLI tooling.

No, the customers never mattered but the mythical "LLM agent" is vitally important to cater too.

5701652400today at 6:53 PM

> First Principles

am I the only one put off with such language? they talk as if they invented compilers or assembly or Newton's law of gravity.

risyachkatoday at 4:48 PM

> Tell us your hopes and dreams for a Cloudflare-wide CLI

Please call it flare.

nlatoday at 5:46 PM

Excellente!

jeffrallentoday at 5:40 PM

This, but for Bunny DNS, so I can get closer to 100% European clouds. :)

j45today at 5:21 PM

Complete CLI coverage is so great to see.

latchkeytoday at 4:21 PM

I just wish they'd fix billing notifications. The ux makes it impossible to set it up. Been complaining about that on X, got a couple people saying they would look into it, even one that gave me his email address. Pure silence.

benatkintoday at 4:24 PM

> Right now, cf provides commands for just a small subset of Cloudflare products.

Why didn't they vibe code support for more? With this on the heels of EmDash, and this being a technical preview, it feels inconsistent.

xnaclytoday at 4:11 PM

> We write a lot of TypeScript at Cloudflare. It’s the lingua franca of software engineering.

This scares me more than Im able to admit, typescript sucks and in my opinion its way worse than the more commonly used lingua franca of computing, which I would attribute to C. At least C can be used to create shared objects i guess?

show 1 reply