CLI Getting Started
The Shoehorn CLI provides command-line access to the platform for browsing the catalog, managing governance actions, viewing GitOps resources, running Forge workflows, managing addons, and scripting automation.
Installation
Section titled “Installation”Install using one of the following methods:
Homebrew (macOS / Linux):
brew tap shoehorn-dev/tapbrew install shoehornMise (macOS / Linux / Windows):
# mise.toml or ~/.config/mise/config.toml[tools."github:shoehorn-dev/shoehorn-cli"]version = "latest"exe = "shoehorn"mise installGo install:
go install github.com/shoehorn-dev/shoehorn-cli/cmd/shoehorn@latestScoop (Windows):
scoop bucket add shoehorn https://github.com/shoehorn-dev/scoop-bucketscoop install shoehornBinary download:
Download the latest release from GitHub Releases and add it to your PATH.
Verify the installation:
shoehorn versionShell Completion
Section titled “Shell Completion”Set up tab-completion for your shell:
# Bashshoehorn completion bash > /etc/bash_completion.d/shoehorn
# Zshshoehorn completion zsh > "${fpath[1]}/_shoehorn"
# Fishshoehorn completion fish > ~/.config/fish/completions/shoehorn.fish
# PowerShellshoehorn completion powershell > shoehorn.ps1Authentication
Section titled “Authentication”PAT Authentication (Recommended)
Section titled “PAT Authentication (Recommended)”Authenticate with a Personal Access Token generated from the Shoehorn web UI:
shoehorn auth login --server https://shoehorn.example.com --token shp_your_tokenSecure token input (recommended for CI/CD and shared machines):
# Via environment variable (not visible in process listings)export SHOEHORN_TOKEN=shp_your_tokenshoehorn auth login --server https://shoehorn.example.com
# Via fileecho "shp_your_token" > ~/.shoehorn/tokenexport SHOEHORN_TOKEN_FILE=~/.shoehorn/tokenshoehorn auth login --server https://shoehorn.example.comSecurity note: The
--tokenflag is visible in process listings (ps aux). UseSHOEHORN_TOKENorSHOEHORN_TOKEN_FILEfor CI/CD and shared machines.
Checking Auth Status
Section titled “Checking Auth Status”shoehorn auth statusProfile: defaultServer: https://shoehorn.example.comStatus: Authenticated (PAT)Email: jane@example.comTenant: acme-corpToken: Valid (PAT, no expiry)Server: Token verified with serverLogout
Section titled “Logout”shoehorn auth logoutNote: Logout clears local credentials but does not revoke tokens server-side. If you suspect a token has been compromised, revoke it in the web UI under Settings > API Keys.
Configuration
Section titled “Configuration”The CLI configuration file supports multiple profiles:
version: "1.0"current_profile: default
profiles: default: name: Default server: https://shoehorn.example.com auth: provider_type: pat access_token: shp_xxxxxxxxxxxx user: email: jane@example.com name: Jane Smith tenant_id: acme-corp
staging: name: Staging server: https://staging.shoehorn.example.com auth: provider_type: pat access_token: shp_stg_xxxxSwitch profiles per-command:
shoehorn --profile staging get entitiesshoehorn --profile staging forge molds listQuick Start
Section titled “Quick Start”# Authenticateshoehorn auth login --server https://shoehorn.example.com --token shp_xxxx
# Check who you areshoehorn whoami
# Browse the catalogshoehorn get entitiesshoehorn search "payment"shoehorn get entity payment-service --scorecard
# Run a workflowshoehorn forge execute create-empty-github-repo \ --input name=my-service --input owner=my-org
# Governanceshoehorn governance dashboardshoehorn governance actions list
# Manage addonsshoehorn addon listshoehorn addon browseshoehorn addon install my-addon
# Validate manifestsshoehorn validate catalog-info.yamlshoehorn convert catalog-info.yaml --to shoehornAvailable Commands
Section titled “Available Commands”Catalog
Section titled “Catalog”shoehorn get entities # List all entitiesshoehorn get entities --type service # Filter by typeshoehorn get entity <id-or-slug> # Entity detailsshoehorn get entity <id> --scorecard # With scorecardshoehorn get teams # List teamsshoehorn get team <slug> # Team details + membersshoehorn get users # List usersshoehorn get user <id> # User detailsshoehorn get groups # List groupsshoehorn get group <name> # Group rolesshoehorn get molds # List Forge moldsshoehorn get mold <slug> # Mold detailsshoehorn get runs # List Forge runsshoehorn get run <id> # Run detailsshoehorn get gitops # List GitOps resourcesshoehorn get gitops --tool argocd # Filter by toolshoehorn get gitops <id> # GitOps resource detailsshoehorn get owned --by team <slug> # Entities owned by teamshoehorn get scorecard <entity-id> # Scorecard breakdownshoehorn get k8s # Kubernetes agentsshoehorn search "query" # Full-text searchshoehorn whoami # Your profileDeclarative Operations
Section titled “Declarative Operations”shoehorn apply -f service.yaml # Create or updateshoehorn apply -f catalog/ # Apply all YAML in directoryshoehorn apply -f service.yaml --dry-run # Preview changesshoehorn diff -f service.yaml # Show what apply would changeshoehorn diff -f catalog/ # Diff entire directoryWrite Operations
Section titled “Write Operations”shoehorn create entity -f service.yaml # Create from manifestshoehorn update entity my-svc -f svc.yaml # Update from manifestshoehorn delete entity my-svc # Delete (with confirmation)shoehorn delete entity my-svc --yes # Delete (skip confirmation)CI/CD Checks
Section titled “CI/CD Checks”shoehorn check scorecard my-svc --min-score 70 # Scorecard gateshoehorn check entity my-svc --has-owner # Quality gateshoehorn check entity my-svc --has-owner -o json # JSON for parsingGovernance
Section titled “Governance”shoehorn governance actions list # List all actionsshoehorn governance actions get <id> # Action detailsshoehorn governance actions create \ # Create action --entity-id "service:my-svc" \ --title "Update docs" --priority high --source-type policyshoehorn governance actions update <id> --status resolved # Updateshoehorn governance actions delete <id> --yes # Deleteshoehorn governance dashboard # Health scores and metricsForge Workflows
Section titled “Forge Workflows”shoehorn forge molds list # Available templatesshoehorn forge molds get <slug> # Template detailsshoehorn forge execute <slug> \ # Execute workflow --input key=value --input key2=value2shoehorn forge execute <slug> --dry-run # Validate without executingshoehorn forge run list # All runsshoehorn forge run get <run-id> # Run detailsAddon Management
Section titled “Addon Management”shoehorn addon list # Installed addonsshoehorn addon status <slug> # Runtime statusshoehorn addon install <slug> # Installshoehorn addon uninstall <slug> # Removeshoehorn addon enable <slug> # Enableshoehorn addon disable <slug> # Disableshoehorn addon logs <slug> # View logsshoehorn addon browse # Browse marketplaceAddon Development
Section titled “Addon Development”shoehorn addon init my-addon # Scaffold new addonshoehorn addon build # Build bundlesshoehorn addon build --dir ./my-addon # Build from specific directoryshoehorn addon dev # Dev mode with hot reloadshoehorn addon publish --dir ./my-addon # Publish to marketplaceManifest Tools
Section titled “Manifest Tools”shoehorn validate <file> # Validate Shoehorn/Backstage manifestshoehorn validate <file> --format json # JSON output for CIcat manifest.yaml | shoehorn validate - # Validate from stdinshoehorn validate mold <file> # Validate Forge mold (offline)shoehorn validate mold <file> --strict # Fail on warnings tooshoehorn convert <file> # Convert formatsshoehorn convert <file> --to backstage # To Backstage formatshoehorn convert <file> --to mold # To Shoehorn Mold (JSON)cat file.yaml | shoehorn convert - # Convert from stdinshoehorn convert ./dir -r # Recursive conversionSee the full CLI Validator reference for flag details, exit codes, and CI examples.
Global Flags
Section titled “Global Flags”| Flag | Short | Description |
|---|---|---|
--output | -o | Output format: json, yaml, or table |
--no-interactive | -I | Disable TUI, force plain text output |
--interactive | -i | Force interactive TUI mode |
--debug | Enable debug logging to stderr | |
--profile | Auth profile to use (default: default) | |
--config | Config file path (default: ~/.shoehorn/config.yaml) |
Debug Mode
Section titled “Debug Mode”Enable debug logging to see HTTP requests, response codes, and timing:
shoehorn --debug get entities# orSHOEHORN_DEBUG=1 shoehorn get entitiesDebug output goes to stderr so it won’t interfere with JSON/YAML piping:
shoehorn --debug get entities -o json 2>debug.log | jq .Script-Friendly Output
Section titled “Script-Friendly Output”Any command can be piped for automation:
shoehorn get entities -o json | jq '.[] | select(.type == "service") | .name'shoehorn get team platform-team -o json | jq '.members[].email'shoehorn whoami -o json | jq '.tenant_id'Security
Section titled “Security”Token Storage
Section titled “Token Storage”Tokens are stored in ~/.shoehorn/config.yaml with 0600 file permissions (owner-read/write only). The config file is saved atomically to prevent corruption. On POSIX systems, the CLI warns if file permissions have been loosened.
For enhanced security:
- Use
SHOEHORN_TOKENorSHOEHORN_TOKEN_FILEinstead of--tokenflag - Rotate tokens regularly via the web UI
- Use short-lived API keys with minimal scopes for CI/CD
- Ensure
~/.shoehorn/is excluded from backup/sync tools