Skip to content

CLI Reference

Orbit registers as a plugin for the astromeshctl CLI (the astromeshctl.plugins entry point), so installing astromesh-orbit next to astromesh-cli adds the orbit subcommand.

Terminal window
astromeshctl orbit <command> [options]

Every command that reads a config exits with code 1 and orbit.yaml not found. Run 'astromeshctl orbit init' first. when the file is missing.

Generate orbit.yaml with an interactive wizard.

astromeshctl orbit init [--provider <name>] [--preset <tier>]

Flags:

FlagTypeDefaultDescription
--providerstringgcpAnswers the wizard’s provider prompt. An unknown provider fails before the wizard starts.
--presetstring—starter or pro; answers the wizard’s preset prompt. Without it, the wizard asks.

Example:

Terminal window
astromeshctl orbit init
🛰️ Astromesh Orbit — Cloud Deployment Setup
Cloud provider [gcp] (gcp): gcp
GCP Project ID: my-project-123
Region [us-central1/us-east1/us-west1/europe-west1/europe-west4/asia-east1/asia-southeast1/southamerica-east1] (us-central1):
Deployment name (my-astromesh):
Environment [develop/staging/production] (develop): production
starter (~$15/mo) — no HA, 1GB cache
pro (~$80/mo) — HA, 4GB cache
Preset [starter/pro] (starter):
OK orbit.yaml written
OK .orbit/ added to .gitignore

Side effects:

  • Writes orbit.yaml in the current directory
  • Appends .orbit/ to .gitignore (creating it if missing)

Validate the GCP project, render the Terraform files, and run terraform plan.

astromeshctl orbit plan [--config <path>]

Flags:

FlagTypeDefaultDescription
--configpathorbit.yamlPath to the Orbit configuration file.

Example:

Terminal window
astromeshctl orbit plan
Orbit Deployment Plan
Validating... OK
OK State bucket exists: gs://my-project-123-astromesh-orbit-state
Resources to create: …
Resources to update: …
Resources to destroy: …

The counts come from scanning the plan’s text and include attribute lines, so they run high. For the exact plan, run tofu plan in .orbit/generated/.

Failure example — API not enabled:

Validating... FAILED
OK Authenticated as you@example.com
OK Project my-project-123 found
FAIL sqladmin.googleapis.com not enabled
-> gcloud services enable sqladmin.googleapis.com --project=my-project-123

Validation failures exit with code 1; Orbit prints the remediation command but does not enable anything for you.

Side effects:

  • Creates/overwrites .orbit/generated/*.tf
  • Runs terraform init in .orbit/generated/
  • Creates the Terraform state bucket if it does not exist yet (and, when authenticating with a service-account key, the VPC peering Cloud SQL needs)
  • Does not create any stack resources

Validate, render and run terraform apply for the full stack.

astromeshctl orbit apply [--config <path>] [--auto-approve]

Flags:

FlagTypeDefaultDescription
--configpathorbit.yamlPath to the Orbit configuration file.
--auto-approveboolfalseSkip the confirmation prompt (for CI).

Example:

Terminal window
astromeshctl orbit apply --config orbit.prod.yaml
Astromesh Orbit -- Deploying
OK State bucket exists: gs://my-project-123-astromesh-orbit-state
OK Deployment complete!
Endpoints
┏━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Service ┃ URL ┃
┡━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ runtime │ https://astromesh-runtime-abc123.run.app │
└─────────┴────────────────────────────────────────────┘
Environment file: .orbit/orbit.env

Side effects:

  • Creates or updates cloud resources (Cloud Run, Cloud SQL, Memorystore, etc.)
  • Creates the Terraform state bucket if needed
  • Writes .orbit/orbit.env with the Terraform outputs
  • Idempotent — safe to re-run after a partial failure
  • Validates again before applying; with a service-account key, also sets up private services access

Show the runtime service’s status from the Terraform outputs.

astromeshctl orbit status [--config <path>]

Flags:

FlagTypeDefaultDescription
--configpathorbit.yamlPath to the Orbit configuration file.

Example:

Terminal window
astromeshctl orbit status
Deployment Status
┏━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Resource ┃ Type ┃ Status ┃ URL ┃
┡━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ astromesh-runtime │ cloud_run_v2_service │ running │ https://astromesh-runtime-abc123.run.app │
└───────────────────┴──────────────────────┴─────────┴────────────────────────────────────────────┘
State bucket: my-project-123-astromesh-orbit-state

The status is running when the runtime_url output exists and not_found otherwise; it does not query the service or any other resource. It reads the outputs from .orbit/generated/, so run it from the project where you applied.

Side effects:

  • Reads Terraform outputs (read-only)

Tear down all provisioned resources with terraform destroy.

astromeshctl orbit destroy [--config <path>] [--auto-approve]

Flags:

FlagTypeDefaultDescription
--configpathorbit.yamlPath to the Orbit configuration file.
--auto-approveboolfalseSkip the confirmation prompt.

Example:

Terminal window
astromeshctl orbit destroy
This will destroy ALL infrastructure. Continue? [y/N]: y
Destroying infrastructure...
OK All resources destroyed.

Side effects:

  • Destroys all cloud resources managed by Orbit
  • Does NOT delete the state bucket, orbit.yaml or .orbit/

Write standalone Terraform files with no Orbit dependency, to manage directly with the terraform CLI.

astromeshctl orbit eject [--output-dir <path>]

Flags:

FlagTypeDefaultDescription
--output-dirpath./orbit-terraformDirectory where standalone Terraform files are written.

eject always reads ./orbit.yaml; it has no --config flag.

Example:

Terminal window
astromeshctl orbit eject --output-dir ./my-terraform
OK Terraform files exported to my-terraform/
These are standalone -- no Orbit dependency.
Next steps:
cd ./my-terraform
terraform plan
terraform apply

Key details:

  • One .tf file per Orbit template (backend.tf, main.tf, cloud_run.tf, cloud_sql.tf, memorystore.tf, secrets.tf, networking.tf, iam.tf, storage.tf, artifact_registry.tf, monitoring.tf, variables.tf, outputs.tf), each with a header comment
  • terraform.tfvars with project_id, region and deployment_name
  • backend.tf points to the existing state bucket — no state migration needed
  • Ejecting is non-destructive — orbit apply still works after ejecting. If you change the ejected files and apply them directly, state diverges from what Orbit renders

Side effects:

  • Writes files to the output directory
  • Does NOT modify any cloud resources, .orbit/ or orbit.yaml

Read the runtime service’s logs (astromesh-runtime) from Cloud Logging.

astromeshctl orbit logs [--config <path>] [--limit <n>] [--since <duration>]

Flags:

FlagTypeDefaultDescription
--configpathorbit.yamlPath to the Orbit configuration file (for the project ID).
--limitint50Maximum number of log entries to fetch.
--sincestring1hFreshness window, e.g. 10m, 1h, 2d.

Example:

Terminal window
astromeshctl orbit logs --limit 20 --since 30m

Prints a table of timestamp, severity and message. With no entries it prints No log entries in the last 30m.; if gcloud is not authenticated it exits with code 1 and suggests gcloud auth login.

Side effects:

  • Read-only — queries Cloud Logging

Re-render the Terraform templates after an astromesh-orbit package update and show a diff against .orbit/generated/.

astromeshctl orbit upgrade [--config <path>] [--apply]

Flags:

FlagTypeDefaultDescription
--configpathorbit.yamlPath to the Orbit configuration file.
--applyboolfalseWrite the re-rendered templates to .orbit/generated/ (templates the package dropped are removed). Without it, only the diff is shown.

Example:

Terminal window
astromeshctl orbit upgrade
--- current/monitoring.tf
+++ new/monitoring.tf
...
Re-run with --apply to write these changes.

When nothing changed it prints Up to date — generated templates match this package.

Side effects:

  • Without --apply: read-only, prints a diff
  • With --apply: overwrites .orbit/generated/*.tf (does not run terraform apply; run orbit plan next)