lmgcp

lmgcp is the Google Cloud Platform scripting host for LMScript, exposing a 16-service GCP schema alongside the shared lmcloud procedural schema.

Quick reference

Declare lmgcp in an LMScript program or run its CLI directly against the in-process fake GCP REST server, the local gcpsim emulator on 127.0.0.1:4588, or live Google Cloud credentials.

lmgcp --version
lmgcp --lmcode-schema --json
lmgcp --lmcode-signatures
lmgcp cloud --lmcode-schema --json
lmgcp --sweep --older-than-hours 1
p = _lmcode_ cli="lmgcp" install="github:lmctl-ai/lmgcp@latest";
Surface Command or method Purpose
Native 16-service GCP context context gcp: Gcp (299 host signatures + 226 standard signatures) Script Compute Engine, VPC/Firewalls, GCS, Pub/Sub, Cloud Run v2, Cloud SQL, Firestore, BigQuery, IAM, Secret Manager, KMS, GKE, Artifact Registry, DNS, Logging, and Monitoring.
Shared lmcloud mode lmgcp cloud --lmcode FILE (context cloud: Cloud) Execute provider-neutral lmcloud programs against GCS, Pub/Sub, Firestore tables, permissions, Cloud Run functions, and cost/metrics.
Emulator endpoint LMGCP_ENDPOINT=http://127.0.0.1:4588 or cloud.set_endpoint("all", "http://127.0.0.1:4588") Route GCS and Pub/Sub calls to a local gcpsim instance over loopback HTTP.
Recovery and sweeper lmgcp --sweep [--older-than-hours N] [--delete] [--run-id ID] [--ledger PATH] Inspect or delete run-owned lmgcp_ and lmgcp- resources tracked in the durable RunLedger journal.
Standard REST and CLI rest_config, rest_route, rest_serve, rest_stop, rest_cli Expose GCP workflows as HTTP routes (:param patterns) and CLI commands via lmcode_std_v3 interfaces.

Runnable LMScript example using lmgcp with GCS buckets, Pub/Sub topics, cost ledger verification, and standard REST/CLI routing:

p = _lmcode_ cli="lmgcp" install="github:lmctl-ai/lmgcp@latest";
  @"/gcs/:bucket/:object"
  fn get_gcs(x: RestExchange) -> void implements RestGet {
    x.send(gcp.storage_read_object(x.param("bucket"), x.param("object")));
  }

  @"publish-event"
  fn cmd_pub(x: RestExchange) -> void implements CliCommand {
    let t = gcp.pubsub_create_topic("lmgcp_events");
    x.send("topic:" + t.name());
  }

  rest_config("prefix", "/v1");
  gcp.set_cost_cap_usd(0.05);
  let bkt = gcp.storage_create_bucket("lmgcp-demo-bkt", "us-central1", "STANDARD");
  gcp.storage_put_object(bkt.name(), "hello.txt", "hello from lmgcp", "text/plain");

  let pub_out = rest_cli(str_split("publish-event -- job-ready", " "));
  let gcs_out = rest_cli(str_split("/v1/gcs/" + bkt.name() + "/hello.txt", " "));
  print(pub_out + " | " + gcs_out + " | cost=$" + str(gcp.estimated_cost_usd()));
end _lmcode_
r = run_lmcode(p);
assert(r.ok, "lmgcp run failed");

Documentation pages

Source repository and releases