@saltcorn/cli
v1.0.0-rc.6
Published
Command-line interface for Saltcorn, open-source no-code platform
Downloads
2,167
Readme
@saltcorn/cli
Saltcorn command line interface
Usage
$ npm install -g @saltcorn/cli
$ saltcorn COMMAND
running command...
$ saltcorn (--version)
@saltcorn/cli/1.0.0-rc.6 linux-x64 node-v18.19.0
$ saltcorn --help [COMMAND]
USAGE
$ saltcorn COMMAND
...
Commands
saltcorn add-schema
saltcorn backup
saltcorn build-app
saltcorn build-cordova-builder
saltcorn configuration-check
saltcorn configuration-check-backups FILES
saltcorn create-tenant TENANT
saltcorn create-user
saltcorn delete-tenants
saltcorn delete-user USER_EMAIL
saltcorn dev:localize-plugin PLUGIN [PATH]
saltcorn make-migration
saltcorn saltcorn dev:plugin-test -d [PATH_TO_LOCAL_PLUGIN]/statistics -f test-backup.zip
saltcorn dev:post-release [TASK]
saltcorn dev:release VERSION
saltcorn dev:test-plugin PATH
saltcorn fixtures
saltcorn get-cfg [KEY]
saltcorn info
saltcorn inspect TYPE [NAME]
saltcorn install-pack
saltcorn install-plugin
saltcorn list-tenants
saltcorn list-triggers
saltcorn list-users
saltcorn saltcorn migrate
saltcorn modify-user USER_EMAIL
saltcorn paths
saltcorn plugins
saltcorn reset-schema
saltcorn restore FILE
saltcorn rm-tenant
saltcorn run-benchmark [BASEURL]
saltcorn run-js
saltcorn run-sql
saltcorn run-tests [PACKAGE]
saltcorn run-trigger TRIGGER
saltcorn scheduler
saltcorn serve
saltcorn set-cfg [KEY] [VALUE]
saltcorn set-daily-time [MINS]
saltcorn setup
saltcorn setup-benchmark
saltcorn sync-upload-data
saltcorn take-snapshot
saltcorn transform-field EXPRESSION FIELD TABLE [TENANT]
saltcorn add-schema
Add Saltcorn schema to existing database
USAGE
$ saltcorn add-schema [-f]
FLAGS
-f, --force force command execution
DESCRIPTION
Add Saltcorn schema to existing database
See code: src/commands/add-schema.js
saltcorn backup
Backup the PostgreSQL database to a file with pg_dump or saltcorn backup zip
USAGE
$ saltcorn backup [-v] [-o <value>] [-t <value>] [-z]
FLAGS
-o, --output=<value> output filename
-t, --tenant=<value> Backup tenant in saltcorn zip format
-v, --verbose Verbose
-z, --zip Backup public in saltcorn zip format
DESCRIPTION
Backup the PostgreSQL database to a file with pg_dump or saltcorn backup zip
See code: src/commands/backup.js
saltcorn build-app
Build mobile app
USAGE
$ saltcorn build-app [--tenantAppName <value>] [-p <value>] [-e <value>] [-t <value>] [-l <value>]
[--synchedTables <value>] [--includedPlugins <value>] [-d] [-b <value>] [-c <value>] [-u <value>] [--appName
<value>] [--appId <value>] [--appVersion <value>] [--appIcon <value>] [-s <value>] [--splashPage <value>]
[--autoPublicLogin] [--allowOfflineMode] [--provisioningProfile <value>] [--buildType <value>] [--androidKeystore
<value>] [--androidKeyStoreAlias <value>] [--androidKeystorePassword <value>]
FLAGS
-b, --buildDirectory=<value> A directory where the app should be build
-c, --copyAppDirectory=<value> If set, the app file will be copied here, please set 'user email', too
-d, --useDocker Use a docker container to build the app.
-e, --entryPoint=<value> This is the first view or page (see -t) after the login.
-l, --localUserTables=<value>... user defined tables that should be replicated into the app
-p, --platforms=<value>... Platforms to build for, space separated list
-s, --serverURL=<value> URL to a saltcorn server
-t, --entryPointType=<value> Type of the entry point ('view' or 'page'). The default is 'view'.
-u, --userEmail=<value> Email of the user building the app
--allowOfflineMode Switch to offline mode when there is no internet, sync the data when a connection
is available again.
--androidKeyStoreAlias=<value> A unique name to identify the key within the keystore file.
--androidKeystore=<value> A self-signed certificate that includes the private key used to sign your app.
--androidKeystorePassword=<value> he password to access the keystore file.
--appIcon=<value> A png that will be used as launcher icon. The default is a png of a saltcorn
symbol.
--appId=<value> Id of the mobile app (default com.saltcorn.mobileapp)
--appName=<value> Name of the mobile app (default SaltcornMobileApp)
--appVersion=<value> Version of the mobile app (default 1.0.0)
--autoPublicLogin Show public entry points before the login as a public user.
--buildType=<value> debug or release build
--includedPlugins=<value>... Names of plugins that should be bundled into the app.If empty, no modules are used.
--provisioningProfile=<value> This profile will be used to sign your app
--splashPage=<value> Name of a page that should be shown while the app is loading.
--synchedTables=<value>... Table names for which the offline should be synchronized with the saltcorn server
--tenantAppName=<value> Optional name of a tenant application, if set, the app will be build for this
tenant
DESCRIPTION
Build mobile app
See code: src/commands/build-app.js
saltcorn build-cordova-builder
Build the 'saltcorn/cordova-builder' docker image
USAGE
$ saltcorn build-cordova-builder [--buildClean]
FLAGS
--buildClean run a clean build with --no-cache
DESCRIPTION
Build the 'saltcorn/cordova-builder' docker image
See code: src/commands/build-cordova-builder.js
saltcorn configuration-check
Check configuration
USAGE
$ saltcorn configuration-check [-t <value>]
FLAGS
-t, --tenant=<value> tenant
DESCRIPTION
Check configuration
See code: src/commands/configuration-check.js
saltcorn configuration-check-backups FILES
Check configuration
USAGE
$ saltcorn configuration-check-backups FILES [-d]
ARGUMENTS
FILES backup file to check. can be repeated, e.g. with *
FLAGS
-d, --destructive destructive
DESCRIPTION
Check configuration
See code: src/commands/configuration-check-backups.js
saltcorn create-tenant TENANT
Create a tenant
USAGE
$ saltcorn create-tenant TENANT [--url <value>] [-e <value>] [-d <value>]
ARGUMENTS
TENANT Tenant subdomain to create
FLAGS
-d, --description=<value> Description of tenant
-e, --email=<value> Email of owner of tenant
--url=<value> Url of tenant
DESCRIPTION
Create a tenant
See code: src/commands/create-tenant.js
saltcorn create-user
Create a new user
USAGE
$ saltcorn create-user [-a] [-t <value>] [-e <value>] [-r <value>] [-p <value>]
FLAGS
-a, --admin Admin user
-e, --email=<value> email
-p, --password=<value> password
-r, --role=<value> role
-t, --tenant=<value> tenant
DESCRIPTION
Create a new user
See code: src/commands/create-user.js
saltcorn delete-tenants
Delete inactive tenants
USAGE
$ saltcorn delete-tenants
DESCRIPTION
Delete inactive tenants
See code: src/commands/delete-tenants.js
saltcorn delete-user USER_EMAIL
Delete user.
USAGE
$ saltcorn delete-user USER_EMAIL [-f] [-t <value>]
ARGUMENTS
USER_EMAIL User to delete
FLAGS
-f, --force force command execution
-t, --tenant=<value> tenant
DESCRIPTION
Delete user.
Command deletes the user specified by USER_EMAIL.
See code: src/commands/delete-user.js
saltcorn dev:localize-plugin PLUGIN [PATH]
Convert plugin to local plugin
USAGE
$ saltcorn dev:localize-plugin PLUGIN [PATH] [-u] [-t <value>]
ARGUMENTS
PLUGIN Current plugin name
PATH Absolute path to local plugin
FLAGS
-t, --tenant=<value> tenant
-u, --unlocalize Unlocalize plugin (local to npm)
DESCRIPTION
Convert plugin to local plugin
See code: src/commands/dev/localize-plugin.js
saltcorn make-migration
Create a new blank Database structure migration file.
USAGE
$ saltcorn make-migration
DESCRIPTION
Create a new blank Database structure migration file.
These migrations update database structure.
You should not normally need to run this
unless you are a developer.
See code: src/commands/dev/make-migration.js
saltcorn saltcorn dev:plugin-test -d [PATH_TO_LOCAL_PLUGIN]/statistics -f test-backup.zip
Install a plugin, spawn 'npm run test' in the install directory and check the return code.
USAGE
$ saltcorn saltcorn dev:plugin-test -d [PATH_TO_LOCAL_PLUGIN]/statistics -f test-backup.zip
FLAGS
-d, --directory=<value> Directory of local plugin
-f, --backupFile=<value> Optional name of a backup file in the tests folder. If you ommit this, then the test has to
create its own data.
-n, --name=<value> Plugin name in store of a released plugin
--database=<value> Run on specified database. Default is 'saltcorn_test''
DESCRIPTION
Install a plugin, spawn 'npm run test' in the install directory and check the return code.
See code: src/commands/dev/plugin-test.js
saltcorn dev:post-release [TASK]
Post-release tasks: docker and vagrant builds
USAGE
$ saltcorn dev:post-release [TASK]
ARGUMENTS
TASK (docker|vagrant|all|none) What to do
DESCRIPTION
Post-release tasks: docker and vagrant builds
See code: src/commands/dev/post-release.js
saltcorn dev:release VERSION
Release a new saltcorn version
USAGE
$ saltcorn dev:release VERSION [-t <value>]
ARGUMENTS
VERSION New version number
FLAGS
-t, --tag=<value> NPM tag
DESCRIPTION
Release a new saltcorn version
See code: src/commands/dev/release.js
saltcorn dev:test-plugin PATH
Test a plugin
USAGE
$ saltcorn dev:test-plugin PATH
ARGUMENTS
PATH path to plugin package
DESCRIPTION
Test a plugin
...
Extra documentation goes here
See code: src/commands/dev/test-plugin.js
saltcorn fixtures
Load fixtures for testing
USAGE
$ saltcorn fixtures [-r] [-t <value>]
FLAGS
-r, --reset Also reset schema
-t, --tenant=<value> tenant
DESCRIPTION
Load fixtures for testing
...
This manual step it is never required for users and rarely required for developers
See code: src/commands/fixtures.js
saltcorn get-cfg [KEY]
Get a configuration value. The value is printed to stdout as a JSON value
USAGE
$ saltcorn get-cfg [KEY] [-t <value>] [-p <value>]
ARGUMENTS
KEY Configuration key
FLAGS
-p, --plugin=<value> plugin
-t, --tenant=<value> tenant
DESCRIPTION
Get a configuration value. The value is printed to stdout as a JSON value
See code: src/commands/get-cfg.js
saltcorn info
Show paths
USAGE
$ saltcorn info [-j]
FLAGS
-j, --json json format
DESCRIPTION
Show paths
...
Show configuration and file store paths
ALIASES
$ saltcorn paths
See code: src/commands/info.js
saltcorn inspect TYPE [NAME]
Inspect an entity's JSON representation, or list entities
USAGE
$ saltcorn inspect TYPE [NAME] [-t <value>]
ARGUMENTS
TYPE (view|page|trigger|table) Entity type
NAME Entity name. If not supplied, list all names
FLAGS
-t, --tenant=<value> tenant
DESCRIPTION
Inspect an entity's JSON representation, or list entities
See code: src/commands/inspect.js
saltcorn install-pack
Install a pack or restore a snapshot
USAGE
$ saltcorn install-pack [-t <value>] [-n <value>] [-f <value>]
FLAGS
-f, --file=<value> File with pack JSON
-n, --name=<value> Pack name in store
-t, --tenant=<value> tenant
DESCRIPTION
Install a pack or restore a snapshot
See code: src/commands/install-pack.js
saltcorn install-plugin
Install a plugin
USAGE
$ saltcorn install-plugin [-t <value>] [-n <value>] [-d <value>] [-u]
FLAGS
-d, --directory=<value> Directory with local plugin
-n, --name=<value> Plugin name in store
-t, --tenant=<value> tenant
-u, --unsafe Allow unsafe plugins on tenants
DESCRIPTION
Install a plugin
See code: src/commands/install-plugin.js
saltcorn list-tenants
List tenants in CSV format
USAGE
$ saltcorn list-tenants [-t <value>] [-v] [-j]
FLAGS
-j, --json json format
-t, --tenant=<value> tenant
-v, --verbose verbose output
DESCRIPTION
List tenants in CSV format
See code: src/commands/list-tenants.js
saltcorn list-triggers
List triggers
USAGE
$ saltcorn list-triggers [-t <value>] [-v] [-j]
FLAGS
-j, --json json format
-t, --tenant=<value> tenant
-v, --verbose verbose output
DESCRIPTION
List triggers
See code: src/commands/list-triggers.js
saltcorn list-users
List users
USAGE
$ saltcorn list-users [-t <value>] [-v]
FLAGS
-t, --tenant=<value> tenant
-v, --verbose verbose output
DESCRIPTION
List users
See code: src/commands/list-users.js
saltcorn saltcorn migrate
Run Database structure migrations
USAGE
$ saltcorn saltcorn migrate
DESCRIPTION
Run Database structure migrations
...
NOTE!
- Please stop Saltcorn before run DB migrations.
- Please make db backup before migration.
- There are no way to rollback migration if you doesn't make backup.
This is not normally required as migrations will be run when the server starts.
However, this command may be useful if you are running multiple application
servers and need to control when the migrations are run.
See code: src/commands/migrate.js
saltcorn modify-user USER_EMAIL
Modify (update) user.
USAGE
$ saltcorn modify-user USER_EMAIL [-a] [-t <value>] [-e <value>] [-r <value>] [-p <value>] [-i]
ARGUMENTS
USER_EMAIL User to modify
FLAGS
-a, --admin make user be Admin
-e, --email=<value> new email
-i, --imode interactive mode
-p, --password=<value> new password
-r, --role=<value> new role (can conflict with -a option)
-t, --tenant=<value> tenant
DESCRIPTION
Modify (update) user.
Command changes the user specified by USER_EMAIL.
You can change the user group, password and email.
NOTE that -a and -r role (--role=role) can give conflict.
See code: src/commands/modify-user.js
saltcorn paths
Show paths
USAGE
$ saltcorn paths [-j]
FLAGS
-j, --json json format
DESCRIPTION
Show paths
...
Show configuration and file store paths
ALIASES
$ saltcorn paths
saltcorn plugins
List and upgrade plugins for tenants
USAGE
$ saltcorn plugins [-u] [-d] [-v] [-f] [-n <value>]
FLAGS
-d, --dryRun Upgrade dry-run
-f, --force Force update
-n, --name=<value> Plugin name
-u, --upgrade Upgrade
-v, --verbose Verbose output
DESCRIPTION
List and upgrade plugins for tenants
...
Extra documentation goes here
EXAMPLES
plugins -v - verbose output of commands
plugins -u -d - dry-run for plugin update
plugins -u -f - force plugin update
See code: src/commands/plugins.js
saltcorn reset-schema
Reset the database
USAGE
$ saltcorn reset-schema [-f] [-t <value>]
FLAGS
-f, --force force command execution
-t, --tenant=<value> tenant
DESCRIPTION
Reset the database
...
This will delete all existing information
See code: src/commands/reset-schema.js
saltcorn restore FILE
Restore a previously backed up database (zip or sqlc format)
USAGE
$ saltcorn restore FILE [-t <value>]
ARGUMENTS
FILE backup file to restore
FLAGS
-t, --tenant=<value> tenant
DESCRIPTION
Restore a previously backed up database (zip or sqlc format)
See code: src/commands/restore.js
saltcorn rm-tenant
Remove a tenant.
USAGE
$ saltcorn rm-tenant -t <value> [-f]
FLAGS
-f, --force force command execution
-t, --tenant=<value> (required) tenant
DESCRIPTION
Remove a tenant.
Attention! All tenant data will be lost!
It recommended to make backup of tenant before perform this command.
See code: src/commands/rm-tenant.js
saltcorn run-benchmark [BASEURL]
Run benchmark
USAGE
$ saltcorn run-benchmark [BASEURL] [-t <value>] [-b <value>] [-d <value>]
ARGUMENTS
BASEURL Base URL
FLAGS
-b, --benchmark=<value> Which benchmark to run
-d, --delay=<value> [default: 30] delay between runs (s)
-t, --token=<value> API Token for reporting results
DESCRIPTION
Run benchmark
See code: src/commands/run-benchmark.js
saltcorn run-js
Run javascript code
USAGE
$ saltcorn run-js [-t <value>] [-c <value>] [-f <value>]
FLAGS
-c, --code=<value> js code
-f, --file=<value> path to script file
-t, --tenant=<value> tenant name
DESCRIPTION
Run javascript code
See code: src/commands/run-js.js
saltcorn run-sql
Run sql expression
USAGE
$ saltcorn run-sql [-t <value>] [-s <value>] [-f <value>]
FLAGS
-f, --file=<value> path to sql file name
-s, --sql=<value> sql statement
-t, --tenant=<value> tenant name
DESCRIPTION
Run sql expression
See code: src/commands/run-sql.js
saltcorn run-tests [PACKAGE]
Run test suites
USAGE
$ saltcorn run-tests [PACKAGE] [-c] [-l] [-v] [-d] [-t <value>] [--watch] [--watchAll] [--database <value>]
ARGUMENTS
PACKAGE which package to run tests for
FLAGS
-c, --coverage Coverage
-d, --detectOpenHandles Detect Open Handles
-l, --listTests List tests
-t, --testFilter=<value> Filter tests by suite or test name
-v, --verbose Verbose
--database=<value> Run on specified database. Default is saltcorn_test
--watch Watch files for changes and rerun tests related to changed files.
--watchAll Watch files for changes and rerun all tests.
DESCRIPTION
Run test suites
See code: src/commands/run-tests.js
saltcorn run-trigger TRIGGER
Run a trigger
USAGE
$ saltcorn run-trigger TRIGGER [-t <value>]
ARGUMENTS
TRIGGER trigger name
FLAGS
-t, --tenant=<value> tenant
DESCRIPTION
Run a trigger
See code: src/commands/run-trigger.js
saltcorn scheduler
Run the Saltcorn scheduler
USAGE
$ saltcorn scheduler [-v]
FLAGS
-v, --verbose Verbose
DESCRIPTION
Run the Saltcorn scheduler
See code: src/commands/scheduler.js
saltcorn serve
Start the Saltcorn server
USAGE
$ saltcorn serve [-p <value>] [-v] [-r] [-d] [-a] [-n] [-s] [--subdomain_offset <value>]
FLAGS
-a, --addschema Add schema if missing
-d, --dev Run in dev mode and re-start on file changes
-n, --nomigrate No migrations
-p, --port=<value> [default: 3000] port
-r, --watchReaper Watch reaper
-s, --noscheduler No scheduler
-v, --verbose Verbose
--subdomain_offset=<value> Number of parts to remove to access subdomain in 'multi_tenant' mode
DESCRIPTION
Start the Saltcorn server
See code: src/commands/serve.js
saltcorn set-cfg [KEY] [VALUE]
Set a configuration value. The supplied value (argument, or file stdin) will be parsed as JSON. If this fails, it is stored as a string.
USAGE
$ saltcorn set-cfg [KEY] [VALUE] [-t <value>] [-p <value>] [-f <value>] [-i]
ARGUMENTS
KEY Configuration key
VALUE Configuration value (JSON or string)
FLAGS
-f, --file=<value> file
-i, --stdin read value from stdin
-p, --plugin=<value> plugin
-t, --tenant=<value> tenant
DESCRIPTION
Set a configuration value. The supplied value (argument, or file stdin) will be parsed as JSON. If this fails, it is
stored as a string.
See code: src/commands/set-cfg.js
saltcorn set-daily-time [MINS]
Set the time the default daily event will run, offset in minutes from the current time. Restart required.
USAGE
$ saltcorn set-daily-time [MINS] [-t <value>]
ARGUMENTS
MINS Number of minutes in the futute (negative for past)
FLAGS
-t, --tenant=<value> tenant
DESCRIPTION
Set the time the default daily event will run, offset in minutes from the current time. Restart required.
See code: src/commands/set-daily-time.js
saltcorn setup
Set up a new system
USAGE
$ saltcorn setup [-c]
FLAGS
-c, --coverage Coverage
DESCRIPTION
Set up a new system
...
This will attempt to install or connect a database, and set up a
configuration file
See code: src/commands/setup.js
saltcorn setup-benchmark
Setup an instance for benchmarking
USAGE
$ saltcorn setup-benchmark [-t <value>] [-n <value>]
FLAGS
-n, --name=<value> name
-t, --tenant=<value> tenant
DESCRIPTION
Setup an instance for benchmarking
See code: src/commands/setup-benchmark.js
saltcorn sync-upload-data
Runs a sync for data supplied by the mobile app
USAGE
$ saltcorn sync-upload-data [--tenantAppName <value>] [--userEmail <value>] [--directory <value>] [--syncTimestamp
<value>]
FLAGS
--directory=<value> directory name for input output data
--syncTimestamp=<value> new timestamp for the sync_info rows
--tenantAppName=<value> Optional name of a tenant application
--userEmail=<value> email of the user running the sync
DESCRIPTION
Runs a sync for data supplied by the mobile app
See code: src/commands/sync-upload-data.js
saltcorn take-snapshot
Print a current snapshout to stdout
USAGE
$ saltcorn take-snapshot [-t <value>] [-f]
FLAGS
-f, --fresh fresh
-t, --tenant=<value> tenant
DESCRIPTION
Print a current snapshout to stdout
See code: src/commands/take-snapshot.js
saltcorn transform-field EXPRESSION FIELD TABLE [TENANT]
transform an existing field by applying a calculated expression
USAGE
$ saltcorn transform-field EXPRESSION FIELD TABLE [TENANT]
ARGUMENTS
EXPRESSION expression to calculate field
FIELD field name
TABLE table name
TENANT tenant name
DESCRIPTION
transform an existing field by applying a calculated expression
See code: src/commands/transform-field.js