gcpsim

gcpsim is a single-binary local GCP emulator on 127.0.0.1:4588 that runs Cloud Storage (GCS) and Pub/Sub in-process without Docker, Java, or a Google Cloud account.

Quick reference

Start gcpsim on loopback port 4588 in open mode or with OAuth Bearer token and IAM permission enforcement, then connect lmgcp, gcloud, or Google Cloud SDK clients.

gcpsim --version
gcpsim serve
gcpsim serve --port 4588 --project gcpsim-local --data-dir ./data
gcpsim serve --auth enforce --auth-config auth.json
curl http://127.0.0.1:4588/health
Command or option Default Purpose
gcpsim serve | start 127.0.0.1:4588, in-memory Run the foreground local GCP emulator sharing REST and gRPC on port 4588 in open mode.
--port <port> 4588 Override the listening TCP port.
--project <id> gcpsim-local Set the default GCP project identifier.
--data-dir <path> in-memory Persist GCS buckets, objects, and Pub/Sub topics/subscriptions across restarts.
--auth open | enforce open (SIM_AUTH) Run in open mode or enforce OAuth Bearer tokens and IAM permission bindings.
--auth-config <file> SIM_AUTH_CONFIG JSON file defining dummy Bearer tokens, principals, and IAM role/permission bindings.

LMScript example driving gcpsim through lmgcp. The calls follow examples/templates-client.lms in the repository, which runs against the pinned lmgcp v0.1.17 client; point lmgcp at the simulator as described in the guide and set LMGCP_BINARY to the downloaded client.

program = _lmcode_ cli="lmgcp" install="github:lmctl-ai/lmgcp@v0.1.17";
  let bucket = gcp.storage_create_bucket("gcpsim-demo", "us-central1", "STANDARD");
  let uploaded = gcp.storage_put_object("gcpsim-demo", "hello.txt", "hello from gcpsim", "text/plain");
  let read = gcp.storage_read_object("gcpsim-demo", "hello.txt");
  let topic = gcp.pubsub_create_topic("gcpsim-demo");
  let attrs = str_map().set("note", "demo");
  let id = gcp.pubsub_publish("gcpsim-demo", "hello gcpsim", attrs);
  $return = read;
end _lmcode_
result = run_lmcode(program, {command:[env("LMGCP_BINARY"), "--lmcode", "$DSLFILE"]});
assert(result.ok, "gcpsim client run failed: " + json_stringify(result));
println(json_stringify(result.result));

Documentation pages

Source repository and releases