Top
Best
New

Posted by soheilpro 4 hours ago

Building a CLI for All of Cloudflare(blog.cloudflare.com)
181 points | 47 comments
8cvor6j844qw_d6 3 hours ago|
> 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.

contrahax 1 hour ago|
A doctor command that does this is always nice! Wish more services would have this
dcre 3 hours ago||
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 it and decided building their own would be both simpler and more flexible. The cost of BYO has come down a lot thanks to agents.
thegagne 2 hours ago||
Love TypeSpec, agree it makes writing OpenAPI really easy.

But I’ve moved to using https://aep.dev style APIs as much as possible (sometimes written with TypeSpec), because the consistency allows you to use prebaked aepcli or very easily write your own since everything behaves like know “resources” with a consistent pattern.

Also Terraform works out of the box, with no needing to write a provider.

esafak 1 hour ago||
Which parts of Openapi does it fix?
porphyra 2 hours ago||
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.
deadbabe 58 minutes ago|
Why bother with OpenClaw? Just call the CLI command directly. That is the point of a CLI.
shimman 31 minutes ago||
Yeah but you can waste $10-50 having an LLM do that for you instead rather than using your engineering experience to do it. Think of the shareholder value!
kodablah 3 hours ago||
> 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?

bakugo 3 hours ago|
I can't find any repository, either, but the package is listed as MIT-licensed and includes source maps, so I assume it will be published soon.
upcoming-sesame 16 minutes ago||
I recently let LLM deploy a service for me in gcp using gcloud cli without going to gcp dashboard even once.

it was magical

ks2048 37 minutes ago||
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.

nzoschke 2 hours ago||
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?

amingilani 1 hour ago||
> 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?

cordwainersmith 2 hours ago||
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?
ks2048 30 minutes ago|
> TypeScript is "the lingua franca of software engineering."

Seems odd to me. I guess we all live in our bubbles.

If there is some fancy tool out there, "does it have binding for language X"? X seems to be much more commonly Python than Typescript.

More comments...