Here is what setting up Pithy used to ask of you, on day one, before you had written a line of code.
Open the Cloudflare dashboard. Create an API token. Then go down a table in our documentation and tick every permission group on it. Ours held thirty-five, across two kinds of resource. Paste the result into a file and keep it safe.
That token was the most powerful credential you would ever hold for your project, and you made it by hand before you knew which of it you needed. It had to be that powerful. Cloudflare will only let a token create another token with permissions it already holds. So the token Pithy mints everything else from had to hold everything Pithy might ever mint.
Then every action you took with it was recorded against the token. Not against you.
What does it take now?
One command.
pithy cloudflare connectIt prints a sign-in address and opens it in your browser. You sign in to Cloudflare, read a consent screen, and approve. That is the whole setup. There is no token to make, nothing to paste, and no table to read.
The consent screen lists exactly what your project uses. Pithy reads which capabilities you have composed and which resources your own app binds, works out which permissions their tokens carry in each environment, and asks for those plus a small base: who you are, which account, its zones, and permission to create tokens. If your project has no vector search, it never asks for Vectorize. If your app declares its own bucket, it asks for R2. The screen you approve is your project’s actual footprint, not ours.
What if your terminal is on another machine?
A lot of us work over SSH. The browser runs on your laptop, and the terminal runs somewhere else.
Cloudflare sends your browser back to 127.0.0.1 when you approve. On your laptop nothing is listening there, so the browser shows a page that can’t be reached. That looks like a failure. It isn’t. The sign-in worked, and the code Pithy needs is in that page’s address. Copy it from the address bar and paste it into the terminal. connect tells you this before the browser opens, because the moment you see that page is the wrong moment to learn it.
Pasting the address is safe. The code in it can only be redeemed with a secret that never left your terminal, so anyone who sees the address gets nothing. That is PKCE, the standard built for exactly this: a program on your machine signing you in through a browser it does not control. It is also how Claude Code signs you in from a terminal on another machine. The browser gives you something to paste back, and the terminal finishes the sign-in.
Then what?
Then Pithy does the part you used to do by hand.
pithy token mint ci-system creates the token your CI pipeline runs on, with exactly the permissions it carried before. We checked that against a live account: same permission groups, same scope. The difference is who made it. You signed in once, and Pithy created the narrow credential for you.
Getting that token into CI is one line. The mint writes the value to a file outside your checkout, and --json says where. With jq and the GitHub CLI, the value goes from that file straight into your repository’s secrets:
jq -r .prod.CF_TOKEN_CI_SYSTEM "$(pithy token mint ci-system --env prod --json | jq -r .location)" | gh secret set CLOUDFLARE_API_TOKENIt never touches your clipboard or your screen.
Your own sign-in works differently. The session connect keeps on your machine is what the CLI uses as you work. It lasts an hour and renews itself. Every pithy command checks it first, and renews it when less than five minutes are left. You will not notice that happen. pithy dev keeps it fresh for as long as you leave it running.
It is also bound to the directory you ran connect in, and to every worktree of that repository. That closes a quiet hazard. If your shell has exported some other account’s CLOUDFLARE_API_TOKEN, Pithy used to take it without a word. Now, in a bound directory, it refuses and names both, rather than guessing which one you meant.
Compose a new capability, or bind a new bucket or namespace, and the next mint notices that your session was not granted what it now needs. It stops and asks you to sign in again, so you approve the wider access. It does not fail halfway through. Widening what Pithy may do on your account becomes something you agree to.
Who did that?
We wrote about the audit trail earlier this year, and about recording who did what. Under the old setup, the honest answer for a CLI action was usually a token’s name: Pithy Integration Testing (CI). A token name is not a person. Cloudflare could not tell us who made the token either, because it does not record that.
Under a session, the answer is you. pithy doctor now says which you have. For a session it says who signed in. For an account token it says the token is a name, not a person.
What doesn’t change?
CI still runs on an account token. A pipeline has no browser, and Cloudflare offers third-party tools no device sign-in to stand in for one. That is the right credential for a runner anyway. What changed is that you no longer build it by hand.
One rough edge is Cloudflare’s, and you should know about it before you meet it. Permission to create tokens sits under Sensitive scopes on the consent screen, switched off. If you approve without switching it on, Cloudflare does not grant the rest. It says “We could not complete the authorization. Please check your network connection and try again.” Your network is fine. Turn the switch on and approve again. connect warns you first, and names the switch again if it times out.
And existing setups keep working. A token in your config file, or exported in CI, resolves exactly as it did.
Try it
pithy cloudflare connect ships in the next release of the CLI. The command reference has every flag, the --json output, and what each refusal means.