Skip to main content

p6m CLI

The p6m CLI provides cross-platform conveniences for local development, including repository management, context switching between organizations, and SSO configuration.

p6m CLI GitHub

Installation

A Windows Installer is available on the p6m CLI GitHub Releases page. The installer will be named like p6m-vX.X.X-windows-x86_64-installer.exe.

Download and run the installer:

  1. Download the installer from the releases page
  2. Run the installer
warning

Windows may view this installer as coming from an "Untrusted Source". You will need to override the exceptions to allow the installation.

The installer automatically adds p6m to your Path environment variable. Restart your terminal to see the changes.

info

The Windows x86_64 installer works on both x86_64 and arm64 architectures.

Install From Source (All Platforms)

If you have Rust installed, you can build from source on any platform:

git clone git@github.com:p6m-dev/p6m-cli.git
cd p6m-cli
cargo install --path .

Verify Installation

p6m --version

Post Configuration

Some commands rely on environment variables being set in your shell.

Artifactory Access

For Artifactory-related commands (p6m context), set these environment variables:

export ARTIFACTORY_USERNAME="your.email@company.com"
export ARTIFACTORY_IDENTITY_TOKEN="your-identity-token" # Generate in Artifactory "Edit Settings"

GitHub Access

For GitHub-related commands (p6m repos), set this environment variable:

export GITHUB_TOKEN="your-github-token"  # Generate a classic Personal Access Token

Add these to your shell profile (~/.zshrc, ~/.bashrc, or Windows Environment Variables) to persist them.


Commands

Managing Repositories

Pull all repositories from organizations you have access to:

p6m repos pull                    # All repos from all organizations
p6m repos pull --org p6m-example # Repos from a specific organization
p6m repos pull --new # Only pull new repos, skip existing
note

Run from ~/orgs or outside it for all organizations. Run from within an organization directory to pull only that organization's repos.

Changing Contexts

When switching between organizations, update local configuration (like ~/.m2/settings.xml) to work with that organization:

p6m context                       # From within an organization in ~/orgs
p6m context --org p6m-example # From anywhere

Looking up Resources

Quickly open external resources in your browser:

# GitHub
p6m open github # or: p6m open gh

# Artifactory
p6m open artifactory # or: p6m open af

# ArgoCD
p6m open argocd # or: p6m open argo, p6m open acd

Purging Local Caches

p6m purge ide-files              # Remove IDE files recursively (allows IDE reset)
p6m purge maven {groupId} # Remove Java artifacts for a groupId prefix
# Example: p6m purge maven p6m.platform

Automatic SSO Configuration

Configure AWS SSO profiles and Kubernetes cluster credentials automatically:

p6m sso           # Runs both aws and azure subcommands
p6m sso aws # Updates ~/.aws/config and ~/.kube/config for EKS clusters
p6m sso azure # Updates ~/.kube/config for AKS clusters
Prerequisites