the universal sandbox runtime for agents and humans. pocketenv.io
sandbox openclaw agent claude-code vercel-sandbox deno-sandbox cloudflare-sandbox atproto sprites daytona
7
fork

Configure Feed

Select the types of activity you want to include in your feed.

Auto-run banner command on Cloudflare terminal

Add an initialCommand prop and paste it once when the terminal
connects (used to run 'banner.sh || true'). Also remove leftover
'sleep 2' additions from sandbox Dockerfiles.

+21 -4
-1
apps/cf-sandbox/deploy/docker/Dockerfile
··· 28 28 COPY banner.sh /usr/bin 29 29 30 30 RUN chmod a+x /usr/bin/banner.sh && \ 31 - echo 'sleep 2' >> ~/.bashrc && \ 32 31 echo banner.sh >> ~/.bashrc && \ 33 32 echo 'source /root/.bashrc' >> ~/.profile 34 33
-1
apps/cf-sandbox/deploy/zeroclaw/Dockerfile
··· 80 80 COPY banner.sh /root/.local/bin 81 81 82 82 RUN chmod a+x /root/.local/bin/banner.sh && \ 83 - echo 'sleep 2' >> ~/.bashrc && \ 84 83 echo banner.sh >> ~/.bashrc 85 84 86 85 WORKDIR /workspace
+20 -1
apps/web/src/components/terminal/CloudflareTerminal.tsx
··· 69 69 sandboxId: string; 70 70 worker: string; 71 71 onClose: () => void; 72 + initialCommand?: string; 72 73 } 73 74 74 75 function TerminalContent({ ··· 76 77 sandboxId, 77 78 worker, 78 79 onClose, 80 + initialCommand, 79 81 }: TerminalContentProps) { 80 82 const fitAddonRef = useRef<FitAddon | null>(null); 81 83 const sandboxAddonRef = useRef<SandboxAddon | null>(null); 84 + const initialCommandFiredRef = useRef(false); 82 85 const { data: terminalToken, isLoading } = useTerminalTokenQuery(); 83 86 const [sessions, setSessions] = useAtom(sessionsAtom); 84 87 const location = useLocation(); ··· 140 143 instance.write( 141 144 `\r\n\x1b[38;5;203mTerminal error: ${error.message || "unknown"}\x1b[0m\r\n`, 142 145 ); 146 + } 147 + if ( 148 + state === "connected" && 149 + initialCommand && 150 + !initialCommandFiredRef.current 151 + ) { 152 + initialCommandFiredRef.current = true; 153 + setTimeout(() => instance.paste(initialCommand + "\n"), 300); 143 154 } 144 155 if (state === "disconnected") { 145 156 onClose(); ··· 168 179 169 180 instance.write(`\x1b[35mConnecting to terminal session...\x1b[0m\r\n`); 170 181 sandboxAddon.connect({ sandboxId, sessionId: sessions[sandboxId] }); 182 + instance.paste("your-command-here\n"); 171 183 instance.focus(); 172 184 173 185 return () => { ··· 200 212 sandboxId: string; 201 213 worker: string; 202 214 onClose: () => void; 215 + initialCommand?: string; 203 216 } 204 217 205 - function CloudflareTerminal({ sandboxId, worker, onClose }: TerminalProps) { 218 + function CloudflareTerminal({ 219 + sandboxId, 220 + worker, 221 + onClose, 222 + initialCommand, 223 + }: TerminalProps) { 206 224 const [isDarkMode, setIsDarkMode] = useState( 207 225 document.documentElement.classList.contains("dark"), 208 226 ); ··· 231 249 sandboxId={sandboxId} 232 250 worker={worker} 233 251 onClose={onClose} 252 + initialCommand={initialCommand} 234 253 /> 235 254 ); 236 255 }
+1 -1
apps/web/src/components/terminal/index.tsx
··· 13 13 return ( 14 14 <> 15 15 {isCloudflare ? ( 16 - <CloudflareTerminal {...props} /> 16 + <CloudflareTerminal {...props} initialCommand="banner.sh || true" /> 17 17 ) : ( 18 18 <SSHTerminal {...props} /> 19 19 )}