Transform your terminal experience with organized bash functions, aliases, and a powerful plugin system.
This project is maintained by randyoyarzabal
Complete guide to using Chief’s core features, commands, and workflows.
-n
first to understand what will be affected.Chief provides a comprehensive, multi-layered help system to help you discover and use commands effectively.
chief.help
- Comprehensive HelpThe main help system with categorized, searchable documentation:
chief.help # Full help with banner and categories
chief.help commands # Core Chief commands reference
chief.help plugins # Plugin management and available commands
chief.help config # Configuration options and current settings
chief.help --compact # Quick command reference
chief.help --search <term> # Search for commands containing term
Features:
chief.hints
- Quick TipsCompact workflow tips and essential command reference:
chief.hints # Quick tips and workflow hints
chief.hints --banner # Show tips with Chief banner
Perfect for:
Every Chief command has detailed help documentation:
chief.config -? # Help for any command
chief.plugin -? # Detailed usage and examples
chief.whereis -? # Function-specific documentation
Multiple ways to explore available commands:
Method | Purpose | Example |
---|---|---|
chief.[tab][tab] |
Bash completion | See all available commands |
chief.help --search git |
Search commands | Find git-related functions |
chief.help plugins |
Plugin commands | See what plugins provide |
chief.whereis <name> |
Find definitions | Locate where functions are defined |
# Create your first plugin
chief.plugin mytools
# List all plugins
chief.plugin -?
# Find where a function is defined
chief.whereis my_function
# Reload all plugins after changes
chief.reload
# View current configuration
chief.config_show
# Set configuration options
chief.config_set PROMPT true
chief.config_set EDITOR "code"
# Customize prompt hostname (environment variable)
export CHIEF_HOST="my-server" # Override hostname in prompt
# Interactive configuration editor
chief.config
# Update configuration with new features
chief.config_update
# Find any function, alias, or variable
chief.whereis git_status
# Edit your bash profile with auto-reload
chief.bash_profile
# Edit your bashrc with auto-reload
chief.bashrc
# Quick command exploration
chief.[tab][tab]
Before: Functions scattered across multiple files
# Hard to find, no organization
function deploy() { ... }
function backup() { ... }
function cleanup() { ... }
After: Clean plugin-based organization
# ~/chief_plugins/devops_chief-plugin.sh
function devops.deploy() { ... }
function devops.backup() { ... }
function devops.cleanup() { ... }
# Create project-specific environments
chief.plugin myproject
# Auto-reload configurations when files change
chief.bash_profile # Edit and auto-reloads
# Find any function or command instantly
chief.whereis deploy # Shows all deploy functions across plugins
# Set up remote plugin sync
chief.config
# Set CHIEF_CFG_PLUGINS_TYPE="remote"
# Set CHIEF_CFG_PLUGINS_GIT_REPO="git@github.com:youruser/bash-plugins.git"
# Now your plugins sync across all your machines!
# Create your first plugin
chief.plugin mytools
# List all plugins
chief.plugin -?
# Find where a function is defined
chief.whereis my_function
# Interactive configuration (opens in your editor)
chief.config
# Quick config changes
chief.config_set PROMPT true
chief.config_set MULTILINE_PROMPT true
# Git-aware prompts (when enabled)
# Shows: user@host:~/project (main*) $
# SSH key auto-loading
# Automatically loads ~/.ssh/*.key files
# Better colors and formatting
# Consistent color scheme across tools
# Git utilities (git_chief-plugin.sh)
git.branch_clean # Clean merged branches
git.uncommitted # Find uncommitted changes
# Vault utilities (vault_chief-plugin.sh)
chief.vault_file-edit # Create/edit encrypted files
chief.vault_file-load # Load secrets
# SSH utilities (ssh_chief-plugin.sh)
ssh.key_add # Add SSH keys to agent
ssh.agent_status # Check SSH agent status
# SSL/TLS utilities (ssl_chief-plugin.sh)
chief.ssl_create-ca # Create Certificate Authority
chief.ssl_create-tls-cert # Create TLS certificates
chief.ssl_view-cert # View/analyze certificates
chief.ssl_get-cert # Download certificates from servers
# System utilities (etc_chief-plugin.sh)
chief.etc_chmod-f # Recursive file permission changes
chief.etc_chmod-d # Recursive directory permission changes
chief.etc_create_bootusb # Create bootable USB drives
chief.etc_copy_dotfiles # Copy hidden files between directories
chief.etc_create_cipher # Generate random cipher keys
chief.etc_mount_share # Mount SMB/CIFS network shares
chief.etc_spinner # Progress spinner for long operations
chief.etc_ask_yes_or_no # Interactive yes/no prompts
# OpenShift utilities (openshift_chief-plugin.sh)
chief.oc_login # Login to OpenShift with Vault integration
chief.oc_approve_csrs # Approve Certificate Signing Requests
chief.oc_show_stuck_resources # Show and fix stuck resources
chief.oc_delete_stuck_ns # Force delete stuck namespaces
Chief includes comprehensive SSL/TLS certificate management tools for creating, analyzing, and downloading certificates.
# Create a basic CA with defaults
chief.ssl_create-ca
# Create a named CA with custom organization
chief.ssl_create-ca mycompany -o "ACME Corp" -d 7300
# Create CA with full customization
chief.ssl_create-ca production \
-c US -s CA -l "San Francisco" \
-o "Production CA" -e admin@company.com \
-d 3650 -k 4096
# Create basic server certificate
chief.ssl_create-tls-cert webserver
# Create certificate with Subject Alternative Names
chief.ssl_create-tls-cert api --san "api.example.com,api.test.com"
# Create certificate with IP addresses
chief.ssl_create-tls-cert server --ip "192.168.1.10,10.0.0.5"
# Create wildcard certificate
chief.ssl_create-tls-cert web --san "*.example.com" -d 730 -k 4096
# View certificate details
chief.ssl_view-cert cert.pem
chief.ssl_view-cert -s cert.pem # Subject only
chief.ssl_view-cert -d cert.pem # Dates only
# Download certificates from servers
chief.ssl_get-cert google.com
chief.ssl_get-cert mail.example.com 993 # IMAPS
chief.ssl_get-cert -c example.com # Full certificate chain
The ETC plugin provides essential system administration utilities for common tasks.
# Recursively change file permissions
chief.etc_chmod-f 644 # All files to 644
chief.etc_chmod-f 755 /path/to/scripts # Executable scripts
chief.etc_chmod-f -v 644 # Verbose output
chief.etc_chmod-f -n 644 # Dry run preview
# Recursively change directory permissions
chief.etc_chmod-d 755 # Standard directory permissions
chief.etc_chmod-d 750 /secure/path # Restricted access
# Copy hidden files between directories
chief.etc_copy_dotfiles ~/backup ~/
chief.etc_copy_dotfiles -v /etc/skel ~/newuser # Verbose
chief.etc_copy_dotfiles -b -f ~/old ~/current # Force with backup
# Create bootable USB drive (macOS/Linux)
chief.etc_create_bootusb ubuntu.iso 2 # disk2 on macOS
chief.etc_create_bootusb -n ubuntu.iso 2 # Dry-run: SAFE preview
chief.etc_create_bootusb -k installer.iso 3 # Keep temp files
⚠️ Safety First: Always use -n
flag first to preview what will happen before creating bootable media, as this operation completely erases the target drive.
# Mount SMB/CIFS network shares
chief.etc_mount_share //server/shared /mnt/shared john
# Create shared terminal sessions
chief.etc_shared-term_create dev-session
chief.etc_shared-term_connect dev-session
# Schedule commands to run later
chief.etc_at_run "now + 10 minutes" "echo 'Reminder!'"
chief.etc_at_run "2:30pm" "backup_script.sh"
Advanced OpenShift cluster management with Vault integration for secure authentication.
# Login with Vault-stored credentials
chief.oc_login hub # User credentials from Vault
chief.oc_login hub -kc # Kubeconfig from Vault
chief.oc_login hub -ka # Kubeadmin password from Vault
chief.oc_login hub -i # Skip TLS verification
# Approve pending Certificate Signing Requests
chief.oc_approve_csrs # Interactive approval
chief.oc_approve_csrs -l # List pending CSRs
chief.oc_approve_csrs -a # Approve all pending
chief.oc_approve_csrs -f "node-" # Filter by pattern
# Diagnose stuck resources
chief.oc_show_stuck_resources my-namespace
chief.oc_show_stuck_resources production --dry-run
chief.oc_show_stuck_resources dev-environment --fix
# Force delete stuck namespaces
chief.oc_delete_stuck_ns stuck-namespace --dry-run
chief.oc_delete_stuck_ns broken-ns
For seamless OpenShift authentication, configure Vault secrets:
# Set up environment variables
export VAULT_ADDR="https://vault.company.com"
export VAULT_TOKEN="your-vault-token"
export CHIEF_VAULT_OC_PATH="secrets/openshift"
# Store cluster credentials in Vault
vault kv put secrets/openshift/hub \
api="https://api.hub.cluster.com:6443" \
kubeconfig="$(cat ~/.kube/config)" \
kubeadmin="password123"
# Get comprehensive help system
chief.help # Full help with categories
chief.help commands # Core commands only
chief.help plugins # Plugin management
chief.help config # Configuration options
chief.help --compact # Quick reference
chief.help --search git # Search for git commands
# Quick tips and workflow hints
chief.hints # Compact tips
chief.hints --banner # Tips with banner
# Explore all commands
chief.[tab][tab]
# Get help for any command
chief.update -?
# Find where any function/alias is defined
chief.whereis my_function
# Edit and auto-reload your bashrc
chief.bashrc
# Edit and auto-reload your bash_profile
chief.bash_profile
# Create/edit plugins instantly
chief.plugin mytools
# Set a shorter alias for Chief commands
# In chief.config: CHIEF_CFG_ALIAS="cf"
# Now use: cf.config, cf.plugin, etc.
# View current configuration
chief.config_show
# Set configuration values
chief.config_set PROMPT true
chief.config_set EDITOR "vim"
# Interactive configuration editor
chief.config
# Update config with new features (after upgrade)
chief.config_update
chief.config_update --dry-run
# Reload Chief after changes
chief.reload
# Create/edit plugins
chief.plugin mytools # Create or edit 'mytools' plugin
chief.plugin list # List all available plugins
# Plugin discovery
chief.whereis function_name # Find where function is defined
chief.help plugins # Show plugin-provided commands
# Plugin management
chief.plugins_update # Update remote plugins (if configured)
chief.plugins_root # Navigate to plugins directory
# Create a DevOps plugin
chief.plugin devops
# Add functions like:
function devops.docker_cleanup() {
docker system prune -f
docker volume prune -f
}
function devops.k8s_pods() {
kubectl get pods --all-namespaces
}
# Create project-specific plugin
chief.plugin myapp
function myapp.deploy() {
cd ~/projects/myapp
./deploy.sh production
}
function myapp.logs() {
tail -f ~/projects/myapp/logs/app.log
}
# Create git workflow plugin
chief.plugin gitflow
function gitflow.feature_start() {
local feature_name="$1"
git checkout develop
git pull origin develop
git checkout -b "feature/${feature_name}"
}
function gitflow.feature_finish() {
local current_branch=$(git branch --show-current)
git checkout develop
git merge "${current_branch}"
git branch -d "${current_branch}"
}
Chief’s Git functions include dry-run capabilities for potentially destructive operations:
# SAFE: Preview what git reset --hard would affect
chief.git_reset-hard -n
# Example output shows:
# Modified files that would be reset:
# - src/config.js
# - README.md
# Staged files that would be reset:
# - package.json
# ⚠️ WARNING: This would permanently discard the above changes!
# Only run without -n after reviewing the changes
chief.git_reset-hard
-n
first to understand what will be affected.Chief is designed specifically for Bash and won’t interfere with other shells:
.bash_profile
files__git_ps1
(when enabled)complete
builtin# Solution: Restart terminal or source config file
source ~/.bash_profile
# Check bash version - Chief requires Bash 4.0+
bash --version
# If using older bash (like macOS default), upgrade:
# macOS: brew install bash
# Linux: Update your package manager
# Check if ansible is installed (optional dependency)
ansible-vault --version
# Install if needed:
# macOS: brew install ansible
# Linux: pip3 install ansible-core
# Check if OpenShift CLI is installed (optional dependency)
oc version --client
# Install if needed:
# macOS: brew install openshift-cli
# Linux: Download from https://mirror.openshift.com/pub/openshift-v4/clients/ocp/
# Windows: Download from Red Hat or use package manager
# Verify oc is in PATH
which oc
# Check plugin directory and file naming
ls ~/chief_plugins/*_chief-plugin.sh
# Verify plugin syntax
bash -n ~/chief_plugins/myplugin_chief-plugin.sh
# Check plugin path configuration
chief.config_show | grep PLUGINS_PATH
# Verify key naming (must end in .key) and path
ls ~/.ssh/*.key
chief.config # Check CHIEF_CFG_SSH_KEYS_PATH
# Enable git prompt in config
chief.config
# Set CHIEF_CFG_PROMPT=true and CHIEF_CFG_GIT_PROMPT=true
chief.help
for the built-in help systemchief.help --search <term>
to find specific commandschief.config_show
chief.whereis <function>
# Enable debug output for troubleshooting
export CHIEF_DEBUG=1
source ~/.bash_profile
# This will show detailed loading information