← 开源
agentbay-ai

wuying-agentbay-sdk

The Cloud Sandbox Built for AI Agents

InfrastructureOrchestrationPython
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
1.15k
Star
60
Fork
+-1
本周
26
贡献者
创建于 2025-05-26 · 更新于 2026-10-10 · 今日第 11415 名
主要开发者
README

The Cloud Sandbox Built for AI Agents

AgentBay provides on-demand cloud sandboxes for AI agents — isolated environments with browser, desktop, mobile, and code execution capabilities. Create a sandbox in seconds, let your agent do its work, and tear it down when done. No infrastructure to manage.

With SDKs for Python, TypeScript, Golang, and Java, AgentBay gives your agents a full cloud environment through a simple API: execute commands, browse the web, automate desktop apps, test mobile UIs, or run code — all in secure, disposable sandboxes.


🎯 What You Can Do

![Browser Use](./assets/Browser Use@2x.png)

🌐 Browser Use

Automate web operations including content scraping, testing, and workflows. Cross-browser compatible with natural language control and remote access.

Learn more →

![Computer Use](./assets/Computer Use@2x.png)

🖥️ Computer Use

Cloud desktop environment for enterprise application automation. Standardized interfaces enable legacy software automation with intelligent resource scheduling.

Learn more →

![Mobile Use](./assets/Mobile Use@2x.png)

📱 Mobile Use

Cloud-based mobile environment for intelligent app automation. Precise UI recognition and control with parallel task processing for testing scenarios.

Learn more →

![Code Space](./assets/Code Space@2x.png)

💻 Code Space

Professional cloud development environment supporting multi-language code generation, compilation, and debugging. Secure, intelligent automated programming experience.

Learn more →

✅ Prerequisites

Before using the SDK, you need to:

  1. Register an Alibaba Cloud account: https://aliyun.com
  2. Get APIKEY credentials: AgentBay Console
  3. Set environment variable:
    • For Linux/MacOS:
      export AGENTBAY_API_KEY=your_api_key_here
      
    • For Windows:
      setx AGENTBAY_API_KEY your_api_key_here
      

📦 Installation

Language Install Command Documentation
Python pip install wuying-agentbay-sdk Python Docs
TypeScript npm install wuying-agentbay-sdk TypeScript Docs
Golang go get github.com/aliyun/wuying-agentbay-sdk/golang/pkg/agentbay Golang Docs
Java See Maven snippet below Java Docs

Java Maven dependency


    com.aliyun
    agentbay-sdk
    0.20.0

🚀 Quick Start

Python

from agentbay import AgentBay, CreateSessionParams

agent_bay = AgentBay()

# Create a cloud sandbox (options: "code_latest", "browser_latest", "desktop_latest")
session = agent_bay.create(CreateSessionParams(image_id="code_latest")).session

# Execute code in the sandbox
result = session.code.run_code("print('Hello AgentBay')", "python")
if result.success:
    print(result.result)  # Hello AgentBay

agent_bay.delete(session)

TypeScript

import { AgentBay } from 'wuying-agentbay-sdk';

const agentBay = new AgentBay();

// Create a cloud sandbox
const session = (await agentBay.create({ imageId: "code_latest" })).session;

// Execute code in the sandbox
const result = await session.code.runCode("print('Hello AgentBay')", "python");
if (result.success) {
    console.log(result.result);  // Hello AgentBay
}

await agentBay.delete(session);

Golang

import "github.com/aliyun/wuying-agentbay-sdk/golang/pkg/agentbay"

client, _ := agentbay.NewAgentBay("", nil)

// Create a cloud sandbox
result, _ := client.Create(agentbay.NewCreateSessionParams().WithImageId("code_latest"))
session := result.Session

// Execute code in the sandbox
res, _ := session.Code.RunCode("print('Hello AgentBay')", "python")
fmt.Println(res.Output)  // Hello AgentBay

client.Delete(session, false)

Java

import com.aliyun.agentbay.*;

AgentBay agentBay = new AgentBay();

// Create a cloud sandbox
CreateSessionParams params = new CreateSessionParams().setImageId("code_latest");
Session session = agentBay.create(params).getSession();

// Execute code in the sandbox
CodeExecutionResult result = session.getCode().runCode("print('Hello AgentBay')", "python");
if (result.isSuccess()) {
    System.out.println(result.getResult());  // Hello AgentBay
}

agentBay.delete(session, false);

📚 Documentation

New to AgentBay? Start with the Quick Start Tutorial — you'll be up and running in 5 minutes.

Resource Description
Quick Start Tutorial Get started in 5 minutes
Core Concepts Understand sessions, environments, and sandboxes
Feature Guides In-depth guides for each capability
API Reference Complete API docs (Python · TypeScript · Golang · Java)
Cookbook Real-world examples and recipes

🔧 Core Features

🎛️ Session Management

  • Session Lifecycle — Create, manage, and delete cloud sandboxes on demand
  • Environment Configuration — Configure regions, endpoints, and sandbox images
  • Session Monitoring — Monitor status and health

🛠️ Built-in Modules

  • Command Execution — Run shell commands in cloud sandboxes
  • File Operations — Upload, download, and manage files
  • Context & Data Persistence — Save and retrieve data across sessions
  • Git Operations — Clone, commit, and manage repositories remotely

🤖 AI-Assisted Development

If you're using AI coding assistants (Claude, Cursor, GitHub Copilot, etc.) to develop with AgentBay SDK, use these files as context:

  • llms.txt — Concise overview (~14k tokens, ~55 KB)
  • llms-full.txt — Full SDK source, API docs, and examples (~211k tokens, ~827 KB)

🆘 Get Help

📞 Contact

Welcome to visit our product website and join our community!

📄 License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

排名相邻
同类项目