lmgcp reference
Reference tables for lmgcp CLI options, environment variables, 16-domain Gcp methods, shared lmgcp cloud methods, standard lmcode_std_v3 REST and CLI interfaces, and exit codes.
CLI flags
| Flag or subcommand | Description |
|---|---|
| --version | Print lmgcp version string . |
| --help, -h | Print usage, environment variables, and safety overview. |
| --notices | Print embedded third-party license notices. |
| --lmcode-schema [--json] | Print human-readable schema summary or raw JSON schema for schema/lmgcp.dsl.json. |
| --lmcode-signatures [--without-std] | Print sorted canonical DSL signatures (525 total, or 299 host-only with --without-std). |
| --lmcode FILE [--lmcode FILE ...] | Load, verify, and execute compiled .dslb bytecode against Gcp. |
| --sweep [--older-than-hours N] [--delete] [--run-id ID] [--ledger PATH] | List (dry-run default) or delete (--delete) run-owned leftovers from the recovery journal. |
| cloud [--lmcode-schema|--lmcode-signatures|--lmcode FILE] | Switch to the shared lmcloud schema (schema/lmcloud.dsl.json) served by hostkit/cloudhost. |
Environment variables
| Variable | Default | Purpose |
|---|---|---|
| LMGCP_MAX_MEMORY_MB | 4096 | Total memory budget in whole MiB; invalid values exit 2, breaches run CleanupLedger and exit 3. |
| LMGCP_LIVE | 0 | Set to 1 to use Google Application Default Credentials instead of the in-process fake GCP server. |
| LMGCP_ENDPOINT | unset | Loopback HTTP emulator origin (such as http://127.0.0.1:4588 for gcpsim); mutually exclusive with LMGCP_LIVE=1. |
| LMGCP_ACCESS_TOKEN | unset | Optional dummy OAuth bearer token when targeting gcpsim --auth enforce. |
| LMGCP_PROJECT | masked fake project | Target GCP project ID (masked in all outputs). |
| LMGCP_REGION, LMGCP_ZONE | us-central1 / us-central1-a | Default GCP region and zone for regional and zonal operations. |
| LMGCP_STATE_DIR, LMGCP_LEDGER | user state dir | Directory or explicit file path for the durable fsynced recovery journal. |
16-service Gcp domain summary
| Service domain | Representative methods on gcp (type Gcp) | Return types |
|---|---|---|
| Compute Engine & Disks | compute_list_instances, compute_get_instance, compute_create_instance, compute_delete_instance, compute_list_disks | ComputeInstance, StrList, bool |
| VPC, Subnets & Firewalls | network_list_vpcs, network_create_vpc, network_create_subnet, network_list_firewalls, network_create_firewall | VpcNetwork, Subnet, FirewallRule, StrList |
| Cloud Storage (GCS) | storage_list_buckets, storage_create_bucket, storage_delete_bucket, storage_put_object, storage_read_object, storage_list_objects | StorageBucket, StrList, string, bool |
| Pub/Sub | pubsub_create_topic, pubsub_create_subscription, pubsub_publish, pubsub_pull, pubsub_delete_topic | PubsubTopic, PubsubSubscription, StrList, string, bool |
| Cloud Run v2 | run_list_services, run_deploy_service, run_set_traffic_split, run_delete_service | CloudRunService, StrList, bool |
| Cloud SQL, Firestore & BigQuery | sql_list_instances, sql_create_instance, firestore_put_doc, firestore_get_doc, bq_create_dataset, bq_create_table | SqlInstance, StrMap, BqDataset, BqTable |
| IAM, Secret Manager & KMS | iam_list_service_accounts, iam_list_bindings, secrets_list, secrets_create_metadata, kms_list_keys, kms_create_key | ServiceAccount, SecretMetadata, KmsKey, StrList |
| GKE, Artifact Registry & DNS | gke_list_clusters, ar_list_repositories, ar_create_repository, dns_create_zone, dns_add_record | GkeCluster, ArtifactRepo, DnsZone, StrList, bool |
| Cloud Logging, Monitoring & Ledger | logging_write_entry, logging_create_sink, monitoring_create_alert_policy, set_cost_cap_usd, estimated_cost_usd, cost_report, cleanup_ledger | LogSink, AlertPolicy, bool, float, string, int |
Standard lmcode_std_v3 REST and CLI interfaces
| Symbol | Signature | Purpose |
|---|---|---|
| RestGet .. RestOptions, RestHandler | fn h(x: RestExchange) -> void implements RestGet .. RestHandler | HTTP route handler interfaces bound via @"/path/:param" annotations. |
| CliCommand, CliOption | fn c(x: RestExchange) -> void implements CliCommand | CliOption | CLI subcommands (@"cmd") and options (@"--flag"). |
| rest_config, rest_route, rest_serve, rest_stop, rest_cli | rest_config(k, v); rest_route(m, p, h); rest_serve(); rest_stop(); rest_cli(args) -> string | Configure routes, run HTTP servers, or dispatch CLI/REST requests in-process. |
Exit codes
| Code | Meaning |
|---|---|
| 0 | Execution or sweep completed successfully. |
| 2 | Invalid CLI arguments, invalid invocation manifest, or invalid LMGCP_MAX_MEMORY_MB value. |
| 3 | Runtime cloud error, cost cap exceeded, shape allowlist violation, or memory ceiling exceeded. |
| 4 | Bytecode load failure or schema write failure. |