Skip to content

Interactive terminal

Run skyportalai with no arguments to open the interactive terminal. It keeps one chat with SARA open, asks you about each action that needs approval, and lets you pick hosts, Kubernetes namespaces and files to share.

skyportalai login   # once, see the overview
skyportalai         # or: skyportalai start

The prompt shows your connection state, the open chat, the selected servers and, for clusters, the selected namespaces.

Changed in 0.2.0

The separate skyportal command is gone. Everything it did now lives in skyportalai. See Upgrading to 0.3.

Slash commands

Command What it does
/help List the commands
/login [--no-browser] Sign in through the browser
/token Open the API key page and paste a key at a hidden prompt. Don't type the key after the command: it would end up in your history
/logout Delete the saved credential and clear the chat and scope
/status Show the connection, approval mode, chat, servers, namespaces, workflow state and pending approvals
/permission, /permission ask, /permission autoapprove Show or change your account's approval mode. See Approvals and safety
/new Start a new chat
/resume [CHAT_ID] [--verbose] Reopen a chat. With no ID, reopens the last one. --verbose also prints the earlier messages
/servers List your servers and clusters
/server NAME [NAME ...] Choose the hosts for the chat. /server auto clears the choice
/namespace ... Choose the Kubernetes namespaces SARA may use (see below)
/upload PATH [PATH ...] Attach files to the chat (see below)
/github-token set [OWNER/REPO], /github-token status, /github-token remove Manage the GitHub token SARA uses to clone private repositories
/clear Clear the screen
/about Show information about the CLI
/exit, /quit Leave the terminal

Choose hosts

/server gpu-01
/server gpu-01 gpu-02 gpu-03
/server auto
  • Names are not case sensitive. A numeric server ID also works. Separate several names with spaces or commas.
  • With several servers, SARA can run one command on all of them with a single approval. The first one is the default. See One command across many hosts.
  • /server auto clears the selection, and SARA asks for a host when it needs one.

Choose Kubernetes namespaces

When you select a cluster, the terminal lists its namespaces and asks you to pick some. SARA only works in the namespaces you choose, and the terminal won't send a message while a selected cluster has none.

/namespace ml-serving
/namespace ml-serving monitoring
/namespace add batch-jobs
/namespace remove monitoring
/namespace all
/namespace clear
  • all gives SARA the whole cluster. add and remove change the current list.
  • With more than one cluster selected, name the cluster: /namespace ml-serving --cluster prod-gke. Without --cluster, all and clear apply to every selected cluster.
  • Unknown namespace names are refused.

Attach files

/upload /var/log/train.log
/upload ./metrics.csv ./config.yaml
  • Start the chat first, then upload. The files are attached to the open chat.
  • Logs, CSV, JSON, YAML and images are accepted, up to 10 MB each. Empty files are refused.
  • You can also drag files into the terminal. A line that holds only absolute paths, or file:// URLs, of existing files is treated as an upload. A relative path is sent as plain text.
  • SkyPortal redacts secrets in text files before it stores them. Images are not scanned. See Security.

Approvals

When SARA wants to run a command or a plan, the terminal shows it and asks:

Approve this action? [y/N]:

Anything other than y or yes rejects it.

If your account's approval mode is autoapprove (/permission autoapprove), the terminal approves commands and plans for you without asking. Read Approvals and safety before you turn it on. An agent token request always asks, whatever the mode.

Stop and come back

  • Ctrl-C while SARA is working stops the turn on the server. The chat stays open; type to continue.
  • Ctrl-D or /exit leaves the terminal.
  • /resume reopens the last chat later, and /resume 42 --verbose reopens chat 42 with its earlier messages.

Connect a private cluster

When SARA creates an agent token for a cluster, the terminal (0.3.1 and later) can install it for you without showing it. It shows your current kubectl context and asks before it creates the skyportalai-agent-token Secret. See In-cluster agent.

Other settings

  • The terminal uses the API target saved in ~/.skyportalai/config.yaml, not --base-url or the URL environment variables. See Which API target is used.
  • SKYPORTALAI_NO_ANIMATION=1 turns off the start-up animation. SKYPORTALAI_ANIMATION_SPEED changes its speed.
  • When your plan's prompt limit is reached, the terminal shows a "Prompt limit reached" panel with a link to billing.