Quickstart
This guide gets you from a local browser game to a playable Vifu cloud game.
1. Sign Up And Log In
Create a Vifu account at vifu.ai.
Install the CLI, then sign in from your terminal:
curl -fsSL https://vifu.dev/cli | bash
vifu loginUse the same email and password you used on vifu.ai. The CLI stores a local login token for deploys.
2. Create Or Choose A Project
Create a starter project:
npm create @vifu/vifu my-game -- --template vanilla --no-interactive
cd my-gameOr use an existing browser game:
cd path/to/your-game
vifu setup
vifu deploysetup detects the project and asks you to confirm the game name and detected build settings. Override only when detection is wrong. If you skip this step, deploy starts the same setup flow before it builds. In CI, use vifu deploy --yes to accept detected defaults without prompts.
3. Try The Examples
The examples repository is the fastest way to see what a good Vifu project looks like:
git clone --recurse-submodules https://github.com/vifu-labs/vifu-examples
cd vifu-examplesStart with:
01_getting_started/hello_web: the smallest deployable web game.02_external_ai_games/aiventure: an existing Angular + Phaser AI game adapted to Vifu AI and deploy policy.
Each example has its own README. From an example folder, run:
vifu deploy4. Add The SDK
npm
Use npm when the project has a bundler or build step:
npm install @vifu/sdk@alphaimport { createVifuSDK } from "@vifu/sdk";
const vifu = createVifuSDK();
await vifu.ready();CDN
Load the browser build from jsDelivr. Deployed games should use an exact SDK version:
<script src="https://cdn.jsdelivr.net/npm/@vifu/[email protected]/dist/browser/vifu-sdk.js"></script>
<script>
const vifu = window.vifu;
</script>5. Call Vifu AI
const result = await vifu.ai.generateText({
model: "basic",
messages: [
{ role: "user", content: "Give the player a short hint." }
]
});
showHint(result.content);Use basic for low-cost gameplay text and simple classification. Use quality for story turns or more complex reasoning. Games do not choose backend provider names or ship provider API keys.
Vifu AI is available through the SDK by default. Do not add a manifest entry for normal vifu.ai.generateText(...) calls.
6. Deploy
vifu deployvifu deploy runs setup if needed, validates the project, builds the game, checks the output, uploads only when the build changed, and prints a playable URL.
If deploy is blocked, read the file, line, URL, and fix in the error message. The most common causes are remote JavaScript imports or direct external AI/API calls left in the browser bundle.
For deployment flags and game management commands, see the Deployment section.
Local Behavior
Outside Vifu, managed AI, save state, and other Vifu platform capabilities may be unavailable. The game should still load and remain playable with a local fallback.