Saltcorn command line interface
$ npm install -g @saltcorn/cli
$ saltcorn COMMAND
running command...
$ saltcorn (-v|--version|version)
@saltcorn/cli/0.9.5-beta.17 linux-x64 node-v18.7.0
$ saltcorn --help [COMMAND]
USAGE
$ saltcorn COMMAND
...
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 help [COMMAND]
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 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 setup
saltcorn setup-benchmark
saltcorn sync-upload-data
saltcorn take-snapshot
saltcorn transform-field EXPRESSION FIELD TABLE [TENANT]
Add Saltcorn schema to existing database
USAGE
$ saltcorn add-schema
OPTIONS
-f, --force force command execution
See code: src/commands/add-schema.js
Backup the PostgreSQL database to a file with pg_dump or saltcorn backup zip
USAGE
$ saltcorn backup
OPTIONS
-o, --output=output output filename
-t, --tenant=tenant Backup tenant in saltcorn zip format
-v, --verbose Verbose
-z, --zip Backup public in saltcorn zip format
See code: src/commands/backup.js
Build mobile app
USAGE
$ saltcorn build-app
OPTIONS
-b, --buildDirectory=buildDirectory A directory where the app should be build
-c, --copyAppDirectory=copyAppDirectory 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=entryPoint This is the first view or page (see -t) after the login.
-l, --localUserTables=localUserTables user defined tables that should be replicated into the app
-p, --platforms=platforms Platforms to build for, space separated list
-s, --serverURL=serverURL URL to a saltcorn server
-t, --entryPointType=entryPointType Type of the entry point ('view' or 'page'). The default is 'view'.
-u, --userEmail=userEmail 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.
--appIcon=appIcon A png that will be used as launcher icon. The default is a png of a saltcorn
symbol.
--appName=appName Name of the mobile app (default SaltcornMobileApp)
--appVersion=appVersion Version of the mobile app (default 1.0.0)
--autoPublicLogin Show public entry points before the login as a public user.
--buildForEmulator build without '--device', generates no .ipa file so that iOS apps can be
build without developer accounts
--includedPlugins=includedPlugins Names of plugins that should be bundled into the app.If empty, no modules are
used.
--splashPage=splashPage Name of a page that should be shown while the app is loading.
--synchedTables=synchedTables Table names for which the offline should be synchronized with the saltcorn
server
--tenantAppName=tenantAppName Optional name of a tenant application, if set, the app will be build for this
tenant
See code: src/commands/build-app.js
Build the 'saltcorn/cordova-builder' docker image
USAGE
$ saltcorn build-cordova-builder
OPTIONS
--buildClean run a clean build with --no-cache
See code: src/commands/build-cordova-builder.js
Check configuration
USAGE
$ saltcorn configuration-check
OPTIONS
-t, --tenant=tenant tenant
See code: src/commands/configuration-check.js
Check configuration
USAGE
$ saltcorn configuration-check-backups FILES
ARGUMENTS
FILES backup file to check. can be repeated, e.g. with *
OPTIONS
-d, --destructive destructive
See code: src/commands/configuration-check-backups.js
Create a tenant
USAGE
$ saltcorn create-tenant TENANT
ARGUMENTS
TENANT Tenant subdomain to create
OPTIONS
-d, --description=description Description of tenant
-e, --email=email Email of owner of tenant
--url=url Url of tenant
See code: src/commands/create-tenant.js
Create a new user
USAGE
$ saltcorn create-user
OPTIONS
-a, --admin Admin user
-e, --email=email email
-p, --password=password password
-r, --role=role role
-t, --tenant=tenant tenant
See code: src/commands/create-user.js
Delete inactive tenants
USAGE
$ saltcorn delete-tenants
See code: src/commands/delete-tenants.js
Delete user.
USAGE
$ saltcorn delete-user USER_EMAIL
ARGUMENTS
USER_EMAIL User to delete
OPTIONS
-f, --force force command execution
-t, --tenant=tenant tenant
DESCRIPTION
Command deletes the user specified by USER_EMAIL.
See code: src/commands/delete-user.js
Convert plugin to local plugin
USAGE
$ saltcorn dev:localize-plugin PLUGIN [PATH]
ARGUMENTS
PLUGIN Current plugin name
PATH Absolute path to local plugin
OPTIONS
-t, --tenant=tenant tenant
-u, --unlocalize Unlocalize plugin (local to npm)
See code: src/commands/dev/localize-plugin.js
Create a new blank Database structure migration file.
USAGE
$ saltcorn make-migration
DESCRIPTION
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
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
OPTIONS
-d, --directory=directory Directory of local plugin
-f, --backupFile=backupFile 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=name Plugin name in store of a released plugin
--database=database Run on specified database. Default is 'saltcorn_test''
See code: src/commands/dev/plugin-test.js
Post-release tasks: docker and vagrant builds
USAGE
$ saltcorn dev:post-release [TASK]
ARGUMENTS
TASK (docker|vagrant|all|none) What to do
See code: src/commands/dev/post-release.js
Release a new saltcorn version
USAGE
$ saltcorn dev:release VERSION
ARGUMENTS
VERSION New version number
OPTIONS
-t, --tag=tag NPM tag
See code: src/commands/dev/release.js
Test a plugin
USAGE
$ saltcorn dev:test-plugin PATH
ARGUMENTS
PATH path to plugin package
DESCRIPTION
...
Extra documentation goes here
See code: src/commands/dev/test-plugin.js
Load fixtures for testing
USAGE
$ saltcorn fixtures
OPTIONS
-r, --reset Also reset schema
-t, --tenant=tenant tenant
DESCRIPTION
...
This manual step it is never required for users and rarely required for developers
See code: src/commands/fixtures.js
Get a configuration value. The value is printed to stdout as a JSON value
USAGE
$ saltcorn get-cfg [KEY]
ARGUMENTS
KEY Configuration key
OPTIONS
-p, --plugin=plugin plugin
-t, --tenant=tenant tenant
See code: src/commands/get-cfg.js
display help for saltcorn
USAGE
$ saltcorn help [COMMAND]
ARGUMENTS
COMMAND command to show help for
OPTIONS
--all see all commands in CLI
See code: @oclif/plugin-help
Show paths
USAGE
$ saltcorn info
OPTIONS
-j, --json json format
DESCRIPTION
...
Show configuration and file store paths
ALIASES
$ saltcorn paths
See code: src/commands/info.js
Inspect an entity's JSON representation, or list entities
USAGE
$ saltcorn inspect TYPE [NAME]
ARGUMENTS
TYPE (view|page|trigger|table) Entity type
NAME Entity name. If not supplied, list all names
OPTIONS
-t, --tenant=tenant tenant
See code: src/commands/inspect.js
Install a pack or restore a snapshot
USAGE
$ saltcorn install-pack
OPTIONS
-f, --file=file File with pack JSON
-n, --name=name Pack name in store
-t, --tenant=tenant tenant
See code: src/commands/install-pack.js
Install a plugin
USAGE
$ saltcorn install-plugin
OPTIONS
-d, --directory=directory Directory with local plugin
-n, --name=name Plugin name in store
-t, --tenant=tenant tenant
See code: src/commands/install-plugin.js
List tenants in CSV format
USAGE
$ saltcorn list-tenants
OPTIONS
-j, --json json format
-t, --tenant=tenant tenant
-v, --verbose verbose output
See code: src/commands/list-tenants.js
List triggers
USAGE
$ saltcorn list-triggers
OPTIONS
-j, --json json format
-t, --tenant=tenant tenant
-v, --verbose verbose output
See code: src/commands/list-triggers.js
List users
USAGE
$ saltcorn list-users
OPTIONS
-t, --tenant=tenant tenant
-v, --verbose verbose output
See code: src/commands/list-users.js
Run Database structure migrations
USAGE
$ saltcorn saltcorn migrate
DESCRIPTION
...
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
Modify (update) user.
USAGE
$ saltcorn modify-user USER_EMAIL
ARGUMENTS
USER_EMAIL User to modify
OPTIONS
-a, --admin make user be Admin
-e, --email=email new email
-i, --imode interactive mode
-p, --password=password new password
-r, --role=role new role (can conflict with -a option)
-t, --tenant=tenant tenant
DESCRIPTION
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
List and upgrade plugins for tenants
USAGE
$ saltcorn plugins
OPTIONS
-d, --dryRun Upgrade dry-run
-f, --force Force update
-n, --name=name Plugin name
-u, --upgrade Upgrade
-v, --verbose Verbose output
DESCRIPTION
...
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
Reset the database
USAGE
$ saltcorn reset-schema
OPTIONS
-f, --force force command execution
-t, --tenant=tenant tenant
DESCRIPTION
...
This will delete all existing information
See code: src/commands/reset-schema.js
Restore a previously backed up database (zip or sqlc format)
USAGE
$ saltcorn restore FILE
ARGUMENTS
FILE backup file to restore
OPTIONS
-t, --tenant=tenant tenant
See code: src/commands/restore.js
Remove a tenant.
USAGE
$ saltcorn rm-tenant
OPTIONS
-f, --force force command execution
-t, --tenant=tenant (required) tenant
DESCRIPTION
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
Run benchmark
USAGE
$ saltcorn run-benchmark [BASEURL]
ARGUMENTS
BASEURL Base URL
OPTIONS
-b, --benchmark=benchmark Which benchmark to run
-d, --delay=delay [default: 30] delay between runs (s)
-t, --token=token API Token for reporting results
See code: src/commands/run-benchmark.js
Run javascript code
USAGE
$ saltcorn run-js
OPTIONS
-c, --code=code js code
-f, --file=file path to script file
-t, --tenant=tenant tenant name
See code: src/commands/run-js.js
Run sql expression
USAGE
$ saltcorn run-sql
OPTIONS
-f, --file=file path to sql file name
-s, --sql=sql sql statement
-t, --tenant=tenant tenant name
See code: src/commands/run-sql.js
Run test suites
USAGE
$ saltcorn run-tests [PACKAGE]
ARGUMENTS
PACKAGE which package to run tests for
OPTIONS
-c, --coverage Coverage
-d, --detectOpenHandles Detect Open Handles
-l, --listTests List tests
-t, --testFilter=testFilter Filter tests by suite or test name
-v, --verbose Verbose
--database=database 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.
See code: src/commands/run-tests.js
Run a trigger
USAGE
$ saltcorn run-trigger TRIGGER
ARGUMENTS
TRIGGER trigger name
OPTIONS
-t, --tenant=tenant tenant
See code: src/commands/run-trigger.js
Run the Saltcorn scheduler
USAGE
$ saltcorn scheduler
OPTIONS
-v, --verbose Verbose
See code: src/commands/scheduler.js
Start the Saltcorn server
USAGE
$ saltcorn serve
OPTIONS
-a, --addschema Add schema if missing
-d, --dev Run in dev mode and re-start on file changes
-n, --nomigrate No migrations
-p, --port=port [default: 3000] port
-r, --watchReaper Watch reaper
-s, --noscheduler No scheduler
-v, --verbose Verbose
--subdomain_offset=subdomain_offset Number of parts to remove to access subdomain in 'multi_tenant' mode
See code: src/commands/serve.js
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]
ARGUMENTS
KEY Configuration key
VALUE Configuration value (JSON or string)
OPTIONS
-f, --file=file file
-i, --stdin read value from stdin
-p, --plugin=plugin plugin
-t, --tenant=tenant tenant
See code: src/commands/set-cfg.js
Set up a new system
USAGE
$ saltcorn setup
OPTIONS
-c, --coverage Coverage
DESCRIPTION
...
This will attempt to install or connect a database, and set up a
configuration file
See code: src/commands/setup.js
Setup an instance for benchmarking
USAGE
$ saltcorn setup-benchmark
OPTIONS
-t, --tenant=tenant tenant
See code: src/commands/setup-benchmark.js
Runs a sync for data supplied by the mobile app
USAGE
$ saltcorn sync-upload-data
OPTIONS
--directory=directory directory name for input output data
--syncTimestamp=syncTimestamp new timestamp for the sync_info rows
--tenantAppName=tenantAppName Optional name of a tenant application
--userEmail=userEmail email of the user running the sync
See code: src/commands/sync-upload-data.js
Print a current snapshout to stdout
USAGE
$ saltcorn take-snapshot
OPTIONS
-f, --fresh fresh
-t, --tenant=tenant tenant
See code: src/commands/take-snapshot.js
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
See code: src/commands/transform-field.js