Skip to content

The AgentBay SDK provides a comprehensive suite of tools for efficient interaction with AgentBay cloud environments, enabling you to create and manage cloud sessions, execute commands, operate files, and interact with user interfaces.

License

Notifications You must be signed in to change notification settings

aliyun/wuying-agentbay-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AgentBay SDK

The AgentBay SDK provides a comprehensive suite of tools for efficient interaction with AgentBay cloud environments, enabling you to create and manage cloud sessions, execute commands, operate files, and interact with user interfaces.

πŸ“¦ 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

πŸš€ 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

πŸš€ Quick Start

Python

from agentbay import AgentBay

# Create session and execute command
agent_bay = AgentBay()
session_result = agent_bay.create()
session = session_result.session
result = session.command.execute_command("echo 'Hello AgentBay'")
print(result.output)  # Hello AgentBay

# Clean up
agent_bay.delete(session)

TypeScript

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

// Create session and execute command
const agentBay = new AgentBay();
const sessionResult = await agentBay.create();
const session = sessionResult.session;
const result = await session.command.executeCommand("echo 'Hello AgentBay'");
console.log(result.output);  // Hello AgentBay

// Clean up
await agentBay.delete(session);

Golang

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

// Create session and execute command
client, err := agentbay.NewAgentBay("", nil)
if err != nil {
    fmt.Printf("Failed to initialize AgentBay client: %v\n", err)
    return
}

sessionResult, err := client.Create(nil)
if err != nil {
    fmt.Printf("Failed to create session: %v\n", err)
    return
}

session := sessionResult.Session
result, err := session.Command.ExecuteCommand("echo 'Hello AgentBay'")
if err != nil {
    fmt.Printf("Failed to execute command: %v\n", err)
    return
}
fmt.Println(result.Output)  // Hello AgentBay

// Clean up
_, err = client.Delete(session, false)
if err != nil {
    fmt.Printf("Failed to delete session: %v\n", err)
    return
}

πŸ“š Documentation

Complete Documentation - Full guides, tutorials, and API references

πŸ‘‹ Choose Your Learning Path

πŸ†• New Users - If you're new to AgentBay or cloud development:

πŸš€ Experienced Users - Already familiar with browser automation, computer use, mobile testing, or cloud development environments:

πŸ”§ Core Features

πŸŽ›οΈ Session Management

  • Session Creation & Lifecycle - Create, manage, and delete cloud environments
  • Environment Configuration - Configure SDK settings, regions, and endpoints
  • Session Monitoring - Monitor session status and health validation

πŸ› οΈ Common Modules

  • Command Execution - Execute Shell commands in cloud environments
  • File Operations - Upload, download, and manage cloud files
  • Data Persistence - Save and retrieve data across sessions
  • Context Management - Synchronize data and maintain state

🎯 Scenario-Based Features

  • Computer Use - General automation and desktop operations
  • Browser Use - Web automation, scraping, and browser control
  • CodeSpace - Code execution and development environment
  • Mobile Use - Mobile device simulation and control

πŸ†˜ Get Help

πŸ“„ License

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

About

The AgentBay SDK provides a comprehensive suite of tools for efficient interaction with AgentBay cloud environments, enabling you to create and manage cloud sessions, execute commands, operate files, and interact with user interfaces.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 21