gipity deploy pushes your project live. It runs a multi-phase pipeline server-side and is the step most likely to surface mistakes - so deploy early and often, and read the phase results every time.

The build loop

gipity add → edit files → gipity deploy --inspect → fix errors → repeat

--inspect runs the page-inspect report (console, failed resources, timing, overflow) on the live URL right after the deploy - one command instead of deploy-then-inspect. See app-debugging for the inspect step and its standalone form.

Where a deploy goes: prod and environments

gipity deploy            # a new app: prod → https://app.gipity.ai/<account>/<project>/
gipity deploy dev        # the dev environment → https://dev.gipity.ai/<account>/<project>/
gipity deploy staging    # any other environment → https://dev.gipity.ai/<account>/<project>--staging/
gipity deploy prod       # prod, always

An app starts as just prod. A bare gipity deploy deploys prod while the app has no environments - most apps never need one. Once real users depend on the app, work in an environment instead: gipity deploy dev creates dev on first use and deploys to it, and from then on a bare gipity deploy is refused until you say where (dev or prod), so nothing reaches prod by accident.

Each environment is a full, isolated copy of the backend, built from the same source: its own database (created from your migrations + seeds, empty of prod's data), its own functions, workflows, jobs, realtime rooms, uploads and logs, at its own URL and app guid. Nothing in one environment can read or change another's data. An env deploy never touches prod, and a migration runs on an environment only when you deploy to it - so deploy it to dev, check it, then gipity deploy prod.

What an environment shares with the app: secrets (an env can override one: gipity secrets set STRIPE_KEY sk_test_... --env staging), members, and players (a Steam or guest player is the same player in every env). What's different in an environment: cron workflows are off until gipity env set <name> --schedules on; email reaches only the app owner and members; payments (checkout) run in prod only; pages are not minified (no Vite build) and get live reload, same as a dev deploy always did.

Every other command takes --env <name> to act on an environment instead of prod: gipity db query "..." --env dev, gipity fn call checkout --env staging, gipity logs fn checkout --env dev, gipity domain add staging.example.com --env staging. Manage them with gipity env (list, create, reset, set, delete). To try a change against prod's real data, gipity env create staging --data copies prod's rows into the new env (--from <env> copies another env instead); gipity env reset <name> [--data] drops an env's database and rebuilds it from your migrations. Names are lowercase letters, digits and single hyphens (dev, dev2, feat-auth); prod and test are reserved. Free includes one environment, Pro ten.

Migrations on prod. Each migration file runs as one transaction: if any statement fails, the whole file rolls back and the deploy says which statement and why. Don't put BEGIN/COMMIT in a migration file; the deploy rejects it. A prod deploy with a pending migration that destroys data (DROP TABLE, DROP COLUMN, TRUNCATE, DELETE without WHERE, a column type change) stops before running anything and names the statement; re-run with --yes-destructive when that's intended. Environment deploys never ask. gipity deploy prod --plan shows prod's pending migrations, which ones destroy data, and where each already ran, without deploying anything.

Commands

Flag Effect
--inspect [path] After a successful deploy, run page inspect on the deployed URL (optionally URL + path) in the same command
--only <phases> Run only these phases, comma-separated (e.g. --only database)
--force Re-run every phase, ignore checksums
--yes-destructive Let a prod deploy run pending migrations that destroy data (see above)
--plan Show the pending migrations this deploy would run, and where each already ran; deploys nothing
--optimize Bundle and minify with Vite (off by default: files upload as-is on every target). Only bundles <script type="module"> references; a page eval import('./js/x.js') then loads a separate copy of the module
--source-dir <dir> Deploy static files from a directory other than src/
--no-sync Skip the sync-up that normally runs before deploy
--json Machine-readable output (the phases array)

gipity.yaml - the deploy manifest

A project without gipity.yaml gets a plain static-file deploy (the src/ folder → CDN). A project with gipity.yaml gets the full multi-phase pipeline. Every template ships one (web-simple's has only the files phase).

Deploy is opt-in: it ships only the folders a phase names as its source (src/ to the CDN, plus migrations//functions/ as backend). Anything else at the project root is kept but never deployed - that's by design. Put reference material you want to keep (diagrams, decks, notes) in docs/ and throwaway scratch (conversions, intermediate output) in tmp/ (sync-ignored, like *_tmp/ and .gipityscratch/); neither bloats a deploy. The trap is a bulky output dir dropped loose at the root (out/, vsd_out/) - those aren't scratch, so they sync and re-hash on every deploy; move them to docs/ (keep) or tmp/ (toss). See the "Where files go" section of the Files-and-sync guidance.

version: 1

deploy:
  phases:
    # Static frontend → CDN
    - name: files
      type: static
      source: src

    # SQL migrations → user database (idempotent, each runs once)
    - name: database
      type: sql
      source: migrations
      database: {{DATABASE}}

    # Serverless functions → HTTP endpoints
    - name: functions
      type: functions
      source: functions
      functions:
        - name: list-items
          auth: public
          tables: [items]            # grant DB access; add fetch_domains: [...] to call out

    # Automated workflows → reconciled into real workflows + scheduled
    - name: workflows
      type: workflows
      source: workflows

Every key is checked. An unknown key anywhere in the file (table: for tables:, functions: for functions:) fails the deploy's manifest step and gipity test, naming the key, the likely intended one, and the keys that spot accepts - it is never silently dropped.

Phases

Phase type Source What it does
static src/ Uploads frontend files to the CDN
sql migrations/ Auto-creates the database and runs each migration once (idempotent). It also re-runs seed files only if the phase declares an explicit seed: <dir> key - there is no automatic seeds/ folder; migrations/ is the only default source. To keep reference rows alive through gipity test's DB reset, see test.preserve in app-testing.
functions functions/ Deploys each .js file as an HTTP endpoint with its declared permissions
workflows workflows/ Parses each .yaml and creates/updates the workflow (idempotent), then arms its schedule
records (declared inline) Exposes existing DB tables via Gipity Records - sets each table's auth_level (public = anonymous writes), searchable, primary key. Idempotent. Place AFTER the sql phase.
services (declared inline) Sets the billing mode of your app's AI services (llm, image, transcribe, ...) - who pays when the service is called - plus model/provider limits for llm and image. Idempotent.

The directory is the declaration. If src/ has an .html page, migrations/ a .sql file, functions/ a .js file or workflows/ a .yaml file and no phase of that type exists, deploy adds the phase above (and writes it into gipity.yaml). So an api app grows a database by writing migrations/001-<name>.sql (the sql phase creates the database; no gipity db create) and a page by writing src/index.html.

Every deployed page gets the Gipity client SDK. A full HTML page without the gipity.js tag gets one added before </head>, and an existing tag is pointed at the environment being deployed, so Gipity.fn / Gipity.service work from any page you write by hand. Opt a page out with <!-- no-gipity-sdk -->.

A services phase declares who pays for each AI service, so an app's billing choice ships with its gipity.yaml and is reproduced on every deploy (to a fresh project, a fork, prod or an environment) instead of living only as out-of-band server state:

- name: services
  type: services
  services:
    - service: llm
      billing_mode: owner_pays   # you (the app owner) pay; no user login needed
    - service: image
      billing_mode: owner_pays
    - service: transcribe
      billing_mode: owner_pays

billing_mode is user_pays (the safe-to-share default - each signed-in user spends their own credits) or owner_pays (you subsidize it; anonymous/logged-out callers and serverless functions work too). Billing is declared once in gipity.yaml and applies to prod and every environment on its next deploy. See app-llm for the billing-mode details.

Two services also take limits on the same entry, checked against the live catalog at deploy (a typo fails the deploy, not every call):

Service Key Meaning
llm allowed_models List of model ids or aliases (fast, medium, ...) the app may request; anything else is a 400
llm default_model Model used when a request names none (must be allowed)
llm max_tokens_cap Output-token ceiling, 1 to the platform cap
image allowed_providers Providers the app may use (openai, bfl, gemini); editing needs gemini
image default_provider Provider used when a request names none (must be allowed)
    - service: llm
      billing_mode: owner_pays
      allowed_models: [fast, medium]
      default_model: fast
      max_tokens_cap: 1000

The manifest is the source of truth: deleting a key and redeploying resets it to the platform default.

No-sign-in app? Set owner_pays on every service it calls - billing is per-service. An anonymous/logged-out call to a user_pays service returns 401 LOGIN_REQUIRED (there's no signed-in user to bill). The common footgun: setting llm: owner_pays and leaving the rest at the user_pays default, so text generation works but read-aloud (tts) / image / sound / music silently 401 for anonymous visitors. Grep your client/function code for /services/<name> to list everything the app calls, and add one services line per service. (If you'd rather visitors pay, gate the feature behind "Sign in with Gipity" and keep user_pays.) The 401 body carries a hint field naming the offending service.

location and notify are exempt from all of this: neither is credit-billed, so they need no services entry and never 401 an anonymous caller (notify sends are owner-billed automatically). email likewise needs no services entry (it's always owner-billed, never user_pays), though unlike those two it is credit-billed - one credit per recipient sent.

A records phase is the declarative, agent-free way to make a table publicly writable (e.g. a contact form) - the table is declared inline, not from a source dir:

- name: records
  type: records
  tables:
    - table: contact_messages
      auth_level: public   # public | member (default) | user
      searchable: false

Or flip one table without redeploying: gipity records config <table> --auth public.

A table can also declare field metadata - every write through the Records API (REST, workflow record steps, bulk) then coerces and validates the declared fields, with self-correcting error messages; undeclared columns pass through untouched. title: true marks the field that names the record in the English audit summaries on /history:

- name: records
  type: records
  tables:
    - table: deals
      auth_level: user
      fields:
        - { name: name, type: text, required: true, title: true }
        - { name: stage, type: select, options: { values: [Lead, Proposal, Won, Lost] } }
        - { name: value, type: currency, label: Deal value }   # stored as JSONB { amountMicros, currencyCode }
        - { name: close_date, type: date }

Field types: text, textarea, number, boolean, date (YYYY-MM-DD), select (options.values), json, and the composites currency ({ amountMicros, currencyCode } - accepts a plain number of whole units), name ({ firstName, lastName } - accepts a full-name string), emails / phones / links (primary + additional, accept a bare string), address (street/city/state/postcode/country/lat/lng). Composite columns must be JSONB. relation describes an existing FK column (options: { table, display }) - the value stays the raw id and Postgres enforces integrity. Presentation keys for generated UIs: hide, section, help (field order = declaration order). A required field is enforced on create. Validation errors are 400s that state what valid input looks like, so an agent (or user) can self-correct. GET /api/<appGuid>/schema/<table> returns the live columns merged with this metadata - the one contract UI generators consume.

A workflows phase makes automations part of the build loop: edit workflows/*.yaml, redeploy, and the workflow is created or updated in place (matched by name) and scheduled. See workflow for the YAML shape.

functions

Functions auto-deploy as public endpoints. For a function with no entry, deploy adds one to gipity.yaml with the tables and services its code plainly uses: tables from SQL string literals, records.*('t') and db.describe('t'); services from calls like embed(...) or realtime.publish(...). gipity test grants the same before the first deploy. A table named only in a variable isn't detected (the runtime error names it). Once an entry exists it is authoritative: edit it to change auth or grant more:

Field Purpose
name Function file name (without .js)
auth public (no auth), user (any signed-in user), member (owner-only: you + anyone you add to the project - use for admin/approval endpoints)
tables Database tables the function may read/write
fetch_domains External hosts the function may fetch (also gates storage.importUrl). *.gipity.ai is blocked except GET/HEAD to a few public endpoints (health checks, static hosting; see app-function-services)
services Injected app services the function may call (llm, image, tts, sound, music, video, transcribe, location, notify, email, realtime, embed) - required: calling an undeclared one throws
public_write true records that an auth: public function writing to the database is intended (guestbook, signed webhook, token-gated unsubscribe). Grants nothing; it silences the deploy's fn-public-write advisor warning. Without it, every deploy warns about each public function that writes data. For personal data, use auth: user instead (see app-development)
hooks Platform events that call this function. user_created: runs after a new app user signs up, with ctx.trigger = { type: 'user_created', userGuid, user: { provider, displayName, email } } (welcome email, profile row; failures only show in its logs). user_deleted: runs before an app user is erased, with ctx.trigger = { type: 'user_deleted', userGuid }; use it to delete their rows. A user_deleted failure stops the deletion (502 PLAYER_CLEANUP_FAILED). Declare such functions auth: member so only the platform and you can run them. See app-auth.

auth (optional) - who signs in

A top-level auth: block sets the app's sign-in mode on every deploy: gipity (Sign in with Gipity), app (the app's own users: email code, Google, Discord, Apple, guests) or both. It is app-wide (dev and prod share it). No block leaves the mode as it is; gipity project auth <mode> sets it at once and writes the block. See app-users.

auth:
  mode: both

access (optional) - private pages

By default a deployed site's pages and files are public: anyone with the URL can load them (functions and data have their own auth). A top-level access: block makes the pages private too, every page and asset, on the Gipity URL and any custom domain:

access:
  mode: members            # public | members | app-users
  emails: [ana@acme.com, "@acme.com"]   # optional: only these people (exact email or a whole domain)
  environments: [dev]      # optional: only these environments (prod is "prod"); the rest stay public

auth_branding (optional) - style ONLY the "Sign in with Gipity" page

Scope: this styles only the Sign in with Gipity login/consent pages (server-rendered by Gipity). It does not theme your app's own UI - your app's look comes from your own CSS. So tagline / primary_color here change the sign-in screen, nothing else.

By default the sign-in page shows Gipity defaults (your project name, Gipity orange, the Gipity wordmark). Add a top-level auth_branding: block - a sibling of deploy:, not a phase - and gipity deploy syncs it to your project so that page matches your app:

version: 1

auth_branding:                  # styles the Sign in with Gipity page only
  app_name: Lilyboxd            # name shown ("Sign in to continue to Lilyboxd")
  primary_color: "#fea60b"      # accent for buttons/headings - MUST be quoted (see note)
  logo_url: https://media.gipity.ai/.../logo.png   # https only; replaces the Gipity wordmark
  tagline: Your film diary      # optional one-line subtitle

deploy:
  phases:
    - { name: files, type: static, source: src }
Field Rules
app_name 1-100 chars. Overrides the project name on the page.
primary_color #RRGGBB hex only (no 3-digit, no alpha).
logo_url https:// only, ≤2048 chars. Omit to show the Gipity wordmark.
tagline ≤120 chars.

All fields optional - set only what you want to override; the rest fall back to Gipity defaults. It's declarative: the block is the source of truth, so it replaces the stored values on each deploy (delete a field to revert it to default). The app icon glyph set by gipity brand set --emoji is not one of these fields and is kept. It's checksummed like a phase - unchanged blocks are skipped - and reported as an auth_branding line in the deploy results. A bad value (e.g. an invalid color) fails only the auth_branding step with a FIX gipity.yaml message; the rest of your deploy still lands. Each environment gets its own copy: gipity deploy dev brands only dev's sign-in page, so you preview a change there before gipity deploy prod puts it on prod's; an environment that hasn't synced a block yet shows prod's branding.

Quote the hex color. In YAML a bare # starts a comment, so primary_color: #fea60b parses as empty. Always quote it: primary_color: "#fea60b".

Checksums - phases skip when unchanged

On re-deploy, a phase whose inputs haven't changed is skipped (you'll see it reported as unchanged). Use --force to re-run everything, or --only <phase> to target one phase.

The database phase verifies its checksums still describe the actual database: if the database was dropped, recreated, or emptied since the last deploy, the next deploy detects it, reports database was recreated - schema re-applied, and re-runs all migrations (and any configured seed: files) instead of skipping them.

Read the phase results - every deploy

Each phase reports a status. Do not move on until they're all clean:

Status Meaning Action
ok ✓ Phase succeeded None
warning ⚠ Deprecated or mis-shaped input (usually gipity.yaml); summary starts with "FIX" Treat as a TODO - fix the file and redeploy
failed ✗ Phase did not complete (including any function, job or workflow that failed to register, e.g. an unknown services: name); later phases are skipped and gipity deploy exits non-zero Fix before doing anything else - the deploy did not fully land
skipped → Nothing to do (unchanged, empty source dir), or a previous phase failed None, unless it says "previous phase failed"

A warning is not informational. Leaving it unresolved means something is already broken or about to be.

An advisor row is a security check over what the deploy registered, such as fn-public-write (an auth: public function that writes data). It never blocks the deploy, but it names a hole anyone with the URL can use: apply its fix, or set public_write: true on the function only when public writes are the intent.

Related skills