Skip to content

CLI Reference

The Skaha CLI provides a comprehensive command-line interface for interacting with the Science Platform. This reference covers all available commands and their options.

Getting Started

The CLI can be accessed using the skaha command in your uv environment:

Bash
uv run skaha --help

Main Command

Bash
skaha [OPTIONS] COMMAND [ARGS]...

Description: Command Line Interface for Science Platform.

Global Options

Option Description
--install-completion Install completion for the current shell
--show-completion Show completion for the current shell, to copy it or customize the installation
--help Show help message and exit

Shell Completion

Enable shell completion for a better CLI experience by running:

Bash
skaha --install-completion


🔐 Authentication Commands

skaha auth

Authenticate with Science Platform.

skaha auth login

Login to Science Platform with automatic server discovery.

Bash
skaha auth login [OPTIONS]

Description: This command guides you through the authentication process, automatically discovering the upstream server and choosing the appropriate authentication method based on the server's configuration.

Options
Option Type Default Description
--force Flag - Force re-authentication
--debug Flag - Enable debug logging
--dead Flag - Include dead servers in discovery
--dev Flag - Include dev servers in discovery
--details Flag - Include server details in discovery
--discovery-url, -d TEXT https://ska-iam.stfc.ac.uk/.well-known/openid-configuration OIDC Discovery URL

Basic Login

Bash
skaha auth login

Login with Debug Information

Bash
skaha auth login --debug --details

skaha auth list / skaha auth ls

Show all available authentication contexts.

Bash
skaha auth list [OPTIONS]

Example

Bash
skaha auth list

skaha auth switch / skaha auth use

Switch the active authentication context.

Bash
skaha auth switch CONTEXT

Arguments: - CONTEXT (required): The name of the context to activate

Example

Bash
skaha auth switch production

skaha auth remove / skaha auth rm

Remove a specific authentication context.

Bash
skaha auth remove CONTEXT

Arguments: - CONTEXT (required): The name of the context to remove

Permanent Action

This action permanently removes the authentication context and cannot be undone.

skaha auth purge

Remove all authentication contexts.

Bash
skaha auth purge [OPTIONS]
Options
Option Description
--yes, -y Skip confirmation prompt

Destructive Action

This command removes ALL authentication contexts. Use with caution!


🚀 Session Management Commands

skaha create

Create a new session on the Science Platform.

Bash
skaha create [OPTIONS] KIND IMAGE [-- CMD [ARGS]...]

Arguments: - KIND (required): Session type - one of: desktop, notebook, carta, headless, firefly - IMAGE (required): Container image to use - CMD [ARGS]... (optional): Runtime command and arguments

Options

Option Short Type Default Description
--name -n TEXT Auto-generated Name of the session
--cpu -c INTEGER 1 Number of CPU cores
--memory -m INTEGER 2 Amount of RAM in GB
--gpu -g INTEGER None Number of GPUs
--env -e TEXT None Environment variables (e.g., --env KEY=VALUE)
--replicas -r INTEGER 1 Number of replicas to create
--debug - Flag - Enable debug logging
--dry-run - Flag - Perform a dry run without creating the session

Create a Jupyter Notebook

Bash
skaha create --cpu 4 -m 8notebook skaha/scipy-notebook:latest

Create a Headless Session with Custom Command

Bash
uv run skaha create headless skaha/terminal:1.1.2 -- env

skaha ps

Show running sessions.

Bash
skaha ps [OPTIONS]

Options

Option Short Type Description
--all -a Flag Show all sessions (default shows just running)
--quiet -q Flag Only show session IDs
--kind -k Choice Filter by session kind: desktop, notebook, carta, headless, firefly
--status -s Choice Filter by status: Pending, Running, Terminating, Succeeded, Error
--debug - Flag Enable debug logging

List All Sessions

Bash
skaha ps --all

List Only Notebook Sessions

Bash
skaha ps --kind notebook

skaha events

Show session events for debugging and monitoring.

Bash
skaha events [OPTIONS] SESSION_IDS...

Arguments: - SESSION_IDS... (required): One or more session IDs

Options

Option Description
--debug Enable debug logging

Example

Bash
skaha events abc123 def456

skaha info

Show detailed information about sessions.

Bash
skaha info [OPTIONS] SESSION_IDS...

Arguments: - SESSION_IDS... (required): One or more session IDs

Options

Option Description
--debug Enable debug logging

Example

Bash
skaha info abc123

skaha open

Open sessions in a web browser.

Bash
skaha open [OPTIONS] SESSION_IDS...

Arguments: - SESSION_IDS... (required): One or more session IDs

Options

Option Description
--debug Enable debug logging

Browser Integration

This command automatically opens the session URLs in your default web browser.

Example

Bash
skaha open abc123 def456

skaha logs

Show session logs for troubleshooting.

Bash
skaha logs [OPTIONS] SESSION_IDS...

Arguments: - SESSION_IDS... (required): One or more session IDs

Options

Option Description
--debug Enable debug logging

Example

Bash
skaha logs abc123

skaha delete

Delete one or more sessions.

Bash
skaha delete [OPTIONS] SESSION_IDS...

Arguments: - SESSION_IDS... (required): One or more session IDs to delete

Options

Option Short Description
--force -f Force deletion without confirmation
--debug - Enable debug logging

Permanent Action

Deleted sessions cannot be recovered. Use --force to skip confirmation prompts.

Delete with Confirmation

Bash
skaha delete abc123

Force Delete Multiple Sessions

Bash
skaha delete abc123 def456 --force

skaha prune

Prune sessions by criteria for bulk cleanup.

Bash
skaha prune [OPTIONS] NAME [KIND] [STATUS]

Arguments: - NAME (required): Prefix to match session names - KIND (optional): Session kind - default: headless - STATUS (optional): Session status - default: Succeeded

Options

Option Short Description
--debug - Enable debug logging
--help -h Show help message and exit

Prune Completed Headless Sessions

Bash
skaha prune "test-" headless Running

Bulk Cleanup

Use prune to clean up multiple sessions that match specific criteria, especially useful for automated workflows.


📊 Cluster Information Commands

skaha stats

Show cluster statistics and resource usage.

Bash
skaha stats [OPTIONS]

Options

Option Description
--debug Enable debug logging

Example

Bash
skaha stats

Resource Monitoring

This command provides insights into cluster resource usage, helping you understand available capacity.


⚙️ Client Configuration Commands

skaha config

Manage client configuration settings.

skaha config show / skaha config list / skaha config ls

Display the current configuration.

Bash
skaha config show [OPTIONS]

Example

Bash
skaha config ls

skaha config path

Display the path to the configuration file.

Bash
skaha config path [OPTIONS]

Example

Bash
skaha config path

Configuration Location

Use this command to find where your configuration file is stored for manual editing if needed.

skaha version

View client version and system information.

Bash
skaha version [OPTIONS]

Options

Option Default Description
--debug / --no-debug --no-debug Show detailed information for bug reports

Basic Version Info

Bash
skaha version

Detailed Debug Information

Bash
skaha version --debug