Deploy with agents
How AI agents should deploy Coderunner workloads and publish Shell apps on Groundfloor — without creating the wrong kind of App.
This page is for AI agents and automation. Humans can follow it too. Production hosts only.
| Host | URL |
|---|---|
| Customer Portal | console.groundfloor.cloud |
| Control Plane API | https://platform.groundfloor.cloud |
| App / Shell hosts | *.app.groundfloor.cloud (deployed apps — not the portal) |
| Docs | docs.groundfloor.cloud |
Agent rules
- Pick the path from the user's goal (table below). Do not invent a second deploy path.
- A human must sign in once (
gf login). You cannot complete browser login. MCP reads that session from~/.groundfloor— do not paste JWTs into Cursor MCP config. Switch workspace withgf workspaces use <uuid>. Scripts may still useeval "$(gf env)"orGROUNDFLOOR_TOKEN=$(gf token). - Never
POST /v1/workspaces/{id}/appswithapp_kind=coderunner— it is rejected. - Do not upload
.envfiles or secrets inside ZIPs. - Prefer MCP or
gfover driving the Portal UI.
Permissions before calling APIs
Groundfloor has more than one permission plane. Pick the right one before diagnosing 403.
| Goal | Token | What must exist |
|---|---|---|
| Portal / Control Plane builder APIs | Platform JWT (gf login / portal session) | Members & Roles on the account or workspace (read, write, ddl, manage_members, …) |
| Shell / federated app as an end user | Workspace-site JWT | Authentication site role and, for database tables in Vault, collection Access |
| Invite portal teammate | Platform JWT + manage_members | POST /v1/scopes/…/members with email (optional password to skip invite mail) |
| Create Shell end user | Platform JWT + workspace administer | POST …/users (invite) or POST …/users/add (password) |
Managed database APIs / Vault (suggestive)
When the user wants to browse databases, query tables, or use managed database APIs:
- Use Control Plane vault routes —
…/v1/workspaces/{id}/vault/…. That is the supported API surface. Do not call Dataplane product hosts or embed service keys (Dataplane is the product behind the proxy). - If they asked to query table X with a Shell user and you get
403/ empty list → suggest granting collection Access for their site role. Default is admin-only. - If they are a portal operator and get
403→ suggest the correct platform role on Members & Roles (writerfor data edits, admin for DDL/Access). - After creating a collection, remind that Shell non-admins need an Access grant before they can use the new table.
- Do not “fix” vault denials by minting portal
ownerunless the operator asked for builder access. - To provision a Postgres/Redis/… cluster (not browse rows), use Managed Databases — Vault is for browsing and querying data.
Details: Data Vault API · Dataplane authz brief · ReBAC model
Which path?
| User wants… | Do this | Do not |
|---|---|---|
| Run a function, job, schedule, or service | MCP workspace_context / suggest_cli, then gf deploy | Create an App |
| Publish a Shell UI (Module Federation remote / starter-kit) | gf apps create (once) → npm run release → gf apps publish | gf deploy on the starter-kit |
| Wrap an existing service as a product | gf apps create --kind standalone --primary-coderunner <id> | Create app_kind=coderunner |
| Call APIs from a script | gf token as Authorization: Bearer | Treat portal gf_* API keys as Code Runner tokens |
Auth and workspace
npm i -g @groundfloorcloud/cli # or npx @groundfloorcloud/cli
gf login # human, browser or --device
gf workspaces
gf workspaces use <workspace-uuid>
eval "$(gf env)" # GROUNDFLOOR_TOKEN, CONTROLPLANE_URL, …Ask once if missing: workspace UUID, and whether the target is a workload or a Shell app.
For Cursor MCP, add @groundfloorcloud/mcp (no JWT in mcp.json). It inspects the workspace and docs, then suggests gf commands. Mutations stay on the CLI.
{
"mcpServers": {
"groundfloor": {
"command": "npx",
"args": ["-y", "@groundfloorcloud/mcp"]
}
}
}Start with workspace_context (what exists) and docs_get (how). Run the command from suggest_cli.
Workloads (Coderunner)
Before create: gf login and a workspace with write. Authentication is optional (end-user login only). Types: function, job, schedule, service (also called Deployment). service requires a root Dockerfile. Node needs scripts.start and must listen on PORT/8080. MCP docs_get id coderunner has the full table.
Preferred order:
- MCP
workspace_context+docs_get(coderunner) +suggest_cli(inspect; MCP does not deploy) - CLI:
gf deploy
gf deploy --name my-fn --runtime python --workload-type function
gf deploy --workload-type service
gf deploy --git https://github.com/me/my-fn.git --ref main
gf coderunner run -c <id|slug> --payload '{"hello":"agent"}'- REST at
$CONTROLPLANE_URL/v1/workspaces/$WORKSPACE_ID/coderunners— create (unless reusing id/slug) → ZIP upload → poll version until build3→ deploy → poll deployment until3→ optional run.
Optional --app-id binds a helper to an existing product App. Do not create an App solely to deploy.
Project defaults: groundfloor.json (name, runtime, workloadType, cpu, memory, env).
Local live data: eval "$(gf env)" then call vault/files/secrets with gf token; gf deploy the same tree. Do not zip .env files.
Details: Developers, Coderunner.
Shell apps (starter-kit)
Use this when the project is the Shell starter-kit (groundfloor.manifest.json + vite.config.ts + src/App.tsx), or the user asked to publish a federated remote / release.zip.
gf apps create --name "My Federated App" --slug my-federated-app \
--kind shell_federated --manifest ./groundfloor.manifest.json
# skip create if gf apps ls already shows this slug
# Match Portal slug:
# groundfloor.manifest.json → appId
# vite.config.ts → APP_ID
npm install
npm run release # → release.zip with remoteEntry.js at zip root
gf apps publish --path release.zipgf apps publish resolves the app from the argument, --app, or appId in groundfloor.manifest.json next to the zip. It uploads through Control Plane (32 MB cap), finalizes, and PATCHes the Portal manifest unless --no-sync-manifest.
Do not hand-author remoteEntry.js. After success, report app id, slug, build number, and remote_url.
Starter-kit README: same rules, in-repo at examples/shell-starter-kit. Guides: Apps, Shell getting started.
Related
- Developers — CLI install, tokens, MCP, git push-to-deploy
- Members & Roles — platform Invite / Add
- Authentication — site users and roles
- Data Vault — collection Access for tables
- Apps — product packaging
- Coderunner overview
- API authentication