The Velocity CLI allows you to create and run serverless Velocity functions from your terminal.
Explore the docs »
Table of Contents
The CLI is written in Go using the Cobra framework and Bubbletea as a TUI. It allows you to create, delete and invoke Velocity functions.
This section outlines how to install the CLI to get started creating functions.
Download the precompiled binary for your operating system on the release page
Create a file called function.js and input the following code
module.exports = (args) => {
return {
hello: "world",
}
}
Next, you have to create a zip file containing this code. If you are on windows with powershell, use the following command
Compress-Archive -LiteralPath .\function.js -DestinationPath code.zip
On Linux/Mac, use the following command
zip code.zip function.js
Next, create a function by running the following command
.\cli.exe create --name demo-func --file-path code.zip --handler function
To invoke a function, run the following command
.\cli.exe invoke --name demo-func
- Add support for updating functions
- Pass in parameters from the command line
Utibeabasi Umanah - @utibeumanah_ - utibeabasiumanah6@gmail.com
Project Link: https://github.com/runvelocity