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:
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.
To deploy a local project:
netzo deploy --project=my-project main.ts
netzo deploy --project=my-project main.ts
To deploy a remote project:
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:
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:
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.
netzo logs --project=my-project
netzo logs --project=my-project
upgrade
β
The upgrade
subcommand lets you upgrade the netzo
CLI to the latest version.
netzo upgrade
netzo upgrade
To upgrade to a specific version e.g. 0.0.1
:
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:
$ 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:
$ 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.