CLI

The remix command that creates, imports and publishes flat game folders, and its machine-readable mode for agents.

The remix command is the bridge between coding agents and the platform. Remix Desktop bundles it and runs the same commands when you create, import or publish from the app, so terminal and app workflows share one project format.

remix create game      # create a Remix draft and a flat game folder
remix publish          # compile and upload a new playable version
remix import <dir>     # adopt a game folder into your library

Authentication

Run remix login before publishing. It completes authentication in the browser and saves the key to ~/.remix/config.json with mode 600. Setting REMIX_API_KEY in the environment takes precedence over the saved key. Keys are created on your API console. remix logout removes the saved key from this machine; revoke the key itself on the API console.

Commands

remix create game

Creates the remote draft, scaffolds the flat folder from the template and writes the real gameId to remix.json. It never runs a package manager.

FlagMeaning
--name <name>Skip the name prompt. Names are 5 to 25 characters and unique per account.
--dir <path>Where to create the folder.
--mode arcade|levels|experience|portalarcade, the default, is a scored run. levels writes lifecycle: "levels" and a starting levelCount of 5. experience is open-ended. portal starts a portal world.
--target mobile|desktopThe surface the game targets. Defaults to mobile; a portal world is always desktop.
--orientation portrait|landscapeHow a mobile game holds the phone. A desktop game is always landscape.
--no-reuseWithout a terminal, create reuses your unpublished game of the same name; this flag answers name-taken instead.

remix publish [dir]

Compiles game-main.ts and its imports into one HTML document, hosts every literal assets/ reference and every achievement icon, checks the pinned engine URLs, forwards leaderboards and achievements from remix.json, and uploads a new draft version. A build over 2 MB of HTML is refused with game-too-large; move large data into assets/. Warnings about declarations that could not take effect are printed after the upload.

--launch then takes the version live once it passes the automated review. Without it, launch from the Studio or Remix Desktop.

remix import <dir>

Adopts a game folder into your games library, finished or not. A folder without remix.json gets one named after the folder, and the result lists any of index.html and game-main.ts still missing. --move moves instead of copies. The library is --library-dir, then REMIX_GAMES_DIR, then ~/RemixGames.

Machine Mode

--json writes one NDJSON object per line to stdout and sends human-readable text to stderr:

{ "event": "step", "step": "scaffolding", "detail": "grid-invaders" }
{ "event": "result", "dir": "/Users/me/RemixGames/grid-invaders", "gameId": "…" }
{ "event": "error", "code": "name-taken", "message": "…" }

--yes never prompts and returns input-required when a required value has no default. Non-interactive terminals imply --yes. Agents should treat the event stream as the contract and ignore stderr.

Environment Variables

VariableMeaning
REMIX_API_KEYOverrides the saved login.
REMIX_API_URLOverrides the API base. Default https://remix.gg.
REMIX_GAMES_DIROverrides the local games library.

What the CLI does not do

Preview is owned by Remix Desktop. Games have no package manager, no local dev command, no dependency installation and no framework-upgrade command. The platform owns the engine version a publish emits.