As of Now 2.0, deployments consist of two crucial parts: Builds and Routes. While the former is responsible for compiling your source code and preparing it for production, the latter takes care of delegating incoming requests to the right path.
With the latest update of Now CLI, we are introducing an overhauled now inspect command. Among all the other properties of a deployment, this allows you to easily inspect the Builds and Routes of your deployments.

How to Use

The most important of all now inspect commands is probably the following:
now inspect <deployment-url>
When running the command above for a Now 2.0 deployment, you are presented with a list of properties describing your deployment.
With the latest update of Now CLI, this output was redesigned:
  • More spacing for better readability
  • Colored property keys
  • New design for "Builds" section matching the one at deployment creation
  • New "Routes" section
This is how the new output looks when executing the command mentioned above:

Running this command is the first step to take when debugging an error

For this example, the now.json configuration file looks as follows:
{
    "name": "monorepo",
    "version": 2,
    "builds": [
        { "src": "www/package.json", "use": "@now/next" },
        { "src": "api/go/*.go", "use": "@now/go" },
        { "src": "api/python/*.py", "use": "@now/python" },
        { "src": "api/php/*.php", "use": "@now/php" },
        { "src": "api/node/*.js", "use": "@now/node" }
    ],
    "routes": [
        {
          "src": "/api/(.*)",
          "dest": "/api/\$1"
        },
        {
          "src": "/(.*)",
          "dest": "/www/\$1",
          "headers": {
            "x-request-path": "\$1"
          }
        },
        {
          "src": "/redirect-test",
          "status": 302,
          "headers": {
            "location": "https://google.com"
          }
        }
    ]
}
As you can see, the example not only contains several different Builds, but also a number of Routes sprinkled with custom headers and status codes.
By adding so many different properties to the configuration file (which represents a real use case), we are showcasing how well the new now inspect command manages to display all of them and not exclude any information.

Other Use Cases

Although the recent redesign only affects Now 2.0 deployments, you can still invoke now inspect with a Now 1.0 deployment:
now inspect <deployment-url>
Even passing an alias will work (it will be resolved to the deployment behind it):
now inspect <alias-url>
But most importantly, the latest version of Now CLI also offers another command, specifically built for inspecting domains:
now domains inspect <domain>
When invoked, this command will display all the important information your domain:

The best way to retrieve all the information about a domain of yours

What Is Next

We are going to make sure that, in the future, every kind of resource can be as easily inspected as deployments and domains.
In order to immediately be informed when that happens, make sure to follow us on Twitter and consider checking out our community chat.