slopfarm
v0.1.2
Published
Publish static browser games to Slop Farm from any coding agent.
Maintainers
Readme
Slop Farm CLI
Zero-dependency Node 20+ CLI to publish static browser games to Slop Farm.
Docs: https://slopfarm.games/cli
Schema: https://slopfarm.games/schemas/project.json
API: https://slopfarm.games/openapi.json
Install
# one-shot (recommended)
npx -y slopfarm@latest <command>
# or global
npm i -g slopfarmQuick start
npx -y slopfarm@latest login
npx -y slopfarm@latest init
npx -y slopfarm@latest validate --json
npx -y slopfarm@latest publish --yes --json- login — browser approval code; publish secret stored locally
- init — writes commit-safe
slopfarm.json - validate — runs only the declared build command, then checks the output folder
- publish — uploads changed files, verifies storage, submits an immutable release for moderation
Coding agents
Always use --yes and --json. Progress goes to stderr; one result object
goes to stdout.
npx -y slopfarm@latest publish --yes --jsonFor CI or headless agents, authorize once with login, then set:
export SLOPFARM_TOKEN=sf_live_…Never print, log, or commit SLOPFARM_TOKEN.
Optional with init --agent: writes SLOPFARM_AGENT.md with publish notes for agents.
Commands
| Command | Purpose |
| --- | --- |
| login | Authorize this machine |
| logout | Remove saved credentials |
| whoami | Show the authenticated creator |
| init | Create slopfarm.json |
| validate | Build and validate the game |
| preview | Preview in the production iframe sandbox |
| publish | Build, validate, and submit a release |
| status | Project and moderation status |
| releases | List immutable releases |
| rollback <id> | Restore an approved release |
| open | Open the game page |
Flags
| Flag | Purpose |
| --- | --- |
| --yes | Never prompt |
| --json | JSON result on stdout |
| --dry-run | Validate without publishing |
| --no-build | Validate existing build.output |
| --headless | Do not open a browser |
| --agent | With init, write SLOPFARM_AGENT.md |
Environment
| Variable | Purpose |
| --- | --- |
| SLOPFARM_TOKEN | CI / headless credential |
| SLOPFARM_API_URL | Override API origin (development) |
Manifest (slopfarm.json)
{
"$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,
"capabilities": {
"saves": true,
"multiplayer": { "maxPlayers": 4 }
},
"build": {
"command": "npm run build",
"output": "dist"
},
"entry": "index.html"
}- The CLI only runs
build.commandand only ships files underbuild.output. sourceUrlmust be an explicit public GitHub URL if set — the CLI never invents a remote.- On first publish,
projectIdis assigned and written back into the file (safe to commit). capabilitiesopts into the platform SDK for cross-device saves or private 2–8 player rooms. See the SDK guide.
Release model
Every publish creates an immutable release. Moderators review it before it goes live. An approved build stays playable while a newer release waits in review. Approval atomically points the public game at the new release.
Security
- Revoke devices anytime at My farm → Publishing CLIs
- Upload paths are traversal-safe; size and file counts are capped server-side
- Games run on a separate origin inside a sandboxed iframe
- Prefer relative asset paths in your build; no custom multiplayer server required
License
UNLICENSED — see the Slop Farm terms.
