From d16323dd6db5b5a99c5f8dad874e451fdd0616ba Mon Sep 17 00:00:00 2001 From: utibeabasi6 Date: Sat, 3 Feb 2024 05:51:10 +0100 Subject: [PATCH] docs: update README --- README.md | 110 +++++++++++++++++++++++++++++++++++++++++--- example/README.md | 1 - example/function.js | 6 --- 3 files changed, 104 insertions(+), 13 deletions(-) delete mode 100644 example/README.md delete mode 100644 example/function.js diff --git a/README.md b/README.md index 6889b88..fbda9f4 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,110 @@ -# Velocity +![Build and Lint CLI](https://github.com/runvelocity/cli/actions/workflows/build-cli.yaml/badge.svg) -A CLI that allows you to create, update, delete and invoke serverless functions powered by Firecracker. +
+ -## Why? +

CLI

-Absolutely no reason. I thought it would be fun to build so i did +

+ The Velocity CLI allows you to create and run serverless Velocity functions from your terminal. +
+ Explore the docs ยป +
+

+
-## How to use + +
+ Table of Contents +
    +
  1. + About +
  2. +
  3. + Getting Started + +
  4. +
  5. Usage
  6. +
  7. Roadmap
  8. +
  9. Contact
  10. +
+
-WIP +## About +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. + +

(back to top)

+ + +## Getting Started + +This section outlines how to install the CLI to get started creating functions. + +### Installation + +Download the precompiled binary for your operating system on the [release page](https://github.com/runvelocity/cli/releases) + +

(back to top)

+ + +## Usage + +### Creating a function + +Create a file called function.js and input the following code + +```javascript +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 + +```shell +Compress-Archive -LiteralPath .\function.js -DestinationPath code.zip +``` + +On Linux/Mac, use the following command + +```shell +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 +``` + +### Invoking a function + +To invoke a function, run the following command + +```shell +.\cli.exe invoke --name demo-func +``` + + +## Roadmap + +- [ ] Add support for updating functions +- [ ] Pass in parameters from the command line + +

(back to top)

+ + +## Contact + +Utibeabasi Umanah - [@utibeumanah_](https://twitter.com/utibeumanah_) - utibeabasiumanah6@gmail.com + +Project Link: [https://github.com/runvelocity](https://github.com/runvelocity) + +

(back to top)

\ No newline at end of file diff --git a/example/README.md b/example/README.md deleted file mode 100644 index 6d3f665..0000000 --- a/example/README.md +++ /dev/null @@ -1 +0,0 @@ -WIP \ No newline at end of file diff --git a/example/function.js b/example/function.js deleted file mode 100644 index fc1bfc2..0000000 --- a/example/function.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = (args) => { - return { - hello: "world", - args - } -} \ No newline at end of file