the universal sandbox runtime for agents and humans.
pocketenv.io
sandbox
openclaw
agent
claude-code
vercel-sandbox
deno-sandbox
cloudflare-sandbox
atproto
sprites
daytona
1#!/bin/bash
2
3readonly MAGENTA="$(tput setaf 5 2>/dev/null || echo '')"
4readonly GREEN="$(tput setaf 2 2>/dev/null || echo '')"
5readonly CYAN="$(tput setaf 6 2>/dev/null || echo '')"
6readonly NO_COLOR="$(tput sgr0 2>/dev/null || echo '')"
7
8set -e
9
10# Define the release information
11RELEASE_URL="https://api.github.com/repos/pocketenv-io/pocketenv/releases/latest"
12
13# Determine the operating system
14OS=$(uname -s)
15if [ "$OS" = "Darwin" ]; then
16 # Determine the CPU architecture
17 ARCH=$(uname -m)
18 if [ "$ARCH" = "arm64" ]; then
19 ASSET_NAME="_aarch64-apple-darwin.tar.gz"
20 else
21 ASSET_NAME="_x86_64-apple-darwin.tar.gz"
22 fi
23elif [ "$OS" = "Linux" ]; then
24 # Determine the CPU architecture
25 ARCH=$(uname -m)
26 if [ "$ARCH" = "aarch64" ]; then
27 ASSET_NAME="_aarch64-unknown-linux-gnu.tar.gz"
28 elif [ "$ARCH" = "x86_64" ]; then
29 ASSET_NAME="_x86_64-unknown-linux-gnu.tar.gz"
30 else
31 echo "Unsupported architecture: $ARCH"
32 exit 1
33 fi
34else
35 echo "Unsupported operating system: $OS"
36 exit 1
37fi
38
39# Retrieve the download URL for the desired asset
40DOWNLOAD_URL=$(curl -sSL $RELEASE_URL | grep -o "browser_download_url.*$ASSET_NAME\"" | cut -d ' ' -f 2)
41
42ASSET_NAME=$(basename $DOWNLOAD_URL)
43
44# Define the installation directory
45INSTALL_DIR="/usr/local/bin"
46
47DOWNLOAD_URL=`echo $DOWNLOAD_URL | tr -d '\"'`
48
49# Download the asset
50curl -SL $DOWNLOAD_URL -o /tmp/$ASSET_NAME
51
52# Extract the asset
53tar -xzf /tmp/$ASSET_NAME -C /tmp
54
55# Set the correct permissions for the binary
56chmod +x /tmp/pocketenv
57
58# Check if the 'local' argument was passed
59LOCAL=0
60if [ $# -eq 1 ]; then
61 if [ $1 = "--local" ]; then
62 LOCAL=1
63 fi
64fi
65
66# Move the extracted binary to the installation directory
67# use sudo if OS is Linux
68if [ "$OS" = "Linux" ]; then
69 # Install locally if LOCAL is set to 1
70 LOCAL_DIR="/home/$USER/.local/bin"
71 if [ "$LOCAL" -eq 1 ]; then
72 mv /tmp/pocketenv $LOCAL_DIR
73 else
74 if command -v sudo >/dev/null 2>&1; then
75 sudo mv /tmp/pocketenv $INSTALL_DIR
76 else
77 mv /tmp/pocketenv $INSTALL_DIR
78 fi
79 fi
80else
81 { mv /tmp/pocketenv $INSTALL_DIR 2>/dev/null; } || sudo mv /tmp/pocketenv $INSTALL_DIR
82fi
83
84# Clean up temporary files
85rm /tmp/$ASSET_NAME
86
87cat << EOF
88${CYAN}
89 ____ __ __
90 / __ \\____ _____/ /_____ / /____ ____ _ __
91 / /_/ / __ \\/ ___/ //_/ _ \\/ __/ _ \\/ __ \\ | / /
92 / ____/ /_/ / /__/ ,< / __/ /_/ __/ / / / |/ /
93 /_/ \\____/\\___/_/|_|\\___/\\__/\\___/_/ /_/|___/
94
95${NO_COLOR}
96Open, interoperable sandbox platform for agents and humans 📦 ✨
97
98${GREEN}https://github.com/pocketenv-io/pocketenv${NO_COLOR}
99
100Please file an issue if you encounter any problems!
101
102===============================================================================
103
104Installation completed! 🎉
105
106To get started, run:
107
108${MAGENTA}pocketenv create --ssh${NO_COLOR}
109
110EOF