lmcloud reference

Reference tables for the shared lmcloud CLI contract, ErrorCode enumeration, Cloud context methods, result types, standard lmcode_std_v3 REST and CLI signatures, and process exit codes.

Host CLI flags

Flag or argument Description
[cloud] --version, -V Print the host binary name and semantic version string.
[cloud] --help, -h Print usage, endpoint precedence, live safety gates, and simulator environment variables.
[cloud] --notices Print embedded third-party software license notices.
[cloud] --lmcode-schema [--json] Emit the raw embedded schema/lmcloud.dsl.json bytes used by lmscript for SHA-256 schema binding.
[cloud] --lmcode-signatures Print all sorted canonical signatures (shared lmcloud host signatures plus 226 lmcode_std_v3 standard signatures).
[cloud] --lmcode-signatures --without-std Print only the shared lmcloud host signatures without standard library declarations.
[cloud] [--lmcode|--first|--last] FILE ... Execute one or more compiled .dslb bytecode files under the validated invocation manifest.
--sweep Host-provided extra flag (registered by a provider host, not by hostkit itself) to inspect or clean up run-owned resources recorded in durable recovery journals.

ErrorCode enumeration and CloudError methods

Member Signature or value Description
ErrorCode OK, INVALID_ARGUMENT, NOT_FOUND, CONFLICT, PRECONDITION_FAILED, UNAUTHENTICATED, PERMISSION_DENIED, COST_CAP_EXCEEDED, INTERNAL Normalized cross-provider status codes returned by CloudError.code().
CloudError.ok ok() -> bool True when the last operation succeeded (ErrorCode.OK).
CloudError.code code() -> ErrorCode Normalized ErrorCode value for the failure.
CloudError.http_status http_status() -> int Underlying HTTP status code (such as 400, 401, 403, 404, 409, 412, or 500), or 0 for local validation failures.
CloudError.provider_code provider_code() -> string Original provider or simulator error code string (such as NoSuchBucket, BlobNotFound, or NotAuthorizedOrNotFound).
CloudError.message message() -> string Secret-redacted diagnostic message.

Cloud context methods

Slice Method signatures Description
Configuration and errors provider() -> string; endpoint(service: string) -> string; set_endpoint(service: string, url: string) -> Cloud; abort_on_error() -> bool; set_abort_on_error(abort: bool) -> Cloud; last_error() -> CloudError Inspect provider identifier, override loopback simulator endpoints per service or for all services, and control error handling mode.
Object storage bucket_create(name: string) -> bool; bucket_delete(name: string) -> bool; bucket_exists(name: string) -> bool; bucket_list() -> StrList; object_put(bucket: string, key: string, body: string) -> ObjectMeta; object_put(bucket: string, key: string, body: string, content_type: string, metadata: StrMap) -> ObjectMeta; object_get(bucket: string, key: string) -> string; object_head(bucket: string, key: string) -> ObjectMeta; object_delete(bucket: string, key: string) -> void; object_list(bucket: string, prefix: string) -> ObjectListPage; object_list(bucket: string, prefix: string, max_keys: int, page_token: string) -> ObjectListPage; object_list_all(bucket: string, prefix: string) -> StrList Create and delete buckets, upload and download UTF-8 or binary-safe payloads, inspect ETag and metadata, and paginate keys lexicographically.
Queues queue_create(name: string) -> bool; queue_delete(name: string) -> bool; queue_exists(name: string) -> bool; queue_list() -> StrList; queue_send(name: string, body: string) -> string; queue_receive(name: string) -> QueueMessageList; queue_receive(name: string, max_messages: int, visibility_timeout_s: int, wait_time_s: int) -> QueueMessageList; queue_ack(name: string, receipt: string) -> void; queue_nack(name: string, receipt: string, visibility_timeout_s: int) -> string Manage FIFO/standard message queues, receive batches with visibility timeouts, acknowledge completions, or extend/reset visibility via queue_nack.
Cost and metrics cost_cap_usd() -> float; set_cost_cap_usd(cap: float) -> Cloud; estimated_cost() -> float; cost_report() -> CostReport; metrics_reset() -> Cloud; metrics() -> MetricsReport Set monotone-decreasing USD cost caps, query accumulated cost estimates, and export per-operation latency and byte counters.
Tables table_create(name: string) -> bool; table_create(name: string, sorted: bool) -> bool; table_delete(name: string) -> bool; table_exists(name: string) -> bool; table_list() -> StrList; item_new(pk: string) -> TableItem; item_new(pk: string, sk: string) -> TableItem; item_put(table: string, item: TableItem) -> TableItem; item_put(table: string, item: TableItem, condition: string) -> TableItem; item_get(table: string, pk: string) -> TableItem; item_get(table: string, pk: string, sk: string) -> TableItem; item_delete(table: string, pk: string) -> void; item_delete(table: string, pk: string, sk: string) -> void; item_update(table: string, pk: string, patch: TableItem) -> TableItem; item_update(table: string, pk: string, sk: string, patch: TableItem) -> TableItem; item_query(table: string, pk: string) -> TablePage; item_query(table: string, pk: string, sk_begin: string, sk_end: string, limit: int, page_token: string) -> TablePage; item_scan(table: string) -> TablePage; item_scan(table: string, limit: int, page_token: string) -> TablePage Create partition-key or composite partition-and-sort-key tables, perform optimistic concurrency writes, query sort-key ranges, and scan pages.
Permissions principal_current() -> string; policy_new() -> Policy; policy_parse(json: string) -> Policy; policy_lint(policy: Policy) -> LintReport; policy_attach(kind: string, target: string, policy: Policy) -> void; policy_attach_principal(principal: string, policy: Policy) -> void; policy_detach(kind: string, target: string) -> void; policy_detach_principal(principal: string) -> void; policy_check(principal: string, action: string, resource: string) -> bool Author portable allow/deny policies, lint for least-privilege violations, attach policies to resources or principals, and evaluate point access decisions.
Serverless functions function_config(runtime: string, handler: string) -> FunctionConfig; function_create(name: string, cfg: FunctionConfig) -> bool; function_update(name: string, cfg: FunctionConfig) -> FunctionConfig; function_update(name: string, cfg: FunctionConfig, expect_revision: string) -> FunctionConfig; function_delete(name: string) -> bool; function_exists(name: string) -> bool; function_get(name: string) -> FunctionConfig; function_get(name: string, qualifier: string) -> FunctionConfig; function_list() -> StrList; function_publish_version(name: string) -> string; function_publish_version(name: string, description: string) -> string; function_versions(name: string) -> StrList; function_alias_set(name: string, alias: string, version: string) -> void; function_alias_get(name: string, alias: string) -> string; function_alias_delete(name: string, alias: string) -> bool; function_invoke(name: string, payload: string) -> FunctionInvokeResult; function_invoke(name: string, qualifier: string, payload: string) -> FunctionInvokeResult Configure, deploy, version, alias, and synchronously invoke serverless functions from inline code or object-storage packages.
User directories userpool_create(name: string) -> bool; userpool_delete(name: string) -> bool; userpool_exists(name: string) -> bool; userpool_list() -> StrList; user_create(pool: string, username: string) -> User; user_create(pool: string, username: string, attrs: StrMap) -> User; user_get(pool: string, username: string) -> User; user_delete(pool: string, username: string) -> void; user_set_enabled(pool: string, username: string, enabled: bool) -> void; user_set_password(pool: string, username: string, password: string) -> void; user_list(pool: string) -> UserPage; user_list(pool: string, limit: int, page_token: string) -> UserPage; user_sign_in(pool: string, username: string, password: string) -> Session; user_verify_token(pool: string, token: string) -> Session; group_create(pool: string, group: string) -> bool; group_delete(pool: string, group: string) -> bool; group_list(pool: string) -> StrList; group_add_user(pool: string, group: string, username: string) -> void; group_remove_user(pool: string, group: string, username: string) -> void; user_groups(pool: string, username: string) -> StrList Manage portable user pools, users, password policies, group memberships, and signed session tokens with claim verification.

Standard lmcode_std_v3 REST and CLI interfaces

Interface or function Signature Description
RestGet .. RestOptions, RestHandler fn handler(x: RestExchange) -> void implements RestGet | RestPost | RestPut | RestDelete | RestPatch | RestHead | RestOptions | RestHandler SAM interfaces for HTTP route handlers annotated with @"/route/:param".
CliCommand, CliOption fn cmd(x: RestExchange) -> void implements CliCommand | CliOption SAM interfaces for CLI subcommands (@"cmd") and options (@"--flag").
rest_config fn rest_config(key: string, value: string) -> void Configure REST/CLI dispatcher settings such as route prefix, host, or port.
rest_route fn rest_route(method: string, pattern: string, handler: string) -> void Register an HTTP method and URL pattern with a named handler function.
rest_serve, rest_stop fn rest_serve() -> void; fn rest_stop() -> void Start or stop the embedded HTTP server for registered routes.
rest_cli fn rest_cli(args: StrList) -> string Dispatch CLI arguments or synthetic route paths in-process and return the response string.
RestExchange method(), path(), body(), param(name), query(name), header(name), get(key), set(key, val), has_query(name), has_header(name), increment(key), status(code), send(text), json(payload), set_header(name, val) Request and response exchange methods available inside REST and CLI handlers.

Exit codes

Exit code Category Meaning
0 OK Command or bytecode execution succeeded and all assertions passed.
2 CLI_USAGE Invalid command-line flags, malformed invocation manifest, or invalid memory budget environment variable.
3 APP_FAIL / RUN_HOST Runtime cloud error (when abort_on_error is true), cost cap breach, assertion failure, or memory ceiling exceeded.
4 LOAD_FAIL Bytecode file read error, schema hash mismatch, or result contract decoding error.