1.0.19 • Published 7 years ago

fnhub v1.0.19

Weekly downloads
2
License
Artistic License ...
Repository
github
Last release
7 years ago

fnhub

This repo is the Command-Line Interface for fnhub.io. It can be used to easily publish, share, and consume open-source serverless functions for deployment on platforms like AWS Lambda, Microsoft Azure Functions, or Google Cloud Functions. Below is a reference list for all of the commands in the CLI. They are divided into three areas - General commands, Publisher commands, and Consumer commands.

General Commands

General commands are used to get more details on a fnhub.io package.

info

The info command provides information on a specific module.

Example

fnhub info

Options and Parameters

name (bold fields are required)descriptiontypevalidationdefault value
moduleThe name of the module for which you are requesting infostringnonenone
versionThe module version to obtain information forstringnone"latest"

who

Provides details on the currently authenticated user.

Example

fnhub who

Options and Parameters

This command has no options or parameters.

Publisher Commands

These commands are intended to be used by module publishers. They consist of all of the commands necessary to upload a function module to fnhub.io, as well as maintain its information.

signin

This authenticates the user with fnhub.io, using a persistent cookie to track authorization. Required prior to running any other publishing commands

Example

fnhub signin --username someone@somewhere.com --password 123456

Options and Parameters

name (bold fields are required)descriptiontypevalidationdefault value
usernameThe user's registered usernamestringsupports email and plaintextnone
passwordThe registered user's passwordstringnonenone

init

The init command initializes a fnhub.io module. It creates a module.yaml file in the working directory. This file will hold all necessary information about the module being created.

Example

fnhub init --name hi --authorEmail relly@backand.com --authorName "Relly Rivlin" --version 1.0.110 --description "module description" --repo", "https://github.com/relly/fnhub" --keywords "hello world", --license mit

Options and Parameters

name (bold fields are required)descriptiontypevalidationdefault value
nameThe module's name, to be published. Must be globally uniquestringsupports alphanumeric characters and dashesCurrent working directory
authorEmailThe module's author's emailstringemailcurrent authenticated user's email
authorNameThe module's author's namestringalphanumericcurrent authenticated user's name
versionThe module's versionstringvalidated per rules at http://semver.org1.0.0
descriptionA description of the modulestringnonenone
repoThe module's github repositorystringurlIf a github file ID exists, this value is used
keywordsA list of keywords that users will use when searching for the modulestringChecks for a space-delimited stringThe module's name
licenseThe module's licensestringnoneISC

add

Adds a serverless function to the current module. Each module can support multiple functions.

Note: Many serverless function providers, as a part of their best practices, recommend having a single set of source code with multiple entry points when working with related functionality.

Example

fnhub add --name "hi1" --description "function description" --handler index.handler1 --runtime nodejs4.3 --env "{}"

Options and Parameters

name (bold fields are required)descriptiontypevalidationdefault value
nameThe function name to add to the module (this can include more than one function name)stringsupports alphanumeric characters and dashescurrent module name
descriptionA description of the functionstringnonenone
runtimeThe run time environment for the functionstringmust be one of 'nodejs4.3', 'nodejs6.10', 'Edge Node.js 4.3', 'Python 2.7', 'Python 3.6', 'Java 8', or 'C#'none
handlerThe serverless function's entry pointstringnoneindex.handler
envEnvironment variables for the function, defined in JSONJSONmust be valid JSON{}

publish

Publishes the module. If this is the first module you have published, FnHub.io first creates a unique namespace. This can return an error if the name requested is already taken. Once this is finished, the CLI updates your module's version then deploys the code to global storage (in AWS S3).

Example

fnhub publish

Options and Parameters

None

version

Retrieves the module version from module.yml

Example

fnhub version

Options and Parameters

None

version major

Increases the module's major version segment in module.yml

Example

fnhub version major

Options and Parameters

None

version minor

Increases the module's minor version segment in module.yml

Example

fnhub version minor

Options and Parameters

None

version patch

Increases the module's patch version segment in module.yml

Example

fnhub version patch

Options and Parameters

None

delete

Deletes the module (all versions) and clears local storage

Example

fnhub delete

Options and Parameters

name (bold fields are required)descriptiontypevalidationdefault value
descriptionThe module name to deletestringnoneIf none is provided, the name is pulled from module.yml

Consumer Plugins Commands

These commands are used by consumers seeking to leverage code published on fnhub.io in their own projects.

cf (cloud formation plugin)

The functions below operate using our AWS CloudFormation plugin, cf

create

Creates a fnhub-stack.yaml file in the working directory. This file holds all necessary stack information

Example

fnhub cf create --name stack001 --description "stack description"

options and Parameters
name (bold fields are required)descriptiontypevalidationdefault value
nameThe name of the stackstringsupports alphanumeric characters and dashesnone
descriptionA description of the stackstringnonenone

include

Adds a module to the fnhub-stack.yml file in the current working directory. A stack can include several modules.

Example

fnhub cf include --module hi --version 1.0.0

Options and Parameters
name (bold fields are required)descriptiontypevalidationdefault value
moduleThe name of the module to includestringsupports alphanumeric characters and dashesnone
versionThe version of the module to includestringvalidated per rules at http://semver.orglatest

deploy

Uses the AWS CLI to deploy a cloud formation yaml file to your AWS account

Example

fnhub cf deploy

Options and Parameters

None

SAM (SAM plugin)

The SAM plugin operates in exactly the same way as our AWS CloudFormation plugin, but simply uses SAM instead of CloudFormation. Simply replace cf with sam in any of the CloudFormation commands, and your commands will be ready to go.

1.0.19

7 years ago

1.0.17

7 years ago

1.0.16

7 years ago

1.0.15

7 years ago

1.0.14

7 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago