Define and manage long-running processes inside your sandbox.
Services are named, persistent processes running inside a sandbox — think web servers, background workers, databases, or any daemon you want to manage independently.
Create a service
pocketenv service create my-sandbox api "npm start" \ --description "Node.js API server" \ --ports 3000 8080
Arguments:
<sandbox> — target sandbox name or ID
<name> — service name
<command...> — command to run
Options:
--description, -d — human-readable description
--ports, -p — ports the service listens on (space-separated)
SDK
const service = await sandbox.service.add("api", { command: "npm start", description: "Node.js API server", ports: [3000, 8080],});console.log(service.id);
List services
pocketenv service list my-sandboxpocketenv service ls my-sandbox # alias
pocketenv service start <service-id> # Start a stopped servicepocketenv service stop <service-id> # Stop a running servicepocketenv service restart <service-id> # Restartpocketenv service delete <service-id> # Remove permanently
# Create sandbox and a web servicepocketenv create web-app --base openclawpocketenv env put web-app PORT 3000pocketenv service create web-app server "node app.js" --ports 3000# Start everythingpocketenv start web-apppocketenv service start <service-id>pocketenv expose web-app 3000 "App"