Skip to content

The Prime Intellect CLI provides a powerful command-line interface for managing GPU resources across various providers

License

Notifications You must be signed in to change notification settings

PrimeIntellect-ai/prime-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

83 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Prime Intellect


Prime Intellect CLI


PyPI version Python versions Downloads

Command line interface for managing Prime Intellect resources and environments.

πŸš€ Quick Start

# Install uv (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh

# Install prime with uv
uv tool install prime

# Authenticate 
prime login 

# List available GPU resources
prime availability list

πŸ”§ Features

  • GPU Resource Management: Query and filter available GPU resources
  • Pod Management: Create, monitor, and terminate compute pods
  • SSH Access: Direct SSH access to running pods
  • Team Support: Manage resources across team environments

πŸ“¦ Installation

Recommended: Using uv

# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh

# Install prime
uv tool install prime

Alternative: Using pip

# If you prefer traditional pip
pip install prime

For Development

# Clone the repository
git clone https://github.com/PrimeIntellect-ai/prime-cli
cd prime-cli

# Create virtual environment with uv
uv venv

# Install in development mode with all dependencies
uv pip install -e ".[dev]"

# Set up pre-commit hooks
pre-commit install

πŸ› οΈ Usage

Configuration

API Key Setup (Multiple Options)

# Option 1: Interactive mode (recommended - hides input)
prime config set-api-key

# Option 2: Non-interactive mode (for automation)
prime config set-api-key YOUR_API_KEY

# Option 3: Environment variable (most secure for scripts)
export PRIME_API_KEY="your-api-key-here"

Other Configuration

# Configure SSH key for pod access
prime config set-ssh-key-path

# Set base URL (interactive or non-interactive)
prime config set-base-url
prime config set-base-url https://api.primeintellect.ai

# Set frontend URL (interactive or non-interactive)  
prime config set-frontend-url
prime config set-frontend-url https://app.primeintellect.ai

# View current configuration
prime config view

Security Note: When using the non-interactive mode, be aware that the API key may be visible in your shell history. For enhanced security:

  • Use the interactive mode (no arguments) which hides your input
  • Use environment variables (PRIME_API_KEY) as fallback if no CLI config is set
  • Clear your shell history after setting sensitive values

Configuration Priority: CLI config takes precedence over environment variables. If you set an API key via prime auth login, it will override any PRIME_API_KEY environment variable.

Environment Management

# Save current config as an environment (includes API key)
prime config save develop

# Switch between environments
prime config use production
prime config use develop

# List available environments
prime config envs

GPU Resources

# List all available GPUs
prime availability list

# Filter by GPU type
prime availability list --gpu-type H100_80GB

# Show available GPU types
prime availability gpu-types

Pod Management

# List your pods
prime pods list

# Create a pod
prime pods create
prime pods create --id <ID>     # With specific GPU config
prime pods create --name my-pod # With custom name

# Monitor and manage pods
prime pods status <pod-id>
prime pods terminate <pod-id>
prime pods ssh <pod-id>

Team Management

# Set team context
prime config set-team-id

Working Without uv

While we recommend using uv for the best experience, all commands work with standard pip:

# Install without uv
pip install prime

# Development setup without uv
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

Note: Without uv, operations will be slower and you'll need to manage virtual environments manually.

πŸ” Security Best Practices

API Key Management

  1. Never commit API keys to version control
  2. Use environment variables for automation:
    export PRIME_API_KEY="your-api-key-here"
    prime pods list  # Will use the environment variable
  3. Use interactive mode for one-time setup:
    prime config set-api-key  # Prompts securely without showing input
  4. For CI/CD pipelines, use secrets management:
    • GitHub Actions: Use repository secrets
    • GitLab CI: Use CI/CD variables
    • Jenkins: Use credentials plugin

Secure Storage

  • API keys are stored in ~/.prime/config.json with user-only permissions
  • Environment variables take precedence over stored configuration
  • Consider using a password manager for long-term API key storage

πŸ’» Development

Prerequisites

  • Python 3.11+
  • uv (recommended): curl -LsSf https://astral.sh/uv/install.sh | sh

Setup

# Clone and setup with uv
git clone https://github.com/PrimeIntellect-ai/prime-cli
cd prime-cli
uv venv
uv pip install -e ".[dev]"

# Run code quality checks
uv run ruff format src/prime_cli
uv run ruff check src/prime_cli
uv run mypy src/prime_cli
uv run pytest

Code Quality

# Format code
uv run ruff format src/prime_cli

# Run linter
uv run ruff check src/prime_cli

# Run tests
uv run pytest

# Or if you have the venv activated:
ruff format src/prime_cli
ruff check src/prime_cli
pytest

Release Process

We use semantic versioning. Releases are automatically created when changes are merged to main.

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Set up development environment with uv:
    uv venv
    uv pip install -e ".[dev]"
    pre-commit install
  4. Set up your development environment:
    # Save your local development config
    prime config set-base-url http://localhost:8000
    prime config set-frontend-url http://localhost:3000
    prime config save local
    
    # Switch between environments as needed
    prime config use local       # For development
    prime config use production  # For testing against prod
  5. Run code quality checks:
    uv run ruff format .
    uv run ruff check .
    uv run pytest
  6. Commit your changes (git commit -m 'Add amazing feature')
  7. Push to the branch (git push origin feature/amazing-feature)
  8. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ”— Links

About

The Prime Intellect CLI provides a powerful command-line interface for managing GPU resources across various providers

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 8

Languages