> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vibekit.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Below is an example on how to get started with VibeKit

Follow these steps to install and run Vibekit:

## Basic setup

**Step 1**: Install VibeKit Typescript SDK:

<CodeGroup>
  ```bash npm theme={"dark"}
  npm i @vibe-kit/sdk
  ```

  ```bash yarn theme={"dark"}
  yarn add @vibe-kit/sdk
  ```
</CodeGroup>

**Step 2**: Configure your VibeKit client:

```typescript theme={"dark"}
import { VibeKit } from "@vibe-kit/sdk";
import { createE2BProvider } from "@vibe-kit/e2b";

const e2bProvider = createE2BProvider({
  apiKey: process.env.E2B_API_KEY!,
  templateId: "vibekit-claude",
});

const vibeKit = new VibeKit()
  .withAgent({
    type: "claude",
    provider: "anthropic",
    apiKey: process.env.ANTHROPIC_API_KEY!,
    model: "claude-sonnet-4-20250514",
  })
  .withSandbox(e2bProvider);

```

**Step 3**: Add event listeners and execute commands:

```typescript theme={"dark"}
// Add event listeners for command output
vibeKit.on("stdout", (output) => {
  console.log("Output:", output);
});

vibeKit.on("stderr", (error) => {
  console.error("Error:", error);
});

// Execute a command (recommended approach)
const claudeCommand = `echo "Create a simple web app that displays a list of users" | claude -p --output-format stream-json --verbose --allowedTools "Edit,Write,MultiEdit,Read,Bash" --model claude-sonnet-4-20250514`;
const result = await vibeKit.executeCommand(claudeCommand);

// Get host URL (optional)
const host = await vibeKit.getHost(3000);

// Clean up when done
await vibeKit.kill();

console.log("Result:", result);
console.log("Host:", host);
```

<Info>
  **💡 Tip**: You can also use the deprecated `generateCode` method, but we recommend migrating to `executeCommand` for better control and flexibility. See the [migration guide](/api-reference/generate-code#migration-to-executecommand) for details.
</Info>
