JSPM

  • Created
  • Published
  • Downloads 48
  • Score
    100M100P100Q63733F
  • License Apache-2.0

Official CLI for working with Sheetbase.

Package Exports

  • @sheetbase/cli

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@sheetbase/cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Sheetbase CLI

Official CLI for working with Sheetbase.

Build Status Coverage Status NPM License Support me on Patreon PayPal Ask me anything

Install

npm install -g @sheetbase/cli

Additional steps

Install @google/clasp

Recommended for developing Google Apps Script.

npm install -g @google/clasp

Enable Apps Script API

Go to https://script.google.com/home/usersettings, then enable the API.

Connect Apps Script in Drive

My Drive > Connect more apps > (search for Google Apps Script) > Connect

Develop & deploy

Backend

After running sheetbase setup successfully.

Develop the backend in the backend/ folder. Run npm run build to build the distribution package (this has security concern, see below). Run npm run update to update the backend.

To authorize the script:

  • Run sheetbase urls open backend, to open the script in Google Apps Script editor.
  • Publish > Deploy as web app... > Update
  • Follow the steps to authorize (ignore the warning)
  • Verify by sheetbase urls open backendUrl

Frontend

Develop and build according to your framework of choice.

Deploy to a static hosting or build an hybrid app.

Security

Only start a project with themes that you trust. Bad people may put malicious code in CLI hooks and backend build script.

Add --trusted flag to project-related commands (setup, config, urls, ...) to allow the CLI to run sensitive actions, such as: hooks, setup initial build.

When starting a project with an original theme, the CLI auto add --trusted to the setup command to let it run setup hooks and npm run build before initial deploy the backend.

Please let us know if there is any vulnerable or how to improve the development.

Usage

Account

Manage Sheetbase account. Sub-commands: login, logout, signup, profile, upgrade.

Options

  • subCommand: Supported sub-commands.
  • params: Command params, comma-separated.
  • --web: (login) Login using web UI.
  • --force: (login) Force login again.
  • --no-cache: (profile) Do not caching user-related info.

Login

Login to Sheetbase Cloud account. Proxy of account login

Options

  • --web: Using web UI.
  • --force: Force login again.

Logout

Logout of your Sheetbase Cloud account. Proxy of account logout

Signup

Create a Sheetbase Cloud account. Proxy of account signup

Profile

Manage Sheetbase account profile. Proxy of account profile Sub-commands: get, open, update

Options

  • subCommand: Optional supported sub-commands, default: get.
  • params: Command params, comma-separated.
  • --no-cache: Do not cache user-related info.

Google

Manage Google accounts. Sub-commands: list, connect, disconnect, default.

Options

  • subCommand: Supported sub-commands.
  • params: Command params, comma-separated.
  • --yes: (connect) Agree on account connection.
  • --creds: (connect) Save credential to .googlerc.json.
  • --full-drive: (connect) Not recommended, grant full access to Drive.
  • --default: (list) Show default account only.

Project

Project general tasks. Sub-commands: start, setup, config, urls, info, hooks.

Options

  • subCommand: Supported sub-commands.
  • params: Command params, comma-separated.
  • --no-npm: (start) Do not install packages.
  • --no-setup: (start) Do not run setup command.
  • --app: (start) Start a backend app.
  • --module: (start) Start a backend module.
  • --no-hook: (start, setup, config, urls) Do not run hook.
  • --trusted: (setup) Trusted to run sensitive actions.
  • --no-backend-deploy: (setup) Do not initial deploy the backend.

Start

Start a new project. Proxy of project start

Options

  • projectName: Name of the project, auto default.
  • theme: Theme to create the project with, default to basic_angular.
  • --no-npm: Do not install packages.
  • --no-setup: Do not run setup command.
  • --app: Start a backend app.
  • --module: Start a backend module.
  • --no-hook: Do not run setup hook.
  • --trusted: Trusted to run setup sensitive actions.
  • --no-backend-deploy: Do not initial deploy the backend.

Setup

Setup the project. Proxy of project setup

Options

  • --trusted: Trusted to run sensitive actions.
  • --no-hook: Do not run hook.
  • --no-backend-deploy: Do not initial deploy the backend.

Config

Config backend & frontend. Proxy of project config Sub-commands: list, update, import, export

Options

  • subCommand: Optional supported sub-commands, default: list.
  • params: Command params, comma-separated.
  • --no-hook: Do not run hook.

Urls

View project URLs. Proxy of project urls Sub-commands: list, open

Options

  • subCommand: Optional supported sub-commands, default: list.
  • params: Command params, comma-separated.
  • --no-hook: Do not run hook.

Info

Output project info. Proxy of project info

Hooks

Output list of hooks. Proxy of project hooks

Docs

Open the documentation.

Backend

Run backend related command.

Frontend

Run frontend related command.

Help

Display help.

Options

  • --detail: Detail help.

*

Any other command ends of running: npm run .

Development

Reference: https://sheetbase.github.io/cli

Lisence

Sheetbase CLI is released under the Apache-2.0 license.