p6m CLI
The p6m CLI provides cross-platform conveniences for local development, including repository management, context switching between organizations, and SSO configuration.
Installation
- Windows
- macOS
- Linux
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:
- Download the installer from the releases page
- Run the installer
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.
The Windows x86_64 installer works on both x86_64 and arm64 architectures.
Using Homebrew (recommended):
# Add the p6m tap
brew tap p6m-dev/tap
# Install p6m
brew install p6m
Alternative: Pre-compiled binary
Download the appropriate binary for your architecture from the GitHub Releases page and place it on your PATH.
Using pre-compiled binaries:
Download the appropriate binary for your architecture from the GitHub Releases page:
# Extract and install
tar -xzf p6m-vX.X.X-linux-x86_64.tar.gz
sudo mv p6m /usr/local/bin/
sudo chmod +x /usr/local/bin/p6m
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
- Windows
- macOS
- Linux
p6m --version
p6m --version
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
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
Related
- p6m CLI GitHub Repository - Source code and releases