CLI Reference
The ServerlessInsight command-line tool is named si. Install it with:
npm install -g @geek-fun/serverlessinsight
si --versionCommand Overview
| Command | Description |
|---|---|
si login | Authenticate with the ServerlessInsight Console (obtain API Key) |
si logout | Revoke and clear local credentials |
si whoami | Show current login status |
si show | Show deployed resources from state |
si validate | Validate the serverlessinsight.yml config |
si plan | Generate and show the deployment plan (Aliyun, Tencent only) |
si deploy | Deploy the config to a cloud provider |
si destroy | Destroy the deployed stack |
si local | Run the app locally for debugging (Aliyun only) |
si force-unlock <lockId> | Manually remove a stuck deployment lock |
There is no
initcommand. You create the project andserverlessinsight.ymlyourself; see Getting Started.
Common Options
These options are available across commands (see each command for specifics):
| Option | Description |
|---|---|
-f, --file <path> | Path to the YAML config file |
-s, --stage <stage> | Target stage; local defaults to default |
-r, --region <region> | Region, overrides config and env vars |
-v, --provider <provider> | Cloud provider, overrides config |
-k, --accessKeyId <id> | AccessKeyId, overrides env vars |
-x, --accessKeySecret <secret> | AccessKeySecret, overrides env vars |
-n, --securityToken <token> | Temporary token, overrides env vars |
CLI options take priority over environment variables and the YAML config. Region resolution: SI_REGION > ALIYUN_REGION > provider.region (default cn-hangzhou).
Command Details
si login
si login [--si-api-key <key>]Authenticate with the ServerlessInsight Console, used for the managed SAAS state backend. You can log in with an existing API Key. SI_API_KEY can also be supplied via deploy --si-api-key.
si logout
si logoutClear locally stored credentials.
si whoami
si whoamiShow the current login status.
si show
si show -f serverlessinsight.yml -s devRead and display resources from the deployment state.
si validate
si validate -f serverlessinsight.yml -s devValidate config syntax and semantics (including provider-specific runtime and resource checks).
si plan
si plan -s devGenerate a deployment plan. Note: plan is supported only on Aliyun and Tencent; it errors on Volcengine.
si deploy
si deploy -s dev
si deploy -s dev -y
si deploy -s dev -p memory=1024
si deploy -s dev --si-api-key $SI_API_KEY| Option | Description |
|---|---|
--si-api-key <key> | ServerlessInsight API Key (overrides SI_API_KEY) |
-y, --auto-approve | Skip interactive approval and deploy |
-p, --parameter <key=value> | Override a parameter (repeatable) |
In non-interactive environments (no TTY) you must pass -y, otherwise it errors.
si destroy
si destroy -s devDestroy the stack in the given stage.
si local
si local -s dev
si local -s dev --debug| Option | Description |
|---|---|
-d, --debug | Enable debug mode |
-w, --watch | File watch mode (on by default, cannot be disabled) |
Serves a local HTTP endpoint on port 4567; Aliyun functions only.
si force-unlock
si force-unlock <lockId> -f serverlessinsight.ymlManually remove a stuck deployment lock. Refuses to run against the SAAS state backend. Use with caution.
Environment Variables
- Cloud provider credentials: see "Regions and credentials" in the Configuration Reference
SI_API_KEY: Console API Key (managed state backend)SI_REGION/ALIYUN_REGION: default regionDEBUG: print error stack traces when set
Related Docs
- Getting Started: install and config model primer
- Configuration Reference: all resources, fields, and valid values