Command References

The Framework comes with a Command Line Interface (CLI) that provides many commands:

NPM
Yarn
npm run bearer help
yarn bearer -h
Bearer CLI
VERSION
@bearer/cli/1.0.0
USAGE
$ bearer [COMMAND]
COMMANDS
autocomplete display autocomplete installation instructions
generate generate function
help display help for bearer
integrations list deployed integrations
invoke invoke function locally
link link to remote Bearer integration
login login using Bearer credentials
new generate integration boilerplate
push deploy integration to Bearer
setup setup API credentials for local development
start start local development environment

Below are some explanations of commands, ranked in order of importance.

New

As an alternative to the yarn create bearer command, you can also use the new command:

NPM
Yarn
npm run bearer new
yarn bearer new

Setup

This command helps you setup your (test) API authentication credentials in local development:

NPM
Yarn
npm run bearer setup:auth
yarn bearer setup:auth

Generate

The generate command provides a fast and easy way to bootstrap a function, taking care of much of the boilerplate code:

NPM
Yarn
npm run bearer generate:function FunctionName
yarn bearer generate:function FunctionName

Invoke

The invoke command lets you run a function directly from the console:

NPM
Yarn
npm run bearer invoke FunctionName
yarn bearer invoke FunctionName

This is a great way to test and debug a function.

You can also pass an argument to the invoke command as a JSON file, which will be translated as params to the function:

NPM
Yarn
npm run bearer invoke FunctionName -p tests/function.json
yarn bearer invoke FunctionName -p tests/function.json
tests/function.json
{"params": {"fullName": "Bearer/bearer"}}

The file path is relative to the integration folder.

Start

The start command provides a local web server to test the integration:

NPM
Yarn
npm run bearer start
yarn bearer start

Behind the scenes, the command builds the integration (transpiling code etc.) and manages things like live reload.

Push

The push command lets you deploy your integration to the platform 🚀

NPM
Yarn
npm run bearer push
yarn bearer push

Login

The login command lets you connect to the platform from the CLI:

NPM
Yarn
npm run bearer login
yarn bearer login

This is a necessary step in order to push your integration.

Link

The link command lets you link an integration registered on your bearer's dashboard with your current integration code:

NPM
Yarn
npm run bearer link
yarn bearer invoke link

This command will be triggered automatically when you deploy an integration for the first time.

Integrations

The integrations command lets you list your deployed integration, and also create a new one:

NPM
Yarn
npm run bearer integrations
npm run bearer integrations:create
yarn bearer integrations
yarn bearer integrations:create