Installing the CLI

$ npm install -g binaris  
# This will prompt for an API key and keep it in ~/.binaris.yml
$ bn login

bn create

Creates the function files locally.

Examples

bn create python2 hello

Positional arguments

  • runtime: node8, python2 or pypy2
  • function: The function name (e.g. hello)

Options

  • —-path, -p <dir>: Create the function code in directory dir.

Local files

bn create generates two local files: function.py with the function code, and binaris.yml with its configuration. For the example above, the following configuration is created:

functions:
  hello:
    file: function.py
    entrypoint: handler
    runtime: python2

The configuration declares a single function called hello, sets its runtime to python2, and maps it to a specific function (handler) in a file (function.py).

bn deploy

Deploys a function to the cloud.

Examples

bn deploy hello

Positional arguments

  • function: The function name (e.g. hello)

Options

  • —-path, -p <dir>: Deploy the function from the directory dir.

bn invoke

Runs the function in the cloud.

Examples

bn invoke hello
bn invoke hello --data '{"name": "globe"}'    # Dictionary
bn invoke hello --data '"JSON String"'        # String. Note the double quotes!

Positional arguments

  • function: The function name (e.g. hello)

Options

  • —-json, -j: Path to file containing JSON data. The data will be sent as the HTTP body.
  • —-data, -d: Data to send with is HTTP body. The data will be JSON-ified.
  • —-path, -p <dir>: Invoke the function from the directory dir.

bn logs

Retrieves the function logs from the cloud.

Examples

bn logs hello
bn logs hello --tail
bn logs hello --since 1m
bn logs hello --since 24hours

Positional arguments

  • function: The function name (e.g. hello)

Options

  • —-since, -s: Outputs logs after the given ISO timestamp, e.g. 1m or 4h
  • —-tail, -t: Outputs logs in tail -f fashion (ignores —-since flag)

bn remove

Removes a function from the cloud. Local files remain intact.

Examples

bn remove hello

Positional arguments

  • function: The function name (e.g. hello)