I would like to run a script on my local machine which would hook into the context of my worker which is already configured on Cloudflare and then perform any operation in that context, e.g. using D1, KV directly without having to actually run a worker with a fetch handler and then do a an HTTP request to achieve essentially the same.
You could think about it as simply running the node command with a file in your project which has access to the whole context of the project (e.g. databases, env variables etc). A similar approach from other language/frameworks are Django management commands.
The way I imagine this is simply running wrangler dev and instead of launching a worker service (which essentially runs as an HTTP service) it would execute a worker "script" which runs once and then exits. Is this possible in workers and if so how?