CLI Commands
Below is a list of available CLI commands. You can always get the most current list of commands using the CLI. Just run:
# See all commands
$ 8base --help
# Detail specific command
$ 8base [COMMAND_NAME] --help
Commands
When running CLI commands, certain option flags are always available. Currently, they are:
OPTIONS:
--debug,-dTurn on debug logs--help,-hShow help descriptions
deploy
Deploys project in current directory to 8base using 8base.yml config file. To use this command, you must be in the root directory of your 8base project.
$ 8base deploy [OPTIONS]
OPTIONS:
--debug, -dTurn on debug logs [boolean]--help, -hShow help [boolean]--plugins, -pThe list of plugins to deploy [array]--functions, -fThe list of functions to deploy [array]--mode, -mThe deploy mode [string][choices: "FULL", "ONLY_PLUGINS", "ONLY_PROJECT", "FUNCTIONS"] [default: "ONLY_PROJECT"]
describe
Describes your 8base project’s functions and their types through 8base.yml file, as well as retrieve your workspace endpoint.
$ 8base describe [OPTIONS]
init
Initializes a new project with suggested directory structure, example custom functions, and allows the user to select and existing 8base workspace or create a new one.
$ 8base init [PROJECT_NAME]
OPTIONS:
--functions,-fList of functions - type: array, default: 'resolver:resolver', 'task:task', 'webhook:webhook', 'trigger:trigger']--empty,-eSkip examples - type: boolean, default: false--mocks,-xIncluded mocks dir and files - type:boolean, default: true--syntax,-sSyntax for the generated file - type: string, default: 'ts', allowed: 'js', 'ts'--silentDisable printing extra info to the console - type: boolean, default: false
generate
Generate projects, functions, and some client side resources
$ 8base generate [RESOURCE_NAME] [OPTIONS]
Generators deserve a section of their own! Check it out here.
invoke
Invokes a custom function in the production workspace.
$ 8base invoke [FUNCTION NAME] [OPTIONS]
OPTIONS:
--data-json,-jInput JSON - type: string--data-path,-pPath to input - type: path--mock,-mName of the mock file - type: string
invoke-local
Invokes the custom function in the local development workspace.
$ 8base invoke-local [FUNCTION NAME] [OPTIONS]
OPTIONS:
--data-json,-jInput JSON - type: string--data-path,-pPath to input - type: path--mock,-mName of the mock file - type: string
login
Authenticates the command line user by letting them log into an 8base account.
$ 8base login [OPTIONS]
OPTIONS:
-e,--emailUser email - type: string-p,--passwordUser password - type: string-t,--tokenAn 8base API token (intended from use when Authenticate CI/CD scripts) - type: string
EXAMPLES:
8base login8base login -e my@email.com -p S3cretP@ssw0rd8base login -t <8BASE_API_TOKEN>
logout
Clears local login credentials and invalidates API session.
$ 8base logout
logs
View a specific functions production logs.
$ 8base logs [FUNCTION NAME] [OPTIONS]
OPTIONS:
-n,--numNumber of lines to display - type: sting, default: 10, max: 100-t,--tailContinually stream logs - type: boolean
package
Package 8base application without deploying it.
$ 8base package [OPTIONS]
version
Output 8base CLI version.
$ 8base version
configure
When run in a directory containing an 8base.yml file, this command generates a .workspace.json file that maps the local project to a selected workspace.
$ 8base configure [OPTIONS]
OPTIONS:
-w,--workspaceset current workspace
export
Export current - or specified - workspace data schema to a local file
$ 8base export [OPTIONS]
OPTIONS:
-f,--fileDestination file-w,--workspaceCustom workspace id
import
Import 8base schema file and data to the current - or specified - workspace.
8base import OPTIONS
OPTIONS:
-f,--filePath to file with schema - type: string, required: true--schemaImport schema only - type: boolean, default: true--dataImport data only - type: boolean, default: true-w,--workspaceSpecify workspace id - type: string