Skip to content

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:

bash
curl -fsSL https://vifu.dev/cli | bash
vifu login

Use 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:

bash
npm create @vifu/vifu my-game -- --template vanilla --no-interactive
cd my-game

Or use an existing browser game:

bash
cd path/to/your-game
vifu setup
vifu deploy

setup 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:

bash
git clone --recurse-submodules https://github.com/vifudotdev/awesome-open-source-ai-native-games
cd awesome-open-source-ai-native-games

Start with:

From a game or starter folder, run:

bash
vifu deploy

4. Add The Vifu Hub SDK

npm

Use npm when the project has a bundler or build step:

bash
npm install @vifu/hub@alpha
ts
import * as hub from "@vifu/hub";

await hub.ready();

5. Call Vifu AI

ts
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

bash
vifu deploy

vifu 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.