BentoML CLI And BentoCloud
Use this sub-skill when the user needs a safe command plan or troubleshooting path for BentoML CLI and BentoCloud. Treat credentialed cloud commands as user-run operations unless the user explicitly asks you to execute them in an authenticated environment.
Safe Operating Rules
- Prefer local, non-mutating checks first:
bentoml --help, bentoml <command> --help, config-file linting, and command construction.
- Never print, store, or request raw API token values.
bentoml api-token create shows the token once; tell the user to save it securely outside the transcript.
- Ask before running credentialed or mutating cloud operations such as
bentoml cloud login, bentoml deploy, bentoml deployment update/apply/start/terminate/delete, bentoml secret create/apply/delete, bentoml api-token create/delete, bentoml push, and bentoml pull.
- Classify destructive operations clearly:
deployment delete is irreversible, deployment terminate stops billing-capable workloads but can be restarted, and secret delete/api-token delete can break deployments or automation.
- Do not put secrets in command lines when avoidable. Use environment variables, files managed by the user, or BentoCloud secrets, and redact values in outputs.
Workflow Routing
- For CLI command discovery and safe local checks, use
references/cli-catalog.md and scripts/inspect_bentoml_cli.py.
- For BentoCloud login, context, deployment, codespace, secret, API-token, push/pull, and CI/CD command plans, use
references/bentocloud-workflows.md.
- For errors such as not logged in, wrong context/cluster, missing tokens/secrets, invalid deployment config, wait timeout, quota, auth failures, or destructive-operation risk, use
references/troubleshooting.md.
- For deployment YAML/JSON review before a cloud call, run
scripts/deployment_config_lint.py locally.
Common Command Plans
Inspect CLI Without Cloud Access
python skills/bentoml/sub-skills/cli-and-cloud/scripts/inspect_bentoml_cli.py --commands "cloud" "deployment" "deploy" "secret" "api-token"
This helper only imports the local CLI and renders Click help through CliRunner; it does not log in or contact BentoCloud.
Login And Verify Context
bentoml cloud login
bentoml cloud current-context
bentoml cloud list-context
Use bentoml cloud login --api-token "$BENTOCLOUD_API_TOKEN" only in user-controlled shells or CI logs with secret masking. The CLI also accepts BENTO_CLOUD_API_ENDPOINT and BENTO_CLOUD_API_KEY environment variables.
Deploy From A Project Directory
bentoml deploy . -n my-deployment --cluster my-cluster --scaling-min 0 --scaling-max 3 --wait --timeout 3600
If configuration is complex or there are multiple services, prefer a YAML/JSON config and lint it first:
python skills/bentoml/sub-skills/cli-and-cloud/scripts/deployment_config_lint.py config-file.yaml
bentoml deploy -f config-file.yaml
Manage A Deployment
bentoml deployment list --cluster my-cluster
bentoml deployment get my-deployment --cluster my-cluster -o yaml
bentoml deployment update my-deployment --cluster my-cluster --scaling-min 1 --scaling-max 5
bentoml deployment apply my-deployment --cluster my-cluster -f deployment.yaml
bentoml deployment terminate my-deployment --cluster my-cluster --wait
Use update for patch-only changes. Use apply when the config should become the desired full state; it can reset or remove unspecified fields.
Cross-References
- CLI command catalog:
references/cli-catalog.md
- BentoCloud workflows:
references/bentocloud-workflows.md
- Troubleshooting guide:
references/troubleshooting.md
- Local CLI help inspector:
scripts/inspect_bentoml_cli.py
- Local deployment config linter:
scripts/deployment_config_lint.py
1---2name: cli-and-cloud3description: "Use BentoML CLI command families and BentoCloud workflows safely:4 login/context, deploy/deployment lifecycle, codespaces, secrets, API tokens,5 push/pull, and cloud troubleshooting. Use when a task asks for bentoml6 terminal commands or BentoCloud operations rather than Python service7 authoring, local serving/client calls, container builds, or observability8 setup."9disable-model-invocation: true10metadata:11 source: https://skillmd.com/skills/vectorspacelab/cli-and-cloud12 disco-role: operating13license: Apache 2.014---1516# BentoML CLI And BentoCloud1718Use this sub-skill when the user needs a safe command plan or troubleshooting path for BentoML CLI and BentoCloud. Treat credentialed cloud commands as user-run operations unless the user explicitly asks you to execute them in an authenticated environment.1920## Safe Operating Rules2122- Prefer local, non-mutating checks first: `bentoml --help`, `bentoml <command> --help`, config-file linting, and command construction.23- Never print, store, or request raw API token values. `bentoml api-token create` shows the token once; tell the user to save it securely outside the transcript.24- Ask before running credentialed or mutating cloud operations such as `bentoml cloud login`, `bentoml deploy`, `bentoml deployment update/apply/start/terminate/delete`, `bentoml secret create/apply/delete`, `bentoml api-token create/delete`, `bentoml push`, and `bentoml pull`.25- Classify destructive operations clearly: `deployment delete` is irreversible, `deployment terminate` stops billing-capable workloads but can be restarted, and `secret delete`/`api-token delete` can break deployments or automation.26- Do not put secrets in command lines when avoidable. Use environment variables, files managed by the user, or BentoCloud secrets, and redact values in outputs.2728## Workflow Routing2930- For CLI command discovery and safe local checks, use `references/cli-catalog.md` and `scripts/inspect_bentoml_cli.py`.31- For BentoCloud login, context, deployment, codespace, secret, API-token, push/pull, and CI/CD command plans, use `references/bentocloud-workflows.md`.32- For errors such as not logged in, wrong context/cluster, missing tokens/secrets, invalid deployment config, wait timeout, quota, auth failures, or destructive-operation risk, use `references/troubleshooting.md`.33- For deployment YAML/JSON review before a cloud call, run `scripts/deployment_config_lint.py` locally.3435## Common Command Plans3637### Inspect CLI Without Cloud Access3839```bash40python skills/bentoml/sub-skills/cli-and-cloud/scripts/inspect_bentoml_cli.py --commands "cloud" "deployment" "deploy" "secret" "api-token"41```4243This helper only imports the local CLI and renders Click help through `CliRunner`; it does not log in or contact BentoCloud.4445### Login And Verify Context4647```bash48bentoml cloud login49bentoml cloud current-context50bentoml cloud list-context51```5253Use `bentoml cloud login --api-token "$BENTOCLOUD_API_TOKEN"` only in user-controlled shells or CI logs with secret masking. The CLI also accepts `BENTO_CLOUD_API_ENDPOINT` and `BENTO_CLOUD_API_KEY` environment variables.5455### Deploy From A Project Directory5657```bash58bentoml deploy . -n my-deployment --cluster my-cluster --scaling-min 0 --scaling-max 3 --wait --timeout 360059```6061If configuration is complex or there are multiple services, prefer a YAML/JSON config and lint it first:6263```bash64python skills/bentoml/sub-skills/cli-and-cloud/scripts/deployment_config_lint.py config-file.yaml65bentoml deploy -f config-file.yaml66```6768### Manage A Deployment6970```bash71bentoml deployment list --cluster my-cluster72bentoml deployment get my-deployment --cluster my-cluster -o yaml73bentoml deployment update my-deployment --cluster my-cluster --scaling-min 1 --scaling-max 574bentoml deployment apply my-deployment --cluster my-cluster -f deployment.yaml75bentoml deployment terminate my-deployment --cluster my-cluster --wait76```7778Use `update` for patch-only changes. Use `apply` when the config should become the desired full state; it can reset or remove unspecified fields.7980## Cross-References8182- CLI command catalog: `references/cli-catalog.md`83- BentoCloud workflows: `references/bentocloud-workflows.md`84- Troubleshooting guide: `references/troubleshooting.md`85- Local CLI help inspector: `scripts/inspect_bentoml_cli.py`86- Local deployment config linter: `scripts/deployment_config_lint.py`