{"id":10007,"library":"openclaw","title":"OpenClaw","description":"OpenClaw is an open-source Python library designed for agent orchestration, serving as a plugin for the CMDOP platform. It provides tools and a framework for building and deploying intelligent agents that can interact with the CMDOP ecosystem. Currently at version 2026.3.20, it follows a YYYY.MM.DD versioning scheme, indicating active and continuous development.","status":"active","version":"2026.3.20","language":"en","source_language":"en","source_url":"https://github.com/commandoperator/cmdop-sdk","tags":["agent","orchestration","cmdop","plugin","ai","automation"],"install":[{"cmd":"pip install openclaw","lang":"bash","label":"Install OpenClaw"}],"dependencies":[{"reason":"OpenClaw is built on and strictly tied to the CMDOP SDK, requiring a matching version for proper functionality.","package":"cmdop-sdk","optional":false},{"reason":"Used for making HTTP requests to the CMDOP platform.","package":"requests","optional":false},{"reason":"Used for data validation and settings management within the library.","package":"pydantic","optional":false}],"imports":[{"symbol":"Agent","correct":"from openclaw.agent import Agent"},{"symbol":"OpenClawConfig","correct":"from openclaw.config import OpenClawConfig"},{"note":"While `register_tool` exists, the `@tool` decorator is the idiomatic way to define tools in OpenClaw.","wrong":"from openclaw.tools import register_tool","symbol":"tool","correct":"from openclaw.tools import tool"}],"quickstart":{"code":"import asyncio\nimport os\nfrom openclaw.agent import Agent\nfrom openclaw.config import OpenClawConfig\nfrom openclaw.tools import tool\n\n# Define a tool for the agent to use\n@tool\ndef greet(name: str) -> str:\n    \"\"\"Greets the given name.\"\"\"\n    return f\"Hello, {name}!\"\n\nasync def main():\n    # Configure OpenClaw agent\n    # Obtain your API key from the CMDOP platform\n    config = OpenClawConfig(\n        api_key=os.environ.get(\"OPENCLAW_API_KEY\", \"sk-DUMMY_API_KEY\"),\n        agent_id=\"my-first-openclaw-agent\"\n    )\n\n    # Initialize the agent with the configuration\n    agent = Agent(config)\n\n    print(f\"OpenClaw Agent '{config.agent_id}' running...\")\n    # The agent.run() method is asynchronous and connects to the CMDOP platform\n    await agent.run()\n    print(\"Agent stopped.\")\n\nif __name__ == \"__main__\":\n    try:\n        asyncio.run(main())\n    except KeyboardInterrupt:\n        print(\"Agent interrupted and stopping.\")\n    except Exception as e:\n        print(f\"An error occurred: {e}\")","lang":"python","description":"This quickstart demonstrates how to initialize an OpenClaw agent, define a simple tool using the `@tool` decorator, and run the agent asynchronously. It uses an environment variable for the API key for security. The agent will connect to the CMDOP platform and make its defined tools available."},"warnings":[{"fix":"Always install `openclaw` directly via `pip install openclaw`. This ensures the correct `cmdop-sdk` version is pulled. Avoid manually installing or upgrading `cmdop-sdk` independently of `openclaw` unless explicitly instructed.","message":"OpenClaw has a strict, exact version dependency on `cmdop-sdk`. Mismatching versions (e.g., installing `cmdop-sdk` manually with a different version) will lead to runtime errors, unexpected behavior, or even `ImportError`.","severity":"breaking","affected_versions":"All versions where `cmdop-sdk` is an exact dependency."},{"fix":"Wrap your agent execution logic in an `async def` function and call it using `asyncio.run()`. Ensure all calls to `agent.run()` and other async methods are preceded by `await`.","message":"Key agent methods, particularly `agent.run()`, are asynchronous coroutines. Failing to `await` these methods or run them within an `asyncio` event loop will result in `TypeError: 'coroutine' object is not awaited` or the agent simply not starting.","severity":"gotcha","affected_versions":"All versions where agent methods are async."},{"fix":"Ensure the `OPENCLAW_API_KEY` environment variable is correctly set with a valid key from your CMDOP account. Verify that the `agent_id` is unique and adheres to CMDOP's naming conventions. For local development, `base_url` might also need to be configured.","message":"Incorrect or missing `api_key` or `agent_id` in `OpenClawConfig` will prevent the agent from authenticating and connecting to the CMDOP platform, leading to connection failures or API errors.","severity":"gotcha","affected_versions":"All versions."}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Ensure `agent.run()` is awaited inside an `async def` function, and that function is executed with `asyncio.run()`.","cause":"You are calling an asynchronous OpenClaw method (like `agent.run()`) without `await` or outside an `async` context.","error":"TypeError: object NoneType can't be used in 'await' expression"},{"fix":"Double-check the value of your `OPENCLAW_API_KEY` environment variable or the `api_key` parameter in `OpenClawConfig`. Obtain a valid API key from your CMDOP account settings.","cause":"The `api_key` provided in your `OpenClawConfig` is incorrect, expired, or missing, preventing authentication with the CMDOP platform.","error":"cmdop_sdk.exceptions.APIError: Authentication Failed: Invalid API Key"},{"fix":"Activate your virtual environment (if using one) and run `pip install openclaw`. If you have multiple Python installations, ensure you're using the correct `pip` associated with your project's Python interpreter.","cause":"The `openclaw` package is not installed in your current Python environment or the environment is not activated.","error":"ModuleNotFoundError: No module named 'openclaw'"}]}