PRE-RELEASE: Sandbox commands are not GA yet. Their arguments, flags, and output may change.
sandbox preview token create.
list
--limit.
Options
TEXT
Filter JSON output with a jq expression; implies —output json (or jsonl for streamed commands)
INTEGER
default:"1000"
Most previews to list. 0 lists all.
TEXT
required
Name of the sandbox.
TEXT
default:"text"
Output formatOne of:
text, json, jsonl, noneTEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Team name or ID the sandbox belongs to. Defaults to your only team; required if you belong to more than one. Run ‘baseten org team list’ to see teams.
BOOL
Enable verbose logging
Examples
List a sandbox’s previewsFilter output with --jq
Print every preview’s URL
Output
Text mode (--output text): Table with columns: NAME, PORT, PUBLIC, STATUS, URL, EXPIRES. Prints “No previews found.” to stderr when the list is empty, and a note to stderr when --limit left some out.
JSON mode (--output json): payload type cmd.SandboxPreviewList.
describe
--show-secrets is passed.
Options
TEXT
Filter JSON output with a jq expression; implies —output json (or jsonl for streamed commands)
TEXT
required
Name of the sandbox.
TEXT
default:"text"
Output formatOne of:
text, json, jsonl, noneTEXT
required
Name of the preview.
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
BOOL
Reveal request header values. Requires the workspace administrator role; other callers still see masked values.
TEXT
Team name or ID the sandbox belongs to. Defaults to your only team; required if you belong to more than one. Run ‘baseten org team list’ to see teams.
BOOL
Enable verbose logging
Examples
Describe a previewFilter output with --jq
Print the preview’s URL
Output
Text mode (--output text): One field per line describing the preview. Empty fields are left out.
JSON mode (--output json): payload type managementapi.SandboxPreview.
create
--public is passed. Port 80 and the sandbox’s reserved system ports are rejected, and port 443 must stay private.
Options
TEXT
Delete the preview at this time. ISO 8601, local when no timezone is given. Cannot be combined with —ttl.
BOOL
Return the existing preview with this name, unchanged, instead of failing.
TEXT
Filter JSON output with a jq expression; implies —output json (or jsonl for streamed commands)
TEXT
required
Name of the sandbox.
TEXT
default:"text"
Output formatOne of:
text, json, jsonl, noneINTEGER
required
Sandbox port to expose.
TEXT
Name of the preview, unique within the sandbox. The server generates one when omitted.
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
BOOL
Make the URL reachable without a token.
TEXT (repeatable)
Header added to every request forwarded to the sandbox, such as an Authorization header the app expects, as KEY=VALUE. Masked when read back. Repeatable.
TEXT (repeatable)
Header added to every response the preview serves, such as a CORS header, as KEY=VALUE. Repeatable.
TEXT
Team name or ID the sandbox belongs to. Defaults to your only team; required if you belong to more than one. Run ‘baseten org team list’ to see teams.
TEXT
Delete the preview this long from now, such as 24h or 7d. Cannot be combined with —expires-at.
BOOL
Enable verbose logging
Examples
Expose port 3000 publicly for a dayFilter output with --jq
Create a preview and print its URL
Output
Text mode (--output text): One field per line describing the preview. Empty fields are left out.
JSON mode (--output json): payload type managementapi.SandboxPreview.
update
--ttl or --expires-at replaces any previous expiration.
Options
TEXT
Delete the preview at this time. ISO 8601, local when no timezone is given. Cannot be combined with —ttl.
TEXT
Filter JSON output with a jq expression; implies —output json (or jsonl for streamed commands)
TEXT
required
Name of the sandbox.
TEXT
default:"text"
Output formatOne of:
text, json, jsonl, noneTEXT
required
Name of the preview.
BOOL
Require a token to reach the URL. Cannot be combined with —public.
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
BOOL
Make the URL reachable without a token. Cannot be combined with —private.
TEXT (repeatable)
Header added to every request forwarded to the sandbox, as KEY=VALUE, replacing all of the preview’s request headers. Repeatable.
TEXT (repeatable)
Header added to every response the preview serves, as KEY=VALUE, replacing all of the preview’s response headers. Repeatable.
TEXT
Team name or ID the sandbox belongs to. Defaults to your only team; required if you belong to more than one. Run ‘baseten org team list’ to see teams.
TEXT
Delete the preview this long from now, such as 24h or 7d. Cannot be combined with —expires-at.
BOOL
Enable verbose logging
Examples
Make a preview privateFilter output with --jq
Make a preview public and print whether it is
Output
Text mode (--output text): One field per line describing the preview. Empty fields are left out.
JSON mode (--output json): payload type managementapi.SandboxPreview.
delete
Options
TEXT
Filter JSON output with a jq expression; implies —output json (or jsonl for streamed commands)
TEXT
required
Name of the sandbox.
TEXT
default:"text"
Output formatOne of:
text, json, jsonl, noneTEXT
required
Name of the preview.
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Team name or ID the sandbox belongs to. Defaults to your only team; required if you belong to more than one. Run ‘baseten org team list’ to see teams.
BOOL
Skip the interactive confirmation prompt. Required when stdin is not a terminal.
BOOL
Enable verbose logging
Examples
Delete a preview without the confirmation promptFilter output with --jq
Delete a preview and print its status
Output
Text mode (--output text): A confirmation line on stderr.
JSON mode (--output json): payload type managementapi.SandboxPreview.
The preview’s record as of deletion.