# APISIX CLI

The APISIX CLI is the `apisix` runtime command bundled with Apache APISIX. Use it to initialize, start, stop, reload, and test an APISIX instance.

```
apisix [action] <argument>
```

## Commands[​](#commands "Direct link to Commands")

### `apisix help`[​](#apisix-help "Direct link to apisix-help")

Print the APISIX CLI help menu.

### `apisix init`[​](#apisix-init "Direct link to apisix-init")

Initialize the `nginx.conf` configuration.

### `apisix init_etcd`[​](#apisix-init_etcd "Direct link to apisix-init_etcd")

Initialize data in etcd.

### `apisix start`[​](#apisix-start "Direct link to apisix-start")

Initialize and start the APISIX instance.

The command returns after OpenResty starts in daemon mode. It does not keep a container or process supervisor in the foreground. If the access log writes to `/dev/stdout`, the worker processes keep that output stream after the command returns.

**Options:**

* `-h` or `--help`: print help menu.

* `-c` or `--config`: specify the path to the custom [configuration file](https://docs.api7.ai/apisix/reference/configuration-files.md) when starting APISIX. For example:

  ```
  apisix start -c /path/to/custom_config.yaml
  ```

  APISIX will fall back to the default configuration if `-c` is not set.

* `--verbose`: show `init_etcd` debug information.

For the supported container process model, see [Build Your Own Docker Images](https://docs.api7.ai/apisix/install/docker/build-custom-images.md#preserve-the-container-entry-point).

### `apisix stop`[​](#apisix-stop "Direct link to apisix-stop")

Stop the running APISIX instance immediately. APISIX will stop all worker processes without waiting for them to finish serving any outstanding requests.

### `apisix quit`[​](#apisix-quit "Direct link to apisix-quit")

Quit the running APISIX instance gracefully. APISIX will wait for all worker processes to finish serving any outstanding requests before stopping.

### `apisix restart`[​](#apisix-restart "Direct link to apisix-restart")

Restart the APISIX instance. This command checks the generated `nginx.conf` configuration first before stopping and restarting APISIX.

### `apisix reload`[​](#apisix-reload "Direct link to apisix-reload")

Reload the APISIX instance. Reinitialize `nginx.conf` and apply configuration changes without interrupting existing connections.

### `apisix test`[​](#apisix-test "Direct link to apisix-test")

Test the generated `nginx.conf` to validate the configuration.

### `apisix version`[​](#apisix-version "Direct link to apisix-version")

Print APISIX version.

The `apisix` command manages the APISIX process, not gateway resources such as routes and upstreams. For resource management, see [Management Options](https://docs.api7.ai/apisix/getting-started/management-options.md).
