Follow these steps to install and run Vibekit:

Basic setup

Step 1: Install VibeKit Typescript SDK:

npm i @vibe-kit/sdk

Step 2: Configure your VibeKit client:

import { VibeKit, VibeConfig } from "@vibe-kit/sdk";

const config: VibeConfig = {
  agent: {
    type: "codex",
    model: {
      apiKey:
        "sk-proj-****",
    },
  },
  environment: {
    e2b: {
      apiKey: "e2b_****",
    },
  },
  github: {
    token: "ghp_****",
    repository: "superagent-ai/vibekit",
  },
};

const vibeKit = new VibeKit(config);

Step 3: Trigger the agent in code mode:

const result = await vibeKit.generateCode({
  prompt: "Create a simple web app that displays a list of users",
  mode: "code",
  history: [{role: "user", content: "Use Next.js and ShadCN"}],
  callbacks: {
    // Streaming callbacks
    onUpdate: (update) => {
      console.log(update);
    },
    onError: (error) => {
      console.error("Error:", error);
    },
  },
})

console.log(result);