Pack and inspect
Seal a folder into one .cohostly file that only one account can deploy, look inside it safely, and deploy it.
cohostly pack seals your app into a single .cohostly file. Think of a courier bag with a combination lock that only one person knows. You can hand the bag to a colleague, store it in a repository or move it to a build server. Only people in the account it was made for can deploy it, and only until it expires.
Three commands work with these files.
cohostly pack.cohostly file.cohostly inspect <file>cohostly deploy <file>.cohostlyCareful Sealing keeps the code and the secret values unreadable to anyone who finds the file. It is not end-to-end encryption. Cohostly and its hosting infrastructure still see the code while building it.
pack
cohostly pack [folder] --out <file> [--no-secrets] [--env-file <file>] [--expires 7d] [--account <id>]
[folder]path--out <file>pathSay where to write the file, for example: cohostly pack --out app.cohostly.--no-secretson or off--env-file <file>pathenv.secrets are taken.--expires <Nd>days1d to 30d, whole days only. Default 7d. Otherwise: --expires needs a number of days from 1d to 30d, for example --expires 3d.--account <id>textYou are not a member of that account.You must be signed in, because the CLI fetches the platform's public key and your account list. Who may run it: anyone signed in.
What goes in the file
- A folder with
.cohostly/(and nocohostly.jsonof its own at the top): the snapshot is packed, meaning its settings and its generated Dockerfile. See snapshot and check. - Otherwise, the folder's
cohostly.jsonormanifest.json. With neither, the settings are empty. - The code, without
node_modules,.gitand similar folders, and without any.envfile.
Where the secret values come from
- In a snapshot folder where the plain file
.cohostly/env.jsonstill exists, those values are sealed in unless you pass--no-secrets. - With
--env-file, only the names declared inenv.secretsare taken. Names that are missing from the file are listed:Not in <file>, so not in the file: A, B. - If the folder only has
.cohostly/env.enc, its values are not copied in:The values in .cohostly/env.enc are not in this file (they are sealed for deploying from the folder). Add them with --env-file if the file should carry them.
pack refuses to seal if a secret value appears in the readable settings, or if one name is both a plain variable and a secret.
What it prints
$ cohostly pack --out app.cohostly --expires 3d Wrote app.cohostly (412 KB). It expires 2026-11-01. Sealed secrets: STRIPE_KEY, MAIL_KEY.
With no secrets it ends with No secrets inside. The file is written readable only by you (0600).
What is inside
A compressed archive holding snapshot.json, a readable copy of the settings (cohostly.json), the sealed code (source.enc) and, if there are secrets, the sealed values (secrets.enc). The code and the values are encrypted. The readable settings, the account and the expiry are bound into the seal, so editing any of them afterwards makes the file fail with snapshot_tampered.
inspect
cohostly inspect <file>
Reads the file on your computer. It makes no network call and decrypts nothing. It prints:
- the file name, when it was
made, and when itexpires(with(EXPIRED: make a new one with cohostly pack --out)if past) account:only people in this account can deploy itsecrets:sealed inside: A, B, ornot included; the settings name A, B, to be set under Secretstools: the build tool and CLI versions it was made with- a
Build settings:table The code and the secret values are sealed; this command did not open them.
Errors: That is not a Cohostly snapshot. and Update Cohostly to open this file. It was made by a newer version. Both exit 1.
Deploy a file
cohostly deploy app.cohostly [--project <name>] [--verbose]
- The project name defaults to the file name, lower-cased, with anything that is not a letter or digit turned into
-. - It prints
Deploying <project> from <file> ..., then the usual outcome (see put an app online), thenLive: <url>. - It never asks a question.
- Files up to 25 MiB go in the request. Bigger files are uploaded to a temporary address first (valid for 15 minutes), then deployed from there. This is how a
.cohostlyfile gets past the 30 MB limit of a plain folder deploy.
If the platform cannot open the file, the failure has a Code::
snapshot_invalidcohostly pack --out, or update the CLI if a newer one made it.snapshot_expiredsnapshot_wrong_accountsnapshot_tamperedsnapshot_unavailableFiles read and written
Reads the folder (and the env file you name). Writes the .cohostly file. Caches the platform's public key under ~/.cohostly/keys. If you are offline, pack uses the newest cached key. Needs a saved key or PLATFORM_API_KEY.
Exit codes
0 on success, 1 on any failure.
Examples
Seal the current folder for three days and take secrets from a file:
cohostly pack --out app.cohostly --expires 3d --env-file .env.staging
Look inside a file before sending it on:
cohostly inspect app.cohostly
Deploy it under another name from a build server:
export PLATFORM_API_KEY="$COHOSTLY_KEY_FROM_YOUR_CI_SECRET_STORE" cohostly deploy app.cohostly --project shop-staging