OpenHands Agent-Computer Interface (ACI)

0.3.3 · deprecated · verified Sat Apr 11

OpenHands-ACI (Agent-Computer Interface) provides essential tools and interfaces for AI agents to interact with computer systems for software development tasks. This includes capabilities for sophisticated code editing, file management, code linting, and executing shell commands, acting as a foundational layer for AI software engineer agents like OpenHands. The project is currently archived as its functionalities have been migrated to the OpenHands Agent SDK.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates a basic utility from `openhands-aci`, specifically executing a shell command, which represents a core function of an Agent-Computer Interface. This is for illustrative purposes as the library is deprecated. For developing with OpenHands, it is recommended to use the OpenHands Agent SDK or the `openhands` CLI directly.

import os
import asyncio
from openhands_aci.utils.shell import execute_shell_command

async def main():
    print("Demonstrating a basic utility from openhands-aci (shell command execution).")
    print("Note: The openhands-aci library is deprecated. For modern usage, refer to the OpenHands Agent SDK.")

    # Example: Execute a simple shell command
    command = "echo Hello from OpenHands ACI"
    print(f"Executing: '{command}'")
    result = await execute_shell_command(command, os.environ.get('AUTH_TOKEN', ''))
    print(f"Stdout: {result.stdout.strip()}")
    print(f"Stderr: {result.stderr.strip()}")
    print(f"Return Code: {result.return_code}")

    # Example: List files in the current directory
    command_ls = "ls -la"
    print(f"\nExecuting: '{command_ls}'")
    result_ls = await execute_shell_command(command_ls, os.environ.get('AUTH_TOKEN', ''))
    print(f"Stdout:\n{result_ls.stdout.strip()}")

if __name__ == "__main__":
    asyncio.run(main())

view raw JSON →