Skip to content
On this page

netzo/cli ​

https://deno.land/x/netzo/cli

The netzo/cli module is a command line tool to streamline local development of projects in Netzo. In essence, the CLI allows developers to create new projects from scratch or from existing templates, develop locally and deploy to Netzo with a single command. You can use the native Deno CLI to run your project locally.

Installation ​

Make sure you have followed the instructions to install the Deno CLI.

You can install the netzo CLI by running the following command:

sh
deno install --allow-read --allow-write --allow-env --allow-net --allow-run --no-check -r -f https://deno.land/x/netzo/cli/netzo.ts
deno install --allow-read --allow-write --allow-env --allow-net --allow-run --no-check -r -f https://deno.land/x/netzo/cli/netzo.ts

Authentication ​

Before being able to deploy, you need to get an API key from the Workspace > Settings > API keys page. Store this token in a NETZO_API_KEY environment variable or pass it in the --api-key flag each time you run netzo.

Subcommands ​

The netzo CLI is a single executable that provides a number of subcommands. To see the full list of subcommands and options, run netzo --help or netzo -h.

deploy ​

The deploy subcommand lets you deploy a project to Netzo.

null

To deploy a local project:

sh
netzo deploy --project=my-project main.ts
netzo deploy --project=my-project main.ts

To deploy a remote project:

sh
netzo deploy --project=my-project https://deno.land/x/netzo/cli/examples/hello.ts
netzo deploy --project=my-project https://deno.land/x/netzo/cli/examples/hello.ts

To deploy a remote project without static files:

sh
netzo deploy --project=my-project --no-static https://deno.land/x/netzo/cli/examples/hello.ts
netzo deploy --project=my-project --no-static https://deno.land/x/netzo/cli/examples/hello.ts

To ignore the node_modules directory while deploying:

sh
netzo deploy --project=my-project --exclude=node_modules main.tsx
netzo deploy --project=my-project --exclude=node_modules main.tsx

logs (soon) ​

The logs subcommand lets you stream the logs of a project in real-time.

sh
netzo logs --project=my-project
netzo logs --project=my-project

upgrade ​

The upgrade subcommand lets you upgrade the netzo CLI to the latest version.

sh
netzo upgrade
netzo upgrade

To upgrade to a specific version e.g. 0.0.1:

sh
netzo upgrade 0.0.1
netzo upgrade 0.0.1

Deno CLI ​

All projects in Netzo are Deno projects and can be run locally using the Deno CLI. To install deno, follow the instructions in the Deno manual.

After installation, you can run your scripts locally:

sh
$ deno run --allow-net=:8000 https://deno.land/x/netzo/cli/examples/hello.ts
Listening on http://localhost:8000
$ deno run --allow-net=:8000 https://deno.land/x/netzo/cli/examples/hello.ts
Listening on http://localhost:8000

To watch for file changes add the --watch flag:

sh
$ deno run --allow-net=:8000 --watch https://deno.land/x/netzo/cli/examples/hello.ts
Listening on http://localhost:8000
$ deno run --allow-net=:8000 --watch https://deno.land/x/netzo/cli/examples/hello.ts
Listening on http://localhost:8000

Local development setup

Be sure to follow the Getting Started section to install the CLI and configure your IDE.