1. Home
  2. Docs
  3. Server
  4. Accessing WP CLI

Accessing WP CLI

Using WP CLI can be very helpful for a variety of management tasks.

Sites in FlyWP reside in the home directory. You can verify this by using the pwd command; You will be in the /home/fly directory. By using ls command, you’ll find all the available sites on your server.

If my domain is domain.com, then the change directory will look like the following command (change it as per your website’s name)

cd domain.com

Now you can run WP CLI like this:

docker compose exec php wp

For example, showing all post list:

docker compose exec php wp post list

Alternatively, if the docker compose command seems too long for your, you can go inside the container and run wp commands as usual

docker compose exec php sh

…and now you’re inside the container. You will be able to run wp commands like you’re used to.

wp cli version

Example

# Display the version currently installed.
$ wp cli version
WP-CLI 2.10.0