Skip to main content
Sign In
General

Quickstart

Install AgentOS, boot a VM, and run your first coding agent.

Install

npm install @rivet-dev/agent-os-core
# Install an agent adapter + its underlying agent
npm install pi-acp @mariozechner/pi-coding-agent

Write Code

Create a file with your VM setup and agent session:

import { AgentOs } from "@rivet-dev/agent-os-core";

// Boot a VM
const vm = await AgentOs.create();

// Run commands
const result = await vm.exec("echo hello");
console.log(result.stdout); // "hello\n"

// Work with the filesystem
await vm.writeFile("/home/user/test.txt", "hello world");
const content = await vm.readFile("/home/user/test.txt");

// Spawn an ACP coding agent session
const session = await vm.createSession("pi", {
  env: { ANTHROPIC_API_KEY: process.env.ANTHROPIC_API_KEY },
});
const response = await session.prompt("Write a hello world script");
console.log(response);

// Clean up
session.close();
await vm.dispose();

Run It

npx tsx index.ts

Next Steps