Skip to main content

CLI tool for connecting to Polaris containers via terminal

Project description

Polaris Terminal

A command-line tool for connecting to Polaris containers via terminal.

Installation

From Source

# Clone the repository
git clone https://github.com/polaris/polaris-terminal.git
cd polaris-terminal

# Install the package
pip install -e .

Using pip

pip install polaris-terminal

Using Installer Script

# Download and run the installer
python install_polaris_terminal.py

Initial Setup

After installation, you must configure your miner ID:

# Set your miner ID (required for security reasons)
polaris config --miner-id YOUR_MINER_ID

Usage

List Available Containers

To list containers, you must either specify a container or configure your miner ID:

# List all containers for your miner ID (after configuring)
polaris list

# List containers for a specific container (safer, no miner ID required)
polaris list --container polaris-pod-1743999981-pod-1

Show Container Details

View detailed information about a container. You can use either the container name or pod ID:

polaris info polaris-pod-1743999981-pod-1

Or using just the pod ID:

polaris info pod-1

Or using the timestamp part of the container name:

polaris info 1743999981-pod-1

Connect to a Container

Connect to a container terminal. Multiple formats are supported:

# Using full container name
polaris connect polaris-pod-1743999981-pod-1

# Using pod ID
polaris connect pod-1

# Using timestamp part
polaris connect 1743999981-pod-1

Configure Default Settings

View current configuration:

polaris config --show

Set default server URL:

polaris config --server-url https://polaris-test-server.onrender.com

Set your miner ID (required for security):

polaris config --miner-id YOUR_MINER_ID

Specify Server URL for a Single Command

polaris connect polaris-pod-1743999981-pod-1 --server-url https://polaris-test-server.onrender.com

Show Verbose Output

For detailed diagnostic information:

polaris connect polaris-pod-1743999981-pod-1 --verbose

Features

  • Privacy-Focused: Only access your own containers by using your miner ID
  • Smart Container Name Handling: Works with full container names, pod IDs, or partial names
  • Automatic Miner ID Detection: Automatically detects the correct miner ID for each container
  • WebSocket Terminal: Connect to container terminals via WebSocket
  • Detailed Container Information: View complete details about containers
  • Configuration Management: Persistent configuration stored in JSON file
  • Cross-Platform: Works on Windows, Linux, and macOS
  • Robust Error Handling: Helpful error messages and diagnostics

Container Name Formats

The tool intelligently handles different formats for container identification:

  • Full Container Name: polaris-pod-1743999981-pod-1
  • Pod ID: pod-1
  • Timestamp Format: 1743999981-pod-1

All these formats will be automatically detected and handled correctly.

Security

For security and privacy reasons:

  • You must configure your own miner ID to list all containers
  • When connecting to a specific container, the tool will automatically detect the correct miner ID
  • No hardcoded miner IDs are included in the package

Configuration

The tool stores its configuration in ~/.polaris/config.json. You can edit this file directly or use the polaris config command to update settings.

Default configuration:

{
  "server_url": "https://polaris-test-server.onrender.com",
  "miner_id": "EXAMPLE-MINER-ID-REPLACE-THIS"
}

Troubleshooting

If you encounter connection issues:

  1. Check your server URL with polaris config --show
  2. Ensure you've set your miner ID with polaris config --miner-id YOUR_MINER_ID
  3. Try using the pod ID directly with polaris connect pod-1
  4. Use the --verbose flag for detailed diagnostics
  5. Try accessing the web terminal directly in your browser at https://polaris-test-server.onrender.com/api/v1/containers/{container_name}/terminal

Requirements

  • Python 3.7 or higher
  • requests library
  • websockets library

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

polaris_terminal-0.1.1.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

polaris_terminal-0.1.1-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file polaris_terminal-0.1.1.tar.gz.

File metadata

  • Download URL: polaris_terminal-0.1.1.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.0

File hashes

Hashes for polaris_terminal-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9d937f9b397117ae8d7db74a69bc8f9259d9005d960b701ea3ff1bd5f88e2372
MD5 1abdd4d19eabc00c9d33f160d7246a80
BLAKE2b-256 c09294e1b4d9dd33356684d0cc964a4729c7847d29ff193b5da0f8bb094244b8

See more details on using hashes here.

File details

Details for the file polaris_terminal-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for polaris_terminal-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5db69bb7723a9becee4b245148929a872436c1279210ddb9286dbc2a0c114981
MD5 7632640e40e67b84f6a57ec988f43a15
BLAKE2b-256 25c3b87af4a32ccd82dbcc2e5c61bf28482421aab597f1f9f9edb3acc00fd2a8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page