diff --git a/packages/prime/README.md b/packages/prime/README.md index 92f62513..ba92e431 100644 --- a/packages/prime/README.md +++ b/packages/prime/README.md @@ -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: diff --git a/packages/prime/src/prime_cli/main.py b/packages/prime/src/prime_cli/main.py index 58e7d325..a3acaf7d 100644 --- a/packages/prime/src/prime_cli/main.py +++ b/packages/prime/src/prime_cli/main.py @@ -1,3 +1,4 @@ +import os import sys from typing import Optional @@ -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(): @@ -72,9 +71,10 @@ 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]" @@ -82,6 +82,18 @@ def callback( 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"""