SALVO is a Phaser + Next.js Battleship experience that pits you against Copilot via the Copilot CLI.
- Node.js 18+ (tested with 23)
- Copilot CLI installed locally and available in PATH (required for AI mode)
npm install
npm run devOpen http://localhost:3000.
- Place ships by clicking your board.
- Press R to rotate orientation.
- Click the enemy board to fire.
- The battle log records every move and Copilot response.
app/components/GameClient.tsx: UI shell, log, and Copilot calls.lib/scene.ts: Phaser scene, rendering, placement, and battle logic.app/api/ai/route.ts: Copilot CLI bridge (shot selection + endgame message).app/api/models/route.ts: runtime list of Copilot models available to the user.lib/aiPrompts.ts: system prompts for move selection and endgame messages.lib/aiParsers.ts: parsing helpers for Copilot responses.
This mode uses the GitHub Copilot SDK, which talks to the Copilot CLI in the background. The model selector is populated by querying the CLI at runtime (/api/models).
Configure the CLI and model before starting the server:
export COPILOT_MODEL=gpt-4.1You can also switch the model from the UI (top selector).
Prompt and response logs are printed to the browser/server console by default. To disable:
export COPILOT_DEBUG=0SALVO is intended to run with the Copilot CLI available on the local machine. The Electron wrapper starts the local Next.js server automatically in production builds.
Development (two terminals):
npm run dev
npm run electron:devIf the dev server uses a non-3000 port, set ELECTRON_DEV_URL:
ELECTRON_DEV_URL=http://localhost:3001 npm run electron:devProduction build:
npm run electron:buildPackaged apps are emitted to dist/. Ensure Copilot CLI is installed and authenticated on the target machine.
If you update public/favicon.svg, regenerate the desktop icon:
npm run generate:iconsThe splash animation is authored in Remotion and rendered to public/splash.mp4, which the Electron splash window plays on launch.
Preview the composition:
npm run remotion:previewRender the splash video:
npm run remotion:render:splashIf public/splash.mp4 is missing, the splash window falls back to a static title screen.
Tag a release to trigger cross-platform builds:
git tag v0.0.13
git push origin v0.0.13Artifacts are uploaded to the GitHub Release from dist/ for macOS and Windows.
npm test- AI mode requires GitHub Copilot SDK + Copilot CLI; if the CLI is unavailable the UI blocks with setup instructions.
- With
COPILOT_DEBUG=0, prompt and response logs are hidden in the browser/server console. - Static export/GitHub Pages builds are not supported.
- Nothing is installed outside this folder.
