CLI reference

saasie app

Work with one Saasie (what it is running, its log, its keys)

Usage: saasie app <name> <group> <action> [options]

Work with one Saasie.

Groups:
  git get-url [--protocol ssh|https] [--with-credentials]
                                       Print the clone URL
  db get-url                           Print the Postgres connection URL
  db info                              Which cluster it is on, and as whom
  analytics types                      The event types the app has registered
  analytics count --type <name> [--since <duration>] [--interval <unit>]
                  [--group-by <property>]
                                       Count events over a range
  mail                                 Its address, and what it sent
  inbox                                What has been sent to it
  files                                What it is storing, and how much is left
  queues                               What is waiting, and what is stuck
  secret list                          What it declares, and what is configured
  secret set <NAME>                    Store a value, from a pipe or a prompt
  secret clear <NAME>                  Remove the value, keep the declaration
  secret link <NAME>                   A link for whoever holds the credential
  domain add <hostname> [--service <name>]
                                       Point a hostname you own at this Saasie
  domain list                          The hostnames pointed here, and their state
  domain remove <hostname>             Stop routing one
  status                               What is running right now
  logs [<service>] [--tail <n>] [--since <duration>] [--previous]
                                       A service's log
  build list                           Recent builds, newest first
  build show <number>                  One build, its URL, and why it failed
  key add <file> [--title <name>] [--read-only]
                                       Let a public key clone and push
  key list                             The keys that can reach this Saasie
  key remove <id>                      Revoke one

A key reaches this Saasie's repo and nothing else on the platform, so use
one key per Saasie rather than one key everywhere. Pass "-" as <file> to
read the key from standard input.

Over https the credential is your API token rather than a key, which is
what makes cloning work from CI and from sandboxes that only allow port
443. Prefer the credential helper, which keeps the token out of the clone:

  git config --global credential.helper '!saasie git-credential'

--with-credentials puts the token in the URL instead, for somewhere that
cannot run a helper. Git writes that URL into .git/config, so the clone
carries a live token from then on.

status and logs read the cluster, not the control plane's records, and that
is the point: a build reports "live" once the deployer has applied it, which
stays true while the container it started crashes on boot. When the URL
answers 502 and the newest build is green, this is where the answer is.

  saasie app acme status                what is running, and why it is not
  saasie app acme logs                  what it has said lately
  saasie app acme logs --previous       what it said before it died

status names the failing health path too. A container that is up and never
answers its declared path is not sent any traffic, so the URL 502s while
nothing crashes, nothing restarts and the log stays empty — the one failure
that looks like nothing being wrong.

analytics, mail and inbox read what the app itself has been doing with its
batteries. They are read-only here: registering an event type, logging an
event and sending a mail are things the app does with its own token, and
doing them by hand would put entries in the record the app never made.

A Saasie sends from, and receives at, one address — mail shows what it sent
and inbox what arrived. Neither shows a body. For a send the platform keeps
only a recipient and a subject; for a received message the body is kept,
because that is the thing the app asked for, and it is handed to the app
rather than to a person. There is no flag that changes that.

build list mixes deployments: main is production and every other branch is a
preview with its own URL, and neither supersedes the other. The branch is in
brackets when it is not production's, and build show prints the URL that
build in particular answers on — which is the one to hand to whoever wanted
to look at the branch. See `saasie docs previews`.

secret goes the other way: the app reads its credentials and only a person
may write one. Declare the names in saasie.yaml, deploy, then set values.

  batteries:
    secrets:
      - STRIPE_SECRET_KEY

There is no `secret get`, and no --value flag. Nothing on the platform
returns a stored secret to a person — only to the app that declared it — and
a credential typed on a command line ends up in your shell history. Pipe it
in, or type it at the hidden prompt:

  pass show stripe | saasie app acme secret set STRIPE_SECRET_KEY
  saasie app acme secret set STRIPE_SECRET_KEY

When the key belongs to somebody else, send them a link instead. It sets
that one secret, once, and can never read the current value — so it is safe
to send to a person you would not give access to the Saasie:

  saasie app acme secret link STRIPE_SECRET_KEY

domain points a hostname you own at this Saasie. One record does it, and the
target is the Saasie itself rather than a shared address:

  www.example.com.   CNAME   acme.saasie.app.

That one line proves both halves at once — you cannot CNAME a domain you do
not own, and the target says which Saasie it is for. So there is no token to
paste and no TXT record to add, and nothing to arbitrate when two people
claim the same hostname: whoever's record actually resolves gets it.

Claiming it routes nothing. The platform follows the record back here first
and only then creates the route and orders the certificate — which is what
stops a typo in a CNAME from spending the hour of certificate attempts that
hostname is allowed. `domain list` says what the last check found.

A zone apex — example.com with no www — cannot be a CNAME, and providers
offering it anyway flatten it to an address that leads nowhere back. Point a
subdomain here and redirect the apex to it at your DNS provider.

With more than one service, say which one the hostname reaches:

  saasie app acme domain add api.example.com --service backend

Examples:
  git clone "$(saasie app acme git get-url)"
  git clone "$(saasie app acme git get-url --protocol https)"
  saasie app acme key add ~/.ssh/id_ed25519.pub
  psql "$(saasie app acme db get-url)"
  saasie app acme build list
  saasie app acme logs worker --tail 500 --since 15m
  saasie app acme analytics count --type signup --since 30d --group-by plan
  saasie app acme mail
  saasie app acme inbox
  saasie app acme secret list
  saasie app acme files
  saasie app acme queues
  saasie app acme domain add www.example.com
  saasie app acme domain list

The same text, on your machine: saasie app --help