cli
Zero-dependency Node CLI for terminals and coding agents. Build only what you declare, upload only what changed, and submit an immutable release for human review.
01
Requires Node 20+. No global install needed — use npx every time, or npm i -g slopfarm.
npx -y slopfarm@latest login npx -y slopfarm@latest init npx -y slopfarm@latest validate --json npx -y slopfarm@latest publish --yes --json
slopfarm.json (safe to commit). Detects a build command and output folder when it can.02
Agents should always pass --yes and --json. Progress messages go to stderr; one result object goes to stdout.
agent prompt
Publish this static browser game to Slop Farm. Requirements: - Node 20+ available - Use the official CLI only: npx -y slopfarm@latest - Never print, log, or commit SLOPFARM_TOKEN - Do not invent a GitHub sourceUrl unless I give one explicitly Steps: 1. If slopfarm.json is missing: npx -y slopfarm@latest init --yes 2. Ensure build.command and build.output match this project (only the declared build runs) 3. Validate: npx -y slopfarm@latest validate --json 4. When I say publish: npx -y slopfarm@latest publish --yes --json 5. Report status/game URL from JSON stdout; progress goes to stderr Auth: - Interactive: slopfarm login (browser approval code) - CI/headless: export SLOPFARM_TOKEN after one interactive login My project notes: [PASTE PATH, BUILD COMMAND, AND ENTRY FILE HERE]
Run slopfarm login once on a machine with a browser. Approve the code at /cli/authorize.
After one login, export the secret as SLOPFARM_TOKEN. Never print it, commit it, or paste it into chat logs.
03
The committed contract between your repo and Slop Farm. The CLI only runs build.command and only ships files under build.output.
{
"$schema": "https://slopfarm.games/schemas/project.json",
"projectId": null,
"title": "Block Buster",
"description": "Break bricks. Don't miss.",
"category": "Arcade",
"tags": ["arcade", "casual"],
"madeWith": ["Codex"],
"sourceUrl": null,
"build": {
"command": "npm run build",
"output": "dist"
},
"entry": "index.html"
}projectIdStable game id. Left null on first init; the CLI assigns a UUID on first publish and writes it back.
title / description / category / tags / madeWithCatalog metadata shown on the game page after approval.
sourceUrlOptional public GitHub URL only. The CLI never invents or publishes a Git remote.
build.commandExact shell command the CLI runs. Empty string means “already built”; use --no-build to skip.
build.outputRelative folder that contains the playable static build (must stay inside the project).
entryStart HTML file inside the output folder (usually index.html).
Full schema: /schemas/project.json
04
| Command | What it does |
|---|---|
loginnpx -y slopfarm@latest login | Authorize this machine with a short browser approval code. |
logout | Remove the saved credential from this machine. |
whoami | Show the authenticated creator account. |
initnpx -y slopfarm@latest init --yes | Create a commit-safe slopfarm.json for the current project. |
validatenpx -y slopfarm@latest validate --json | Run the declared build (unless --no-build) and validate the output folder. |
preview | Preview the build in the production iframe sandbox. |
publishnpx -y slopfarm@latest publish --yes --json | Build, validate, upload changed files, verify objects, and submit an immutable release for moderation. |
status | Show project and moderation status for the manifest projectId. |
releases | List immutable releases for the project. |
rollback <id> | Restore a previously approved release as the live build. |
open | Open the game page in your browser. |
05
--yesNever prompt (required for agents and CI).
--jsonEmit one stable JSON result on stdout; progress goes to stderr.
--dry-runValidate without creating a release or uploading files.
--no-buildSkip build.command and validate existing build.output.
--headlessDo not open a browser (login/preview/open).
--agentWith init, also write SLOPFARM_AGENT.md publishing notes.
SLOPFARM_TOKENBearer publish secret for CI or headless agents. Never commit it.
SLOPFARM_API_URLOverride API origin for local development (defaults to production).
06
slopfarm.json (unless --no-build).projectId, then opens an immutable release.Prefer the browser ZIP flow? Use Upload. Both paths hit the same /api/v1 release pipeline.