{"id":51063780,"url":"https://github.com/pocketenv-io/pocketenv-rust","last_synced_at":"2026-06-23T04:32:33.615Z","repository":{"id":348595224,"uuid":"1198863425","full_name":"pocketenv-io/pocketenv-rust","owner":"pocketenv-io","description":"Rust SDK for Pocketenv","archived":false,"fork":false,"pushed_at":"2026-04-01T21:03:13.000Z","size":30,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-10T10:47:47.166Z","etag":null,"topics":["microvm","rust","sandbox"],"latest_commit_sha":null,"homepage":"https://pocketenv.io","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pocketenv-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-01T20:43:05.000Z","updated_at":"2026-04-02T03:59:53.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/pocketenv-io/pocketenv-rust","commit_stats":null,"previous_names":["pocketenv-io/pocketenv-rust"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pocketenv-io/pocketenv-rust","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocketenv-io%2Fpocketenv-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocketenv-io%2Fpocketenv-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocketenv-io%2Fpocketenv-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocketenv-io%2Fpocketenv-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pocketenv-io","download_url":"https://codeload.github.com/pocketenv-io/pocketenv-rust/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocketenv-io%2Fpocketenv-rust/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34675970,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-23T02:00:07.161Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["microvm","rust","sandbox"],"created_at":"2026-06-23T04:32:32.913Z","updated_at":"2026-06-23T04:32:33.610Z","avatar_url":"https://github.com/pocketenv-io.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pocketenv\n\nA Rust SDK for the [Pocketenv](https://pocketenv.io) API — manage cloud sandboxes, environment variables, secrets, files, volumes, and background services programmatically.\n\n## Installation\n\nAdd to your `Cargo.toml`:\n\n```toml\n[dependencies]\npocketenv = \"0.1\"\ntokio = { version = \"1\", features = [\"full\"] }\n```\n\n## Quick Start\n\n```rust\nuse pocketenv::Sandbox;\n\n#[tokio::main]\nasync fn main() -\u003e anyhow::Result\u003c()\u003e {\n    // Create a sandbox with the builder — defaults to https://api.pocketenv.io\n    let sandbox = Sandbox::builder(\"my-sandbox\")\n        .provider(\"cloudflare\")\n        .vcpus(2)\n        .memory(4)  // GB\n        .disk(10)   // GB\n        .token(std::env::var(\"POCKETENV_TOKEN\")?)\n        .create()\n        .await?;\n\n    println!(\"Created sandbox: {}\", sandbox.id);\n\n    // Start it and run a command\n    sandbox.start().await?;\n    let result = sandbox.exec(\"echo hello from pocketenv\").await?;\n    println!(\"stdout: {}\", result.stdout);\n    println!(\"exit code: {}\", result.exit_code);\n\n    // Expose a port\n    let url = sandbox.expose(3000, Some(\"Web app\")).await?;\n    println!(\"Preview URL: {}\", url.unwrap_or_default());\n\n    // Stop and clean up\n    sandbox.stop().await?;\n    sandbox.delete().await?;\n\n    Ok(())\n}\n```\n\n## Usage\n\n### Client Initialization\n\n```rust\n// Default base URL (https://api.pocketenv.io)\nlet client = PocketenvClient::with_token(token);\n\n// Custom base URL\nlet client = PocketenvClient::new(\"https://api.pocketenv.io\", token);\n```\n\n### Sandboxes\n\n```rust\nlet sandbox = Sandbox::builder(\"dev\")\n    .provider(\"cloudflare\")\n    .vcpus(2)\n    .memory(4)\n    .disk(10)\n    .token(token)\n    .create()\n    .await?;\n\n// Get by ID, name, or AT URI\nlet sandbox = client.sandboxes.get(\"sb-abc123\").await?;\n\n// List (paginated)\nlet sandboxes = client.sandboxes.list(0, 20).await?;\n\n// List by actor DID\nlet sandboxes = client.sandboxes.list_by_actor(\"did:plc:...\", 0, 20).await?;\n\n// Claim an anonymous sandbox\nlet sandbox = client.sandboxes.claim(\"sb-abc123\").await?;\n\n// Delete\nclient.sandboxes.delete(\"sb-abc123\").await?;\n\n// Lifecycle operations on a sandbox handle\nsandbox.start().await?;\nsandbox.stop().await?;\nsandbox.delete().await?;\n\n// Execute a shell command\nlet result = sandbox.exec(\"ls -la /workspace\").await?;\n// result.stdout, result.stderr, result.exit_code\n\n// Port exposure\nlet port = sandbox.expose(8080, Some(\"API server\".into())).await?;\n// port.preview_url contains the public URL\nsandbox.unexpose(8080).await?;\nlet ports = sandbox.get_exposed_ports().await?;\n\n// Expose VS Code server\nlet port = sandbox.expose_vscode().await?;\n\n// SSH keys\nsandbox.put_ssh_keys(private_key, public_key, redacted).await?;\nlet keys = sandbox.get_ssh_keys().await?;\n```\n\n### Environment Variables\n\n```rust\n// Add\nlet var = client.variables.add(\"sb-abc123\", \"DATABASE_URL\", \"postgres://...\").await?;\n\n// List\nlet vars = client.variables.list(\"sb-abc123\", 0, 50).await?;\n\n// Get / Update / Delete\nlet var = client.variables.get(\u0026var.id).await?;\nclient.variables.update(\u0026var.id, \"sb-abc123\", \"DATABASE_URL\", \"postgres://new\").await?;\nclient.variables.delete(\u0026var.id).await?;\n```\n\n### Secrets\n\n```rust\n// Add (value should be pre-encrypted)\nlet secret = client.secrets.add(\"sb-abc123\", \"API_KEY\", encrypted_value).await?;\n\n// List (names only — values are never returned)\nlet secrets = client.secrets.list(\"sb-abc123\", 0, 50).await?;\n\n// Get / Update / Delete\nlet secret = client.secrets.get(\u0026secret.id).await?;\nclient.secrets.update(\u0026secret.id, \"sb-abc123\", \"API_KEY\", new_encrypted_value).await?;\nclient.secrets.delete(\u0026secret.id).await?;\n```\n\n### Files\n\n```rust\n// Inject a file into a sandbox\nlet file = client.files.add(\"sb-abc123\", \"/workspace/.env\", content).await?;\n\n// List / Get / Update / Delete\nlet files = client.files.list(\"sb-abc123\", 0, 50).await?;\nlet file = client.files.get(\u0026file.id).await?;\nclient.files.update(\u0026file.id, \"/workspace/.env\", new_content).await?;\nclient.files.delete(\u0026file.id).await?;\n```\n\n### Volumes\n\n```rust\n// Mount a persistent volume\nlet volume = client.volumes.add(\"sb-abc123\", \"data\", \"/workspace/data\").await?;\n\n// List / Get / Update / Delete\nlet volumes = client.volumes.list(\"sb-abc123\", 0, 50).await?;\nlet volume = client.volumes.get(\u0026volume.id).await?;\nclient.volumes.update(\u0026volume.id, \"sb-abc123\", \"data\", \"/data\").await?;\nclient.volumes.delete(\u0026volume.id).await?;\n```\n\n### Services\n\n```rust\nuse pocketenv::service::ServiceOptions;\n\n// Create a background service\nlet service = client.services.add(\n    \"sb-abc123\",\n    \"web\",\n    \"node server.js\",\n    ServiceOptions {\n        ports: Some(vec![3000]),\n        description: Some(\"Node.js web server\".into()),\n    },\n).await?;\n\n// List\nlet services = client.services.list(\"sb-abc123\").await?;\n\n// Lifecycle\nclient.services.start(\u0026service.id).await?;\nclient.services.stop(\u0026service.id).await?;\nclient.services.restart(\u0026service.id).await?;\n\n// Update / Delete\nclient.services.update(\u0026service.id, \"web\", \"node server.js\", opts).await?;\nclient.services.delete(\u0026service.id).await?;\n```\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpocketenv-io%2Fpocketenv-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpocketenv-io%2Fpocketenv-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpocketenv-io%2Fpocketenv-rust/lists"}