Local Development with Craft Nitro
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.
Sometimes, okay a lot of the time, I forget which sites I have set up in Nitro and what the hostnames 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 running in Nitro.
First, we can use the context command:
➜ nitro context
The context
command outputs a slightly formatted version of the nitro.yaml
file in a hidden directory in the user directory. This file contains all of the settings for Nitro, including containers and sites.
In addition to the important information of which projects I have set up in Nitro, it also tells me some important things about Nitro itself:
Another way to get access to the containers running in Craft Nitro is to use the nitro ls
command.
➜ nitro ls
This will output a simple three-column list of the services, sites, proxies, and databases running on Nitro.
To get a filtered version of the list, like just the sites you have running, you can pass in the --sites
flag and Nitro will pre-filter the list to only include the sites containers.
➜ nitro ls --site
Local Development with Craft Nitro is made up of the following videos: