Bearer CLI


Keywords
oclif
License
MIT
Install
npm install @bearer/cli@1.13.6

Documentation

Bearer - The API Integration Framework

Bearer Documentation

Bearer provides all of the tools to build, run and manage API
Learn more


Version License [![Build Status][ci-svg]][ci-url]

Table of contents

Why

You should use Bearer if you want to:

  • Consume any API in minutes
  • Map API endpoints to your app model
  • Integrate into your code with one line
  • Deploy and Scale without fuss
  • Monitor every API call
  • Manage your integrations

Installation

# Using yarn
yarn create bearer helloWorld

# Using npm
npm init bearer helloWorld

# Using npx
npx create-bearer helloWorld

Quick Start

Follow the quick start to create your first integration.

Documentation

The documentation is available on the Bearer doc center.

Command References

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

$ yarn bearer -h

Bearer CLI

VERSION
  @bearer/cli/rc-1

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

Find below some explanation of commands by order of importance.

New

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

yarn bearer new

Setup

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

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:

yarn bearer generate:function FunctionName

Invoke

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

yarn bearer invoke FunctionName

It's a great way to test and debug a function.

You can also pass arguments, as a JSON file, to the invoke command, which are translated as params to the function:

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

NB: The file path is relative to the integration folder.

Start

The start command provides a local Web Server to test the integration:

yarn bearer start

Behind the scene, it builds the integration (transpiling code, etc...) and manage things like live reload.

Push

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

yarn bearer push

Login

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

yarn bearer login

It's a required step in order to push your integration.

Link

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

yarn bearer link

NB: This command is triggered automatically when you deploy an integration for the first time.

Integrations

The integrations command let list your deployed integration and also create a new one:

yarn bearer integrations
yarn bearer integrations:create

Contributing

We welcome all contributors, from casual to regular 💙

  • Bug report. Is something not working as expected? Send a bug report.
  • Feature request. Would you like to add something to the framework? Send a feature request.
  • Documentation. Did you find a typo in the doc? Open an issue and we'll take care of it.
  • Development. If you don't know where to start, you can check the open issues.

To start contributing to code, you need to:

  1. Fork the project
  2. Clone the repository
  3. Checkout the Getting Started

License

Bearer is MIT licensed.