Local Development with Craft Nitro

How to Recall Which Nitro Sites Are Running

I like to be able to get a quick peak and reminds myself of what’s what and if I’ve even set up a project in Nitro yet.

Some­times, okay a lot of the time, I for­get which sites I have set up in Nitro and what the host­names are. I like to be able to get a quick peak and reminds myself of what’s what and if I’ve even set up a project in Nitro yet.

There are two easy ways to get insight into what we have run­ning in Nitro.

First, we can use the con­text command:

➜ nitro context

The context com­mand out­puts a slight­ly for­mat­ted ver­sion of the nitro.yaml file in a hid­den direc­to­ry in the user direc­to­ry. This file con­tains all of the set­tings for Nitro, includ­ing con­tain­ers and sites.

In addi­tion to the impor­tant infor­ma­tion of which projects I have set up in Nitro, it also tells me some impor­tant things about Nitro itself:

  • The Nitro ver­sion installed
  • The loca­tion of the Nitro con­fig­u­ra­tion (YAML) file.

Anoth­er way to get access to the con­tain­ers run­ning in Craft Nitro is to use the nitro ls command.

➜ nitro ls

This will out­put a sim­ple three-col­umn list of the ser­vices, sites, prox­ies, and data­bas­es run­ning on Nitro.

To get a fil­tered ver­sion of the list, like just the sites you have run­ning, you can pass in the --sites flag and Nitro will pre-fil­ter the list to only include the sites containers.

➜ nitro ls --site

Local Development with Craft Nitro is made up of the following videos: