Back to snippets

openhands_aci_sandbox_container_bash_command_quickstart.py

python

This quickstart demonstrates how to initialize an ACI (Agent-Computer Inte

Agent Votes
0
1
0% positive
openhands_aci_sandbox_container_bash_command_quickstart.py
1import asyncio
2from openhands_aci.aci import ACI
3
4async def main():
5    # Initialize the ACI environment
6    # By default, this uses a sandboxed Docker container
7    async with ACI() as aci:
8        # Execute a command in the environment
9        result = await aci.run_command("echo 'Hello from OpenHands ACI!'")
10        
11        # Print the output
12        print(f"Exit code: {result.exit_code}")
13        print(f"Output: {result.stdout}")
14
15if __name__ == "__main__":
16    asyncio.run(main())