On this page
Using deployctl on the command line
deployctl
is a command line tool (CLI) that lets you operate the Deno Deploy
platform without leaving your terminal. With it you can deploy your code, create
and manage your projects and their deployments, and monitor their usage and
logs.
Dependencies Jump to heading
The only dependency for deployctl
is the Deno runtime. You can install it by
running the following command:
curl -fsSL https://deno.land/install.sh | sh
You don't need to setup a Deno Deploy account beforehand. It will be created along the way when you deploy your first project.
Install deployctl
Jump to heading
With the Deno runtime installed, you can install the deployctl
utility with
the following command:
deno install -gArf jsr:@deno/deployctl
The -A
option in the deno install command grants all permissions to the
installed script. You can opt not to use it, in which case you will be prompted
to grant the necessary permissions when needed during the execution of the tool.
Deploy Jump to heading
To perform a new deployment of your code, navigate to the root directory of your project and execute:
deployctl deploy
Project and Entrypoint Jump to heading
If this is the first deployment of the project, deployctl
will guess the
project name based on the Git repo or directory it is in. Similarly, it will
guess the entrypoint by looking for files with common entrypoint names (main.ts,
src/main.ts, etc). After the first deployment, the settings used will be stored
in a config file (by default deno.json).
You can specify the project name and/or the entrypoint using the --project
and
--entrypoint
arguments respectively. If the project does not exist, it will be
created automatically. By default it is created in the personal organization of
the user, but it can also be created in a custom organization by specifying the
--org
argument. If the organization does not exist yet, it will also be
created automatically.
deployctl deploy --project=helloworld --entrypoint=src/entrypoint.ts --org=my-team
Include and Exclude Files Jump to heading
By default, deployctl deploys all the files in the current directory
(recursively, except node_modules
directories). You can customize this
behavior using the --include
and --exclude
arguments (also supported in the
config file). These arguments accept specific files, whole directories and
globs. Here are some examples:
-
Include only source and static files:
deployctl deploy --include=./src --include=./static
-
Include only Typescript files:
deployctl deploy --include=**/*.ts
-
Exclude local tooling and artifacts
deployctl deploy --exclude=./tools --exclude=./benches
A common pitfall is to not include the source code modules that need to be run
(entrypoint and dependencies). The following example will fail because main.ts
is not included:
deployctl deploy --include=./static --entrypoint=./main.ts
The entrypoint can also be a remote script. A common use case for this is to
deploy an static site using std/http/file_server.ts
(more details in
Static Site Tutorial):
deployctl deploy --include=dist --entrypoint=jsr:@std/http/file_server
Environment variables Jump to heading
You can set env variables using --env
(to set individual environment
variables) or --env-file
(to load one or more environment files). These
options can be combined and used multiple times:
deployctl deploy --env-file --env-file=.other-env --env=DEPLOYMENT_TS=$(date +%s)
The deployment will have access to these variables using Deno.env.get()
. Be
aware that the env variables set with --env
and --env-file
are specific for
the deployment being created and are not added to the list of
env variables configured for the project.
Production Deployments Jump to heading
Each deployment you create have a unique URL. In addition, a project has a
"production URL" and custom domains routing trafffic to its "production"
deployment. Deployments can be promoted to production at any time, or created
directly as production using the --prod
flag:
deployctl deploy --prod
Learn more about production deployments in the Deployments docs.
Deployments Jump to heading
The deployments subcommand groups all the operations around deployments.
List Jump to heading
You can list the deployments of a project with:
deployctl deployments list
Output:
β Page 1 of the list of deployments of the project 'my-project' is ready
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Deployment β Date β Status β Database β Domain β Entrypoint β Branch β Commit β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β kcbxc4xwe4mc β 12/3/2024 13:21:40 CET (2 days) β Preview β Preview β https://my-project-kcbxc4xwe4mc.deno.dev β main.ts β main β 4b6c506 β
β c0ph5xa9exb3 β 12/3/2024 13:21:25 CET (2 days) β Production β Production β https://my-project-c0ph5xa9exb3.deno.dev β main.ts β main β 4b6c506 β
β kwkbev9er4h2 β 12/3/2024 13:21:12 CET (2 days) β Preview β Preview β https://my-project-kwkbev9er4h2.deno.dev β main.ts β main β 4b6c506 β
β dxseq0jc8402 β 6/3/2024 23:16:51 CET (8 days) β Preview β Production β https://my-project-dxseq0jc8402.deno.dev β main.ts β main β 099359b β
β 7xr5thz8yjbz β 6/3/2024 22:58:32 CET (8 days) β Preview β Preview β https://my-project-7xr5thz8yjbz.deno.dev β main.ts β another β a4d2953 β
β 4qr4h5ac3rfn β 6/3/2024 22:57:05 CET (8 days) β Failed β Preview β n/a β main.ts β another β 56d2c88 β
β 25wryhcqmb9q β 6/3/2024 22:56:41 CET (8 days) β Preview β Preview β https://my-project-25wryhcqmb9q.deno.dev β main.ts β another β 4b6c506 β
β 64tbrn8jre9n β 6/3/2024 8:21:33 CET (8 days) β Preview β Production β https://my-project-64tbrn8jre9n.deno.dev β main.ts β main β 4b6c506 β
β hgqgccnmzg04 β 6/3/2024 8:17:40 CET (8 days) β Failed β Production β n/a β main.ts β main β 8071902 β
β rxkh1w3g74e8 β 6/3/2024 8:17:28 CET (8 days) β Failed β Production β n/a β main.ts β main β b142a59 β
β wx6cw9aya64c β 6/3/2024 8:02:29 CET (8 days) β Preview β Production β https://my-project-wx6cw9aya64c.deno.dev β main.ts β main β b803784 β
β a1qh5fmew2yf β 5/3/2024 16:25:29 CET (9 days) β Preview β Production β https://my-project-a1qh5fmew2yf.deno.dev β main.ts β main β 4bb1f0f β
β w6pf4r0rrdkb β 5/3/2024 16:07:35 CET (9 days) β Preview β Production β https://my-project-w6pf4r0rrdkb.deno.dev β main.ts β main β 6e487fc β
β nn700gexgdzq β 5/3/2024 13:37:11 CET (9 days) β Preview β Production β https://my-project-nn700gexgdzq.deno.dev β main.ts β main β c5b1d1f β
β 98crfqxa6vvf β 5/3/2024 13:33:52 CET (9 days) β Preview β Production β https://my-project-98crfqxa6vvf.deno.dev β main.ts β main β 090146e β
β xcdcs014yc5p β 5/3/2024 13:30:58 CET (9 days) β Preview β Production β https://my-project-xcdcs014yc5p.deno.dev β main.ts β main β 5b78c0f β
β btw43kx89ws1 β 5/3/2024 13:27:31 CET (9 days) β Preview β Production β https://my-project-btw43kx89ws1.deno.dev β main.ts β main β 663452a β
β 62tg1ketkjx7 β 5/3/2024 13:27:03 CET (9 days) β Preview β Production β https://my-project-62tg1ketkjx7.deno.dev β main.ts β main β 24d1618 β
β 07ag6pt6kjex β 5/3/2024 13:19:11 CET (9 days) β Preview β Production β https://my-project-07ag6pt6kjex.deno.dev β main.ts β main β 4944545 β
β 4msyne1rvwj1 β 5/3/2024 13:17:16 CET (9 days) β Preview β Production β https://my-project-4msyne1rvwj1.deno.dev β main.ts β main β dda85e1 β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Press enter to fetch the next page [Enter]
This command outputs pages of 20 deployments by default. You can iterate over
the pages with the enter key, and use the --page
and --limit
options to
query a specific page and page size.
Like with the rest of commands, you can use the --project
option to specify
the project of which to list deployments, if you are not in a project directory
or want to list deployments from a different project.
Show Jump to heading
Get all the details of a particular deployment using:
deployctl deployments show
Output:
β The production deployment of the project 'my-project' is 'c0ph5xa9exb3'
β The details of the deployment 'c0ph5xa9exb3' are ready:
c0ph5xa9exb3
------------
Status: Production
Date: 2 days, 12 hours, 29 minutes, 46 seconds ago (12/3/2024 13:21:25 CET)
Project: my-project (e54f23b5-828d-4b7f-af12-706d4591062b)
Organization: my-team (d97822ac-ee20-4ce9-b942-5389330b57ee)
Domain(s): https://my-project.deno.dev
https://my-project-c0ph5xa9exb3.deno.dev
Database: Production (0efa985f-3793-48bc-8c05-f740ffab4ca0)
Entrypoint: main.ts
Env Vars: HOME
Git
Ref: main [4b6c506]
Message: change name
Author: John Doe @johndoe [mailto:johndoe@deno.com]
Url: https://github.com/arnauorriols/my-project/commit/4b6c50629ceeeb86601347732d01dc7ed63bf34f
Crons: another cron [*/10 * * * *] succeeded at 15/3/2024 1:50:00 CET after 2 seconds (next at 15/3/2024 2:00:00 CET)
newest cron [*/10 * * * *] n/a
yet another cron [*/10 * * * *] failed at 15/3/2024 1:40:00 CET after 2 seconds (next at 15/3/2024 1:51:54 CET)
If no deployment is specified, the command shows the details of the current
production deployment of the project. To see the details of the last deployment,
use --last
, and to see the details of a particular deployment, use --id
(or
positional argument). You can also use --next
or --prev
to navigate the
deployments chronologically.
For example, to see the details of the second to last deployment, you can do:
deployctl deployments show --last --prev
And to see the details of 2 deployments after a specific deployment:
deployctl deployments show 64tbrn8jre9n --next=2
Redeploy Jump to heading
The redeploy command creates a new deployment reusing the build of an existing deployment, for the purpose of changing the resources associated with it. This includes production domains, environment variables and KV databases.
The semantics of selecting the deployment to redeploy are the same as those of
the show subcommand, including --last
, --id
, --next
and --prev
.
Production Domains Jump to heading
If you want to change the routing of the production domains of the project to a
particular deployment, you can redeploy it with the --prod
option:
deployctl deployments redeploy --prod 64tbrn8jre9n
This will create a new deployment with the same code and environment variables as the specified deployment, but with the production domains of the project pointing to it. For those projects with preview/prod databases (ie projects linked to GitHub), this will also set the production database for the new deployment.
This feature is similar to the "promote to production" button found in the Deno Deploy web application with the exception that the "promote to production" button does not create a new deployment. Instead, the "promote to production" button changes the domain routing in-place, however it's restricted to deployments already using the production database.
KV Database Jump to heading
If this is a GitHub deployment, it will have 2 databases, one for prod
deployments and one for preview deployments. You can change the database of a
deployment by redeploying it with the --db
option:
deployctl deployments redeploy --db=prod --id=64tbrn8jre9n
When redeploying a deployment to prod, by default it will automatically
configure it to use the prod database. You can combine both --prod
and --db
options to opt out of this behavior. For example, the following command will
redeploy the current production deployment (given the lack of positional
argument, --id
or --last
). The new deployment will become the new production
deployment, but it will use the preview database instead of the production
database:
deployctl deployments redeploy --prod --db=preview
If your organization has custom databases, you can also set them by UUID:
deployctl deployments redeploy --last --db=5261e096-f9aa-4b72-8440-1c2b5b553def
Environment Variables Jump to heading
When a deployment is created, it inherits the environment variables of the
project. Given that the deployments are immutable, their environment variables
can never be changed. To set new environment variables in a deployment, you need
to redeploy it using --env
(to set individual variables) and --env-file
(to
load one or more environment files).
The following command redeploys the current production deployment with the env
variables defined in the .env
and .other-env
files, plus the DEPLOYMENT_TS
variable set to the current timestamp. The resulting deployment will be a
preview deployment (ie the production domains won't route traffic to it, given
the lack of --prod
).
deployctl deployments redeploy --env-file --env-file=.other-env --env=DEPLOYMENT_TS=$(date +%s)
Be aware that when changing env variables, only the env variables set in the redeploy command will be used by the new deployment. The project env variables and the env variables of the deployment being redeployed are ignored. If this does not suit your needs, please report your feedback at https://github.com/denoland/deploy_feedback/issues/
When you change the project environment variables in the Deno Deploy web application, the current production deployment is redeployed with the new environment variables, and the new deployment becomes the new production deployment.
Delete Jump to heading
You can delete a deployment using the delete
subcommand:
deployctl deployments delete 64tbrn8jre9n
Like show
and redeploy
, delete
can also use --last
, --next
and
--prev
to select the deployment to delete. Here's an example command that
deletes all the deployments of a project except the last (use with caution!):
while deployctl deployments delete --project=my-project --last --prev; do :; done
Projects Jump to heading
The projects
subcommand groups all the operations against projects as a whole.
this includes list
, show
, rename
, create
and delete
.
List Jump to heading
deployctl projects list
outputs all the projects your user has access to,
grouped by organization:
Personal org:
blog
url-shortener
'my-team' org:
admin-site
main-site
analytics
You can filter by organization using --org
:
deployctl projects list --org=my-team
Show Jump to heading
To see the details of a particular project, use projects show
. If you are
inside a project, it will pick up the project id from the config file. You can
also specify the project using --project
or the positional argument:
deployctl projects show main-site
Output:
main-site
---------
Organization: my-team (5261e096-f9aa-4b72-8440-1c2b5b553def)
Domain(s): https://my-team.com
https://main-site.deno.dev
Dash URL: https://dash.deno.com/projects/8422c515-f68f-49b2-89f3-157f4b144611
Repository: https://github.com/my-team/main-site
Databases: [main] dd28e63e-f495-416b-909a-183380e3a232
[*] e061c76e-4445-409a-bc36-a1a9040c83b3
Crons: another cron [*/10 * * * *] succeeded at 12/3/2024 14:40:00 CET after 2 seconds (next at 12/3/2024 14:50:00 CET)
newest cron [*/10 * * * *] n/a
yet another cron [*/10 * * * *] failed at 12/3/2024 14:40:00 CET after 2 seconds (next at 12/3/2024 14:50:00 CET)
Deployments: kcbxc4xwe4mc c0ph5xa9exb3* kwkbev9er4h2 dxseq0jc8402 7xr5thz8yjbz
4qr4h5ac3rfn 25wryhcqmb9q 64tbrn8jre9n hgqgccnmzg04 rxkh1w3g74e8
wx6cw9aya64c a1qh5fmew2yf w6pf4r0rrdkb nn700gexgdzq 98crfqxa6vvf
xcdcs014yc5p btw43kx89ws1 62tg1ketkjx7 07ag6pt6kjex 4msyne1rvwj1
Rename Jump to heading
Projects can be renamed easily with the rename
subcommand. Similarly to the
other commands, if you run the command from within a project's directory, you
don't need to specify the current name of the project:
deployctl projects rename my-personal-blog
Output:
βΉ Using config file '/private/tmp/blog/deno.json'
β Project 'blog' (8422c515-f68f-49b2-89f3-157f4b144611) found
β Project 'blog' renamed to 'my-personal-blog'
Keep in mind that the name of the project is part of the preview domains (https://my-personal-blog-kcbxc4xwe4mc.deno.dev) and the default production domain (https://my-personal-blog.deno.dev). Therefore, when changing the project name, the URLs with the previous name will no longer route to the project's corresponding deployments.
Create Jump to heading
You can create an empty project with:
deployctl projects create my-new-project
Delete Jump to heading
You can delete a project with:
deployctl projects delete my-new-project
Top Jump to heading
The top
subcommand is used to monitor the resource usage of a project in
real-time:
deployctl top
Output:
ββββββββββ¬βββββββββββββββββ¬βββββββββββββββββββββββββ¬ββββββββββ¬ββββββββ¬ββββββββββ¬βββββββββββ¬ββββββββββββββ¬βββββββββββββ¬ββββββββββ¬ββββββββββ¬ββββββββββββ¬ββββββββββββ
β (idx) β deployment β region β Req/min β CPU% β CPU/req β RSS/5min β Ingress/min β Egress/min β KVr/min β KVw/min β QSenq/min β QSdeq/min β
ββββββββββΌβββββββββββββββββΌβββββββββββββββββββββββββΌββββββββββΌββββββββΌββββββββββΌβββββββββββΌββββββββββββββΌβββββββββββββΌββββββββββΌββββββββββΌββββββββββββΌββββββββββββ€
β 6b80e8 β "kcbxc4xwe4mc" β "asia-northeast1" β 80 β 0.61 β 4.56 β 165.908 β 11.657 β 490.847 β 0 β 0 β 0 β 0 β
β 08312f β "kcbxc4xwe4mc" β "asia-northeast1" β 76 β 3.49 β 27.58 β 186.278 β 19.041 β 3195.288 β 0 β 0 β 0 β 0 β
β 77c10b β "kcbxc4xwe4mc" β "asia-south1" β 28 β 0.13 β 2.86 β 166.806 β 7.354 β 111.478 β 0 β 0 β 0 β 0 β
β 15e356 β "kcbxc4xwe4mc" β "asia-south1" β 66 β 0.97 β 8.93 β 162.288 β 17.56 β 4538.371 β 0 β 0 β 0 β 0 β
β a06817 β "kcbxc4xwe4mc" β "asia-southeast1" β 126 β 0.44 β 2.11 β 140.087 β 16.504 β 968.794 β 0 β 0 β 0 β 0 β
β d012b6 β "kcbxc4xwe4mc" β "asia-southeast1" β 119 β 2.32 β 11.72 β 193.704 β 23.44 β 8359.829 β 0 β 0 β 0 β 0 β
β 7d9a3d β "kcbxc4xwe4mc" β "australia-southeast1" β 8 β 0.97 β 75 β 158.872 β 10.538 β 3.027 β 0 β 0 β 0 β 0 β
β 3c21be β "kcbxc4xwe4mc" β "australia-southeast1" β 1 β 0.04 β 90 β 105.292 β 0.08 β 1.642 β 0 β 0 β 0 β 0 β
β b75dc7 β "kcbxc4xwe4mc" β "europe-west2" β 461 β 5.43 β 7.08 β 200.573 β 63.842 β 9832.936 β 0 β 0 β 0 β 0 β
β 33607e β "kcbxc4xwe4mc" β "europe-west2" β 35 β 0.21 β 3.69 β 141.98 β 9.438 β 275.788 β 0 β 0 β 0 β 0 β
β 9be3d2 β "kcbxc4xwe4mc" β "europe-west2" β 132 β 0.92 β 4.19 β 180.654 β 15.959 β 820.513 β 0 β 0 β 0 β 0 β
β 33a859 β "kcbxc4xwe4mc" β "europe-west3" β 1335 β 7.57 β 3.4 β 172.032 β 178.064 β 10967.918 β 0 β 0 β 0 β 0 β
β 3f54ce β "kcbxc4xwe4mc" β "europe-west4" β 683 β 4.76 β 4.19 β 187.802 β 74.696 β 7565.017 β 0 β 0 β 0 β 0 β
β cf881c β "kcbxc4xwe4mc" β "europe-west4" β 743 β 3.95 β 3.19 β 177.213 β 86.974 β 6087.454 β 0 β 0 β 0 β 0 β
β b4565b β "kcbxc4xwe4mc" β "me-west1" β 3 β 0.21 β 55 β 155.46 β 2.181 β 0.622 β 0 β 0 β 0 β 0 β
β b97970 β "kcbxc4xwe4mc" β "southamerica-east1" β 3 β 0.08 β 25 β 186.049 β 1.938 β 0.555 β 0 β 0 β 0 β 0 β
β fd7a08 β "kcbxc4xwe4mc" β "us-east4" β 3 β 0.32 β 80 β 201.101 β 0.975 β 58.495 β 0 β 0 β 0 β 0 β
β 95d68a β "kcbxc4xwe4mc" β "us-east4" β 133 β 1.05 β 4.77 β 166.052 β 28.107 β 651.737 β 0 β 0 β 0 β 0 β
β c473e7 β "kcbxc4xwe4mc" β "us-east4" β 0 β 0 β 0 β 174.154 β 0.021 β 0 β 0 β 0 β 0 β 0 β
β ebabfb β "kcbxc4xwe4mc" β "us-east4" β 19 β 0.15 β 4.78 β 115.732 β 7.764 β 67.054 β 0 β 0 β 0 β 0 β
β eac700 β "kcbxc4xwe4mc" β "us-south1" β 114 β 2.37 β 12.54 β 183.001 β 18.401 β 22417.397 β 0 β 0 β 0 β 0 β
β cd2194 β "kcbxc4xwe4mc" β "us-south1" β 35 β 0.33 β 5.68 β 145.871 β 8.142 β 91.236 β 0 β 0 β 0 β 0 β
β 140fec β "kcbxc4xwe4mc" β "us-west2" β 110 β 1.43 β 7.84 β 115.298 β 18.093 β 977.993 β 0 β 0 β 0 β 0 β
β 51689f β "kcbxc4xwe4mc" β "us-west2" β 1105 β 7.66 β 4.16 β 187.277 β 154.876 β 14648.383 β 0 β 0 β 0 β 0 β
β c5806e β "kcbxc4xwe4mc" β "us-west2" β 620 β 4.38 β 4.24 β 192.291 β 109.086 β 9685.688 β 0 β 0 β 0 β 0 β
ββββββββββ΄βββββββββββββββββ΄βββββββββββββββββββββββββ΄ββββββββββ΄ββββββββ΄ββββββββββ΄βββββββββββ΄ββββββββββββββ΄βββββββββββββ΄ββββββββββ΄ββββββββββ΄ββββββββββββ΄ββββββββββββ
β Ό Streaming...
The columns are defined as follows:
Column | Description |
---|---|
idx | Instance discriminator. Opaque id to discriminate different executions running in the same region. |
deployment | The id of the deployment running in the executing instance. |
Req/min | Requests per minute received by the project. |
CPU% | Percentage of CPU used by the project. |
CPU/req | CPU time per request, in milliseconds. |
RSS/5min | Max RSS used by the project during the last 5 minutes, in MB. |
Ingress/min | Data received by the project per minute, in KB. |
Egress/min | Data output by the project per minute, in KB. |
KVr/min | KV reads performed by the project per minute. |
KVw/min | KV writes performed by the project per minute. |
QSenq/min | Queues enqueues performed by the project per minute. |
QSdeq/min | Queues dequeues performed by the project per minute. |
You can filter by region using --region
, which accepts substrings and can be
used multiple times:
deployctl top --region=asia --region=southamerica
Logs Jump to heading
You can fetch the logs of your deployments with deployctl logs
. It supports
both live logs where the logs are streamed to the console as they are generated,
and query persisted logs where the logs generated in the past are fetched.
To show the live logs of the current production deployment of a project:
deployctl logs
Unlike in the Deno Deploy web application, at the moment the logs subcommand does not automatically switch to the new production deployment when it changes.
To show the live logs of a particular deployment:
deployctl logs --deployment=1234567890ab
Logs can be filtered by level, region and text using --levels
--regions
and
--grep
options:
deployctl logs --levels=error,info --regions=region1,region2 --grep='unexpected'
To show the persisted logs, use the --since
and/or --until
options:
deployctl logs --since=$(date -Iseconds -v-2H) --until=$(date -Iseconds -v-30M)
deployctl logs --since=$(date -Iseconds --date='2 hours ago') --until=$(date -Iseconds --date='30 minutes ago')
API Jump to heading
If you use the subhosting API,
deployctl api
will help you interact with the API by handling the
authentication and headers for you:
deployctl api /projects/my-personal-blog/deployments
Use --method
and --body
to specify the HTTP method and the request body:
deployctl api --method=POST --body='{"name": "main-site"}' organizations/5261e096-f9aa-4b72-8440-1c2b5b553def/projects
Local Development Jump to heading
For local development you can use the deno
CLI. To install deno
, follow the
instructions in the
Deno manual.
After installation, you can run your scripts locally:
$ deno run --allow-net=:8000 ./main.ts
Listening on http://localhost:8000
To watch for file changes add the --watch
flag:
$ deno run --allow-net=:8000 --watch ./main.ts
Listening on http://localhost:8000
For more information about the Deno CLI, and how to configure your development environment and IDE, visit the Deno Manual's Getting Started section.
JSON output Jump to heading
All the commands that output data have a --format=json
option that outputs the
data in JSON objects. This output mode is the default when stdout is not a TTY,
notably when piping to another command. Together with jq
, this mode enables
the programmatic use of all the data provided by deployctl
:
Get the id of the current production deployment:
deployctl deployments show | jq .build.deploymentId
Get a csv stream of the CPU time per request on each isolate of each region:
deployctl top | jq -r '[.id,.region,.cpuTimePerRequest] | @csv'