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. Browse Open Source AI Native Games
The collection keeps original projects visible alongside their Vifu integrations:
git clone --recurse-submodules https://github.com/vifudotdev/awesome-open-source-ai-native-games
cd awesome-open-source-ai-native-gamesStart with:
starters/hello-web: the smallest deployable web game.games/aiventure: AIventure, integrated with Vifu publishing and a Hub platform interface for AI-driven play and host capabilities.
From a game or starter folder, run:
vifu deploy4. Add The Vifu Hub SDK
npm
Use npm when the project has a bundler or build step:
npm install @vifu/hub@alphaimport * as hub from "@vifu/hub";
await hub.ready();5. Call Vifu AI
const result = await hub.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 Vifu Hub SDK by default. Do not add a manifest entry for normal hub.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.