CLI Guide
The Python and TypeScript packages install the same sstudio command surface.
Use the CLI for interactive operations, shell automation, and CI jobs; use an
SDK when application code needs typed objects, callbacks, or custom transport
control.
Install
# npm
npm install --global sstudio
# pip
python -m pip install sstudio
Install one package, not both. Each package provides the sstudio executable.
The unpinned commands install the latest stable package; this guide and
msp-operations 0.4.1 were verified with sstudio 0.0.6.
Login
export SSTUDIO_PLATFORM__API_ENDPOINT="https://your-host.example"
export SSTUDIO_PLATFORM__API_KEY="your-api-key"
sstudio login \
--api-key "$SSTUDIO_PLATFORM__API_KEY" \
--base-url "$SSTUDIO_PLATFORM__API_ENDPOINT"
sstudio whoami
The CLI stores the API key, short-lived bearer token, and Base URL in
~/.sstudio/credentials.json. It creates the configuration directory with
mode 0700 and the file with mode 0600; sstudio logout removes the saved
credentials. Run login yourself. An Agent must not execute login or read,
print, or modify the credentials file. Do not copy it into a project,
container image, prompt, log, or support bundle.
An environment origin, a /msp-console URL, and an explicit /msp-api URL are
all accepted and resolve to the same API base path.
| Command | Purpose | Request | Response |
|---|---|---|---|
sstudio login | Validate an API key and save the resulting session. This is a user-run command, not an Agent operation. | --api-key and --base-url; values can also come from the documented environment variables. | Current identity on success; a non-zero exit status and error text on failure. |
sstudio logout | Remove the saved session from the local configuration directory. | No request body. | Confirmation that the local session was removed. |
sstudio whoami | Read the identity associated with the active session. | No request body. | Current identity fields. |
sstudio config show | Inspect effective local configuration without exposing credentials. | No request body. | Base URL and other non-secret effective settings; secret values are redacted. |
sstudio config validate | Validate required local model configuration and enabled modules. | No request body. | Validation result; exits non-zero when required configuration is missing. |
Choose an Output Format
sstudio models list --page 1 --page-size 20
sstudio --format json deployments list --page 1 --page-size 20
sstudio --format yaml jobs get --id "your-job-id"
Use table for interactive work and json or yaml for scripts. Commands return a non-zero exit status on errors.
| Format | Standard output | Intended use |
|---|---|---|
table | Human-readable key/value output. | Terminal inspection. |
json | Valid JSON with no progress text mixed into stdout. | Scripts, CI, and integrations. |
yaml | The same result encoded as YAML. | Configuration-oriented workflows. |
Upload progress is written to standard error so --format json remains safe
to parse.
Pass Request Bodies
Commands that create or update resources accept inline JSON, @file.json, or - for standard input.
sstudio deployments preview --body @deployment.json
sstudio deployments create --body @deployment.json
sstudio deployments wait --id 42
Preview resource requirements before creating a workload.
Upload Files
sstudio my-models upload \
--path ./model \
--name example-model \
--model-type LLM
sstudio datasets upload \
--file ./train.jsonl \
--name example-dataset \
--type training \
--training-category sft-llm
The upload commands perform the complete upload workflow. Do not call internal upload-session endpoints directly.
Verify the Result
Use the corresponding get, list, or wait command and verify the final state in Console.
CLI and SDK Parity
| Surface | Relationship |
|---|---|
| 86 single-request operations | One CLI command maps to each Python and TypeScript SDK business method. |
| 4 end-to-end workflows | my-models upload, datasets upload, deployments preview, and deployments create map to the same SDK workflows. |
| 5 waiters | The five CLI wait commands map to the five SDK wait helpers. |
| Authentication and local config | CLI-native login, logout, whoami, and config commands replace application-managed client setup. |
| Low-level transport | SDK-only request, raw response, token, and cleanup methods are intentionally not exposed as shell commands. |
The public business surface is therefore aligned across Python, TypeScript, and CLI without exposing transport internals as user-facing commands.
Complete Command Reference
Open the CLI Command Reference for all 100 commands,
grouped by resource domain with their purpose, accepted input, and output.
Use sstudio <group> <command> --help to confirm flags for the installed
version.
CLI output follows the same contract as the SDK:
tablerenders resource fields for interactive use.jsonprints valid JSON without presentation text and is the stable choice for automation.yamlprints the same data as YAML.- Errors are written to standard error and return a non-zero exit status. API failures include labeled
code,errorCode,message, anddetailstext when the server provides them;--format jsonapplies only to successful output.
Troubleshooting
- Run
sstudio --helporsstudio <group> --helpfor available commands and required options. - Parse JSON only after a zero exit status. On failure, retain stderr as text;
--format jsondoes not make the error machine-readable JSON. - Do not automatically retry create commands after an unknown transport result; first query by the resource name or idempotency token.
Next Step
Open the CLI Command Reference, or use the API Map to compare the matching Python and TypeScript method.