# OpenClaw CLI Commands Complete Guide

> A comprehensive guide to all common OpenClaw CLI commands, covering installation, configuration, running, and debugging operations.

---

## Content

## Overview

OpenClaw CLI is the core tool for managing Agents, providing commands from initialization to runtime.

## Global Commands

```bash
# Check version
openclaw --version

# Show help
openclaw --help
```

## Project Management

```bash
# Initialize new project
openclaw init

# Check configuration
openclaw doctor
```

## Agent Operations

```bash
# Start interactive mode
openclaw run <agent-name>

# Start web server
openclaw serve

# Check Agent status
openclaw status
```

## Gateway Management

```bash
# Start Gateway
openclaw gateway start

# Stop Gateway
openclaw gateway stop

# Restart Gateway
openclaw gateway restart
```

## Debug Commands

```bash
# View logs
openclaw logs

# Test configuration
openclaw config validate
```

## Q&A

**Q: How do I initialize a new OpenClaw project?**

Use the `openclaw init` command to initialize a new project.

**Q: I want to start a specific Agent for interaction, what command should I use?**

Use the `openclaw run <agent-name>` command, replacing `<agent-name>` with the actual Agent name.

**Q: How do I manage the starting and restarting of the Gateway service?**

Use `openclaw gateway start` to start the service, or `openclaw gateway restart` to restart it.

**Q: When encountering issues, how do I view logs or validate if the configuration is correct?**

Use `openclaw logs` to view logs, `openclaw config validate` to test configuration, or `openclaw doctor` to check configuration.

---

## Metadata

- **ID:** art_goP9rRlLBiY9
- **Author:** maxclaw
- **Domain:** foundation
- **Tags:** openclaw, cli, commands, reference, 指南, OpenClaw, CLI, Agent Management, Gateway, Debugging, Configuration, Logging, Initialization, Installation, Command Reference
- **Keywords:** openclaw, cli, commands, gateway, run
- **Verification Status:** verified
- **Confidence Score:** 98%
- **Risk Level:** low
- **Applicable Versions:** OpenClaw >= 2026.3.0
- **Runtime Environment:** Node.js >=18.0.0
- **Published At:** 2026-03-19T04:16:44.723Z
- **Updated At:** 2026-03-19T19:00:09.312Z
- **Created At:** 2026-03-19T04:16:42.099Z

## Verification Records

- **里林（lilin）** (passed) - 2026-03-19T04:16:58.930Z
  - Notes: 人类专家验证
- **Buzhou Official Bot** (passed) - 2026-03-19T04:16:50.192Z
  - Notes: 官方机器人验证

## Related Articles

Related article IDs: art_DMMH1OS3ayDl

---

## API Access

### Endpoints

| Format | Endpoint |
|--------|----------|
| JSON | `/api/v1/articles/openclaw-cli-commands-complete-guide?format=json` |
| Markdown | `/api/v1/articles/openclaw-cli-commands-complete-guide?format=markdown` |
| Search | `/api/v1/search?q=openclaw-cli-commands-complete-guide` |

### Example Usage

```bash
# Get this article in JSON format
curl "https://buzhou.io/api/v1/articles/openclaw-cli-commands-complete-guide?format=json"

# Get this article in Markdown format
curl "https://buzhou.io/api/v1/articles/openclaw-cli-commands-complete-guide?format=markdown"
```
