Has anyone written a command-line cache clear tool that can handle multiple domains at both single-file and purge-everything requests?

I’ve been looking at the API a bit as well as some scripts I found through Googling but I haven’t seen anything that does quite what I had in mind.

Before I start working on something I want to make sure I’m not reinventing the wheel

I was envisioning a script that works something like this:

purge example.com/test.jpg – purges single file from cache
purge example.com – purges everything for the domain
purge / – purges everything for ALL my domains?

I think I could eventually whip something up in Python probably (I see there’s a library) but I’m not a programmer so it might take a while. Hoping something already exists…

1 Like

Never seen one and a good idea.

I’m terrible at this kind of stuff and I’ve managed to automate a lot of stuff just using bash and curl. the Cloudflare API is very simple to work with a fairly forgiving.

1 Like