Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/prime/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,15 @@ prime config set-ssh-key-path ~/.ssh/id_rsa.pub
prime config view
```

### Environment Variables

| Variable | Description |
|----------|-------------|
| `PRIME_API_KEY` | API key for authentication |
| `PRIME_TEAM_ID` | Team ID to use for all operations |
| `PRIME_DISABLE_VERSION_CHECK` | Set to `1` to disable update notifications |
| `PRIME_DISABLE_TEAM_NOTICE` | Set to `1` to disable the team account notice |

## Python SDK

Prime also provides a Python SDK for programmatic access:
Expand Down
18 changes: 15 additions & 3 deletions packages/prime/src/prime_cli/main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import sys
from typing import Optional

Expand Down Expand Up @@ -56,8 +57,6 @@ def callback(
raise typer.Exit()

if context:
import os

config = Config()
# Check if the context exists
if context.lower() != "production" and context not in config.list_environments():
Expand All @@ -72,16 +71,29 @@ def callback(

# Check for updates (only when a subcommand is being executed)
if ctx.invoked_subcommand is not None:
console = Console(stderr=True, force_terminal=sys.stderr.isatty())

update_available, latest = check_for_update()
if update_available and latest:
console = Console(stderr=True, force_terminal=sys.stderr.isatty())
console.print(
f"[yellow]A new version of prime is available: {latest} "
f"(installed: {__version__})[/yellow]"
)
console.print("[dim]Run: uv pip install --upgrade prime or uv tool upgrade prime[/dim]")
console.print("[dim]Set PRIME_DISABLE_VERSION_CHECK=1 to disable this check[/dim]\n")

config = Config()
if config.team_id and os.environ.get("PRIME_DISABLE_TEAM_NOTICE", "").lower() not in (
"1",
"true",
"yes",
):
team_display = (
config.team_id if config.team_id_from_env else (config.team_name or config.team_id)
)
suffix = " (from env var)" if config.team_id_from_env else ""
console.print(f"[dim]Using team account: {team_display}{suffix}[/dim]\n")


def run() -> None:
"""Entry point for the CLI"""
Expand Down