Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ or miss one that does. A test fails the build when it drifts.
| `moshcode doh` | hosting | run the DNS-over-HTTPS resolver |
| `moshcode site` <br>`serve` | hosting | install web-server config for a Moshpit name |
| `moshcode template` <br>`templates` | hosting | scaffold a stack for a Moshpit-hosted service |
| `moshcode games` <br>`game` `arcade` | arcade | the moshcode arcade — six games, no menus |
| `moshcode pwd` <br>`where` | system | show the current directory and git context |
| `moshcode engines` | engines | list engines and installation status |
| `moshcode tools` | tools | list workflow tools and installation status |
Expand Down Expand Up @@ -581,6 +582,47 @@ event, and publishes it to the displayed relays. Both flows leave the final
confirmation in the browser. If the pit is remote or headless, `/post` prints
the composer URL instead.

## The arcade (`/games`)

Six games, in the pit or straight from a shell. There are no menus, no options
screens and no difficulty prompts — `/games tetris` is already playing.

```sh
moshcode games # the cabinet (pit: /games)
moshcode games tetris # play one (pit: /games tetris)
moshcode games --json # the roster, for a machine
```

```
TETRIS score 1200 · lines 12
┌────────────────────────────────┐
│ · · · · ████· · · · NEXT │
│ · · · · ████· · · · │
│ · · · · · · · · · · ████████ │
│ · · · · · · · · · · │
│ · · · ████· · · · · LVL 2 │
│ ████████████· ██████ │
└────────────────────────────────┘
← → move · ↑ rotate · ↓ drop one · space slam · q quit
```

| game | |
|---|---|
| `tetris` | stack the bricks, clear the lines, outrun gravity |
| `snake` | eat, grow, and try not to eat yourself |
| `pacman` | eat the dots, dodge the ghosts, `✳` makes them edible |
| `tictactoe` | three in a row against an opponent that cannot be beaten |
| `chess` | full rules — castling, en passant, promotion — and it plays back |
| `hangman` | six wrong letters and you are done for |

Every one of them works the same way: arrows move, `q` quits, `r` starts
another, and the controls are written along the bottom of the game itself. Each
draws in place rather than on the alternate screen, so the board you finished on
stays in your scrollback.

Playing needs a real terminal, because they read single keypresses — `moshcode
games` on its own lists them anywhere, including a pipe.

## Settings sync (`/save` and `/load`)

Your pit becomes yours by accretion — a dozen aliases, herd rules you tuned until
Expand Down
6 changes: 6 additions & 0 deletions bin/moshcode.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { describeUninstall, uninstallPlan } from "../src/uninstall.mjs";
import { mcpCommand, pluginCommand, skillCommand } from "../src/integrations.mjs";
import { stocksCommand } from "../src/advisor.mjs";
import { cryptoCommand } from "../src/crypto.mjs";
import { gamesCommand } from "../src/games.mjs";
import { canOpenBrowser, openBrowser } from "../src/open-url.mjs";
import { locate, tilde } from "../src/pwd.mjs";
import { createPrd, listPrds, authoringPrompt } from "../src/prd.mjs";
Expand Down Expand Up @@ -398,6 +399,11 @@ async function main() {
if (code) process.exitCode = code;
return;
}
if (cmd === "games" || cmd === "game" || cmd === "arcade") {
const code = await gamesCommand(rest);
if (code) process.exitCode = code;
return;
}
if (cmd === "console") {
const code = await consoleCommand(rest);
if (code) process.exitCode = code;
Expand Down
24 changes: 24 additions & 0 deletions src/cli-schema.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
{ key: "tools", title: "tools" },
{ key: "extend", title: "extend" },
{ key: "script", title: "script" },
{ key: "arcade", title: "arcade" },
{ key: "account", title: "account" },
{ key: "hosting", title: "hosting" },
{ key: "system", title: "system" },
Expand Down Expand Up @@ -392,6 +393,27 @@
seeAlso: ["site"],
},
{ name: "templates", aliasOf: "template", description: "alias for template" },
{
name: "games",
group: "arcade",
description: "the moshcode arcade — six games, no menus",
synopsis: [
["moshcode games", "the cabinet, and what each one is"],
["moshcode games <game>", "play it, right here in the terminal"],
],
flags: [["--json", "the roster, machine-readable", ""]],
examples: [
["moshcode games", "what is in the arcade"],
["moshcode games tetris", ""],
["moshcode games chess", "real rules, and it plays back"],
["moshcode games pacman", "dots, ghosts, three lives"],
],
seeAlso: ["help"],
note: "every game works the same way: arrows move, q quits, r starts another. "
+ "Playing needs a real terminal because they read single keypresses — `moshcode games` on its own lists them anywhere.",
},
{ name: "game", aliasOf: "games", description: "alias for games" },
{ name: "arcade", aliasOf: "games", description: "alias for games" },
{
name: "pwd",
group: "system",
Expand Down Expand Up @@ -907,6 +929,8 @@
description: "crypto market data from advis0r.com" },
{ name: "plugin", aliases: ["plugins"], args: "<verb> [name]", cli: "plugin",
description: "install moshcode's slash commands into Claude Code" },
{ name: "games", aliases: ["game", "arcade", "play"], args: "[game]", cli: "games",
description: "the arcade — tetris, snake, pac-man, tic-tac-toe, chess, hangman" },
{ name: "socials", aliases: ["social"], pitOnly: true,
description: "list social networks available for posting" },
{ name: "post", args: '<social> "message"', pitOnly: true,
Expand Down
Loading