The everyday commands
In a linked folder you never need --site. Elsewhere --site takes a name, a domain or an id.
| Command | What it does |
|---|---|
| hosting up | Creates the site if it does not exist yet, builds it and puts it online |
| hosting link my-shop | Links this folder to an existing site without publishing anything |
| hosting logs -f | Follows the logs until Ctrl+C; with --json one JSON line per log line |
| hosting env pull | Writes the non-secret variables to .env.local, like vercel env pull |
| hosting env add NAME --value-stdin | Sets a variable; the value only comes from stdin or a file |
| hosting promote <previewId> | Makes a preview the live release |
| hosting open --dashboard | Opens the site in Guard |
| hosting commands | Every command |
Local first, no account needed
hosting dev runs the whole stack on your own machine: Postgres with row-level security, sign-in with a local mail inbox, the Data API, Realtime and storage. When it works, dev push creates exactly the same configuration in Hosting.
infaris-guard hosting init --template realtime-todo todo-app --local
cd todo-app && npm install
infaris-guard hosting dev
infaris-guard hosting dev push # Auth, database, policies, bucket and functions
infaris-guard hosting upBuilt for scripts and agents
An AI agent or CI script needs to know for sure whether something worked. So every failure has its own exit code, --json returns a single JSON result, and a mistyped command names the closest one (linkk becomes hosting link) with exit code 2 instead of a silent success.
| Exit code | Meaning |
|---|---|
| 2 | Wrong usage: unknown command or missing flag |
| 3 | Not signed in |
| 4 | Not found |
| 5 | Conflict, already exists |
| 6 | Forbidden |
| 7 | Network error or timeout |
What hosting up does and does not upload
- node_modules, .git and .env never go up. Before the upload you see how many files and MB it is.
- At the root of a monorepo, or in a folder with more than 2,000 files or 200 MB, up asks first. Without a terminal it stops unless you pass --yes.
- Secrets go in through stdin or a file, never as an argument. That keeps them out of your shell history and out of an AI assistant's transcript.
Questions
- Which Node version do I need?
- Node 18 or later. Without installing: npx @infaris/guard-cli.
- Does it work in GitHub Actions or another CI?
- Yes, with a deploy token. Use the site's id in --site then; names and domains only work with a regular sign-in.
- Is there tab completion?
- Yes, for bash, zsh and fish: infaris-guard completion bash, zsh or fish. New commands work without a new script.
- Can I do the same things in a dashboard?
- Yes, everything is also in Guard under Hosting. The CLI and the MCP server use the same API.