@8base/api-cli 中文文档教程

发布于 3年前 浏览 27 更新于 3年前

8base-api-cli

8base API 命令行界面 (CLI)

Table of Contents

Installation

Globally

全局安装 CLI

$ yarn global add @8base/api-cli

现在您可以在任何地方使用以下命令运行

$ 8base-api-cli

Locally

C​​LI 将 CLI 本地安装到您的 node_modules 文件夹中

$ yarn add @8base/api-cli --dev

您应该能够运行 CLI 使用

$ node_modules/.bin/8base-api-cli

Usage

之前你应该设置API 端点

  8base-api-cli config:set --name=url --value=https://api.8base.com
Usage: 8base-api-cli <command> [options]

Commands:
  8base-api-cli auth:confirm   Confirm with passed credentials.
  8base-api-cli auth:login     Login with passed credentials.
  8base-api-cli auth:logout    Logout and clear saved credentials.
  8base-api-cli auth:sicolo    Sign up, confirm and login with passed credentials.
  8base-api-cli auth:signup    Sign up with passed credentials.
  8base-api-cli auth:whoami    Display the current auth parameters.
  8base-api-cli config         Display a config.
  8base-api-cli config:get     Display a config value with passed name.
  8base-api-cli config:set     Set a config value with passed name.
  8base-api-cli schema:export  Export tables to the schema file.
  8base-api-cli schema:import  Import tables by passed schema file.
  8base-api-cli tables:drop    Drop all user tables.
  8base-api-cli tables:fill    Fill all user tables with mock data.

Options:
  --help     Show help                                                 [boolean]
  --version  Show version number                                       [boolean]

Commands

auth:confirm

使用传递的凭据进行确认。

Options:
  --email                                                    [string] [required]
  --code                                                     [string] [required]
  --password                                                 [string] [required]
  --save                                               [boolean] [default: true]

auth:login

使用传递的凭据登录。

Options:
  --email                                                    [string] [required]
  --password                                                 [string] [required]
  --save                                               [boolean] [default: true]

auth:logout

注销并清除保存的凭据。

auth:sicolo

使用传递的凭据注册、确认和登录。

Options:
  --email                                                    [string] [required]
  --password                                                 [string] [required]
  --firstName                                         [string] [default: "Ivan"]
  --lastName                                        [string] [default: "Ivanov"]
  --organization                                     [string] [default: "8base"]
  --host                                    [string] [default: "imap.yandex.ru"]
  --save                                               [boolean] [default: true]

auth:signup

使用传递的凭据注册。

Options:
  --email                                                    [string] [required]
  --password                                                 [string] [required]
  --firstName                                         [string] [default: "Ivan"]
  --lastName                                        [string] [default: "Ivanov"]
  --organization                                     [string] [default: "8base"]

auth:whoami

显示当前的授权参数。

config

显示配置。

config:get

显示具有传递名称的配置值。

Options:
  --name                                                     [string] [required]

config:set

使用传递的名称设置配置值。

Options:
  --name                                                     [string] [required]
  --value                                                    [string] [required]

schema:export

将表导出到模式文件。

Options:
  --file                          [string] [required] [default: "./EXPORT.json"]

schema:import

通过传递的模式文件导入表。

Options:
  --file                          [string] [required] [default: "./IMPORT.json"]

tables:drop

删除所有用户表。

tables:fill

用模拟数据填充所有用户表。

8base-api-cli

The 8base API Command Line Interface (CLI)

Table of Contents

Installation

Globally

Install CLI globally with

$ yarn global add @8base/api-cli

Now you can run CLI using following command anywhere

$ 8base-api-cli

Locally

Install CLI locally to your node_modules folder with

$ yarn add @8base/api-cli --dev

You should be able to run CLI with

$ node_modules/.bin/8base-api-cli

Usage

Before usage you should set API endpoint

  8base-api-cli config:set --name=url --value=https://api.8base.com
Usage: 8base-api-cli <command> [options]

Commands:
  8base-api-cli auth:confirm   Confirm with passed credentials.
  8base-api-cli auth:login     Login with passed credentials.
  8base-api-cli auth:logout    Logout and clear saved credentials.
  8base-api-cli auth:sicolo    Sign up, confirm and login with passed credentials.
  8base-api-cli auth:signup    Sign up with passed credentials.
  8base-api-cli auth:whoami    Display the current auth parameters.
  8base-api-cli config         Display a config.
  8base-api-cli config:get     Display a config value with passed name.
  8base-api-cli config:set     Set a config value with passed name.
  8base-api-cli schema:export  Export tables to the schema file.
  8base-api-cli schema:import  Import tables by passed schema file.
  8base-api-cli tables:drop    Drop all user tables.
  8base-api-cli tables:fill    Fill all user tables with mock data.

Options:
  --help     Show help                                                 [boolean]
  --version  Show version number                                       [boolean]

Commands

auth:confirm

Confirm with passed credentials.

Options:
  --email                                                    [string] [required]
  --code                                                     [string] [required]
  --password                                                 [string] [required]
  --save                                               [boolean] [default: true]

auth:login

Login with passed credentials.

Options:
  --email                                                    [string] [required]
  --password                                                 [string] [required]
  --save                                               [boolean] [default: true]

auth:logout

Logout and clear saved credentials.

auth:sicolo

Sign up, confirm and login with passed credentials.

Options:
  --email                                                    [string] [required]
  --password                                                 [string] [required]
  --firstName                                         [string] [default: "Ivan"]
  --lastName                                        [string] [default: "Ivanov"]
  --organization                                     [string] [default: "8base"]
  --host                                    [string] [default: "imap.yandex.ru"]
  --save                                               [boolean] [default: true]

auth:signup

Sign up with passed credentials.

Options:
  --email                                                    [string] [required]
  --password                                                 [string] [required]
  --firstName                                         [string] [default: "Ivan"]
  --lastName                                        [string] [default: "Ivanov"]
  --organization                                     [string] [default: "8base"]

auth:whoami

Display the current auth parameters.

config

Display a config.

config:get

Display a config value with passed name.

Options:
  --name                                                     [string] [required]

config:set

Set a config value with passed name.

Options:
  --name                                                     [string] [required]
  --value                                                    [string] [required]

schema:export

Export tables to the schema file.

Options:
  --file                          [string] [required] [default: "./EXPORT.json"]

schema:import

Import tables by passed schema file.

Options:
  --file                          [string] [required] [default: "./IMPORT.json"]

tables:drop

Drop all user tables.

tables:fill

Fill all user tables with mock data.

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文