Fleet CLI

Learn how to use the Fleet CLI to deploy and simplify your development workflow.

Install the Fleet CLI

To install the Fleet CLI with yarn:

yarn global add @fleetfn/cli

npm:

npm i -g @fleetfn/cli

Once you have Fleet CLI installed, now you have to authenticate your CLI to be able to carry out the available commands. Log in to the console and access the tokens page, create a personal access token and go back to your terminal and run the command:

fleet auth -t <token-here>

Once done, your CLI is configured to carry out the available commands. Remember that your token is no longer shown again after being created on the console, keep it safe if you lost it or someone accessed it without your permission, delete and create one again.

Deployments

The command fleet or fleet deploy is used for deployment, in the main file where fleet.yml is located, execute the command to perform the deployment.

fleet

Once Fleet is executed it creates a new unique URL for your deployment but does not define it as a production deployment, you can change it via the interface in the deployments tab or send a new deployment with the -p option.

fleet --prod

Dev

The fleet dev command starts up an HTTP server locally which allows you to test and code your Fleet Function. Changes to the file automatically trigger a new recompilation of the function and when modifying the fleet.yml file.

fleet dev [--ip <ip>] [--port <port>]

Starting a local development server simulates a Serverless Function in production, minus imposing API limits for now and concurrency limits or asynchronous limit.

Init

Start a new project using some of our examples from the repository available on Github. Run init with the example name or without to list all examples.

fleet init [example]