-
-
Notifications
You must be signed in to change notification settings - Fork 0
FAQ
← Back to README | Home | Troubleshooting →
- General Questions
- Installation & Setup
- Script Management
- Aliases & Configs (v3.1.0 File-Based)
- Collections
- Advanced Topics
- Team Collaboration
- Technical Questions
- Troubleshooting
📖 Looking for specific documentation?
Our wiki has been reorganized for better navigation. Find what you need:
• Getting Started: Installation → User Guide
• Advanced Features: Configuration → Developer Experience
• Team Features: Team Workflows includes collections and sharing
• All Examples: Consolidated in Script Examples
DotRun is a developer productivity tool that provides a unified, Git-backed script management system. It transforms your development workflow into a collection of well-documented, reusable commands accessible from anywhere in your system with the simple dr command.
DotRun is designed for:
- Solo developers wanting to streamline personal workflows
- Development teams needing to share and standardize common tasks
- DevOps engineers managing complex deployment and maintenance scripts
- Anyone tired of remembering long command sequences
While aliases are great for simple commands, DotRun provides:
- Documentation: Built-in help for every script
- Organization: Category-based structure
- Sharing: Easy team collaboration through collections
- Version Control: Git integration for history and rollback
- Validation: Automatic linting and error checking
Yes! DotRun is open-source software released under the MIT license.
- OS: Linux, macOS, or Windows (WSL)
- Shell: Bash 4.0+, Zsh, or Fish
- Git: Version 2.0+ (required)
- Optional: ShellCheck for linting, glow for markdown rendering
Yes! DotRun installs entirely in your home directory:
- Scripts go to
~/.local/bin/ - Workspace is in
~/.config/dotrun/ - No system-wide changes required
To completely remove DotRun:
# Remove the executable
rm ~/.local/bin/dr
# Remove the workspace
rm -rf ~/.config/dotrun
# Remove shell completions (example for bash)
rm ~/.config/bash_completion.d/drYes, use custom paths during installation:
DR_PREFIX=/custom/path ./install.shOr set the DR_HOME environment variable:
export DR_HOME=/custom/dotrun/homeQuick Answer: Backup your ~/.config/dotrun directory, install v3.1.0, then migrate your aliases/configs to the new file-based format using numbered files (NN-category.aliases/config).
Detailed Explanation: v3.1.0 continues the file-based aliases/configs approach introduced in v3.0.0, replacing the monolithic v2.x approach. The namespace commands (-s, -a, -c, -col) and helper loading system have also changed. Back up first, then systematically migrate your content.
Example:
# Backup existing configuration
cp -r ~/.config/dotrun ~/.config/dotrun.v2.backup
# Install v3.1.0
curl -fsSL https://raw.githubusercontent.com/jvPalma/dotrun/master/install.sh | bash
# Create new alias files with numbering
echo "alias gs='git status'" >~/.config/dotrun/aliases/10-git.aliases
echo "export PATH=\"\$HOME/.local/bin:\$PATH\"" >~/.config/dotrun/configs/05-path.config
# Reload
dr -a reload
dr -c reloadSee Also: Installation Guide, Configuration Management, MIGRATION-v3.0.md
Quick Answer: DotRun installs to user directories by default. Ensure ~/.local/bin and ~/.config/dotrun are writable, or use a custom install prefix.
Detailed Explanation: If you encounter permission errors, verify directory ownership and try a user-local install. The installer should never require sudo for default installations.
Example:
# Verify permissions
ls -ld ~/.local/bin ~/.config/dotrun
# Install with custom prefix if needed
curl -fsSL https://raw.githubusercontent.com/jvPalma/dotrun/master/install.sh | bash
# Ensure PATH includes install location
echo 'export PATH="$HOME/.local/bin:$PATH"' >>~/.bashrc
source ~/.bashrcSee Also: Installation Guide, Troubleshooting
Quick Answer: Ensure ~/.drrc is sourced in your shell config file (~/.bashrc, ~/.zshrc, or ~/.config/fish/config.fish), then restart your shell.
Detailed Explanation: DotRun creates ~/.drrc during installation which loads shell-specific configurations. If aliases, configs, or completions aren't working, the shell integration wasn't loaded.
Example:
# For Bash - add to ~/.bashrc
[[ -f ~/.drrc ]] && source ~/.drrc
# For Zsh - add to ~/.zshrc
[[ -f ~/.drrc ]] && source ~/.drrc
# For Fish - add to ~/.config/fish/config.fish
test -f ~/.drrc && source ~/.drrc
# Restart shell
exec $SHELL -lSee Also: Installation Guide, Developer Experience
Quick Answer: Set the EDITOR environment variable in your shell config to your preferred editor (e.g., vim, nano, code).
Detailed Explanation: DotRun uses $EDITOR when running commands like dr set scriptname (which creates or opens a script for editing). The installer attempts to auto-detect an editor, but you should explicitly set your preference.
Example:
# Add to your shell config (~/.bashrc, ~/.zshrc)
export EDITOR="vim" # or nano, emacs, etc.
export VISUAL="$EDITOR" # Some tools use VISUAL
# For VS Code (waits for window close)
export EDITOR="code --wait"
# Reload shell
source ~/.bashrcSee Also: User Guide, Developer Experience
Quick Answer: DotRun officially supports Bash (4.0+), Zsh (5.0+), and Fish (3.0+) on Linux, macOS, and Windows (WSL).
Detailed Explanation: The core dr command works in any POSIX-compatible shell, but interactive features (tab completion, alias loading, config sourcing) are optimized for Bash, Zsh, and Fish. Each shell has dedicated completion and integration files.
Example:
# Check your shell version
bash --version # Should be 4.0+
zsh --version # Should be 5.0+
fish --version # Should be 3.0+
# Shell-specific files are in:
~/.local/share/dotrun/shell/bash/
~/.local/share/dotrun/shell/zsh/
~/.local/share/dotrun/shell/fish/See Also: Installation Guide, Developer Experience
Use forward slashes to create categories:
dr set git/cleanup # Creates in git/ category
dr set deploy/staging # Creates in deploy/ category
dr set utils/backup # Creates in utils/ categoryYes! You can:
- Symlink external scripts:
ln -s /path/to/script ~/.config/dotrun/bin/myscript - Import collections:
dr collection import /path/to/collection.tar.gz - Source external scripts in your DotRun scripts
Use collections:
# Export scripts
dr collection export team-tools ~/team-tools.tar.gz
# Team members import
dr collection import ~/team-tools.tar.gzOr use Git:
cd ~/.config/dotrun
git remote add team https://github.com/team/dotrun-scripts
git pull team mainYes! Scripts can call each other:
#!/usr/bin/env bash
# In deploy/production
# First run staging tests
dr test/staging || exit 1
# Then deploy
echo "Deploying to production..."Quick Answer: Create an executable .sh file in ~/.config/dotrun/scripts/ with a ### DOC comment, then run it with dr scriptname.
Detailed Explanation: DotRun indexes all executable scripts in the scripts directory. The filename (without .sh) becomes the command name. Use ### DOC markers to add inline documentation.
Example:
# Create script
cat >~/.config/dotrun/scripts/hello.sh <<'EOF'
#!/usr/bin/env bash
### DOC
# hello - Print a greeting message
### DOC
set -euo pipefail
echo "Hello from DotRun v3.0!"
EOF
# Make executable
chmod +x ~/.config/dotrun/scripts/hello.sh
# Run it
dr hello
# View help
dr help helloSee Also: User Guide, Script Examples
Quick Answer: Add ### DOC markers around documentation text at the top of your script. Everything between the tokens appears in dr help scriptname.
Detailed Explanation: The DOC token system provides inline, searchable documentation. Include usage, arguments, examples, and dependencies between the markers.
Example:
#!/usr/bin/env bash
### DOC
# deploy/staging - Deploy application to staging environment
#
# Usage: dr deploy/staging [--skip-tests]
#
# Options:
# --skip-tests Skip running tests before deploy
#
# Dependencies:
# - kubectl
# - helm
### DOC
set -euo pipefail
# Script implementation...See Also: Script Examples, Developer Experience
Quick Answer: Ensure the script is executable (chmod +x), has a .sh extension, and is in ~/.config/dotrun/scripts/ or a subdirectory.
Detailed Explanation: DotRun searches for executable files with .sh extension. Hidden files (starting with .) are ignored. Broken symlinks will also cause issues.
Example:
# Check script location and permissions
ls -lh ~/.config/dotrun/scripts/myscript.sh
# Make executable if needed
chmod +x ~/.config/dotrun/scripts/myscript.sh
# Verify it appears in listing
dr -l | grep myscript
# Test execution
dr myscriptSee Also: User Guide, Troubleshooting
Quick Answer: Verify the helper file exists in ~/.config/dotrun/helpers/ or a collection's helpers directory, and use correct syntax in loadHelpers.
Detailed Explanation: v3.1.0 uses the loadHelpers function to source helper modules. Helpers are searched across multiple locations with a specificity hierarchy: local → project → collection → global.
Example:
# In your script
[[ -n "${DR_LOAD_HELPERS:-}" ]] && source "$DR_LOAD_HELPERS"
# Load helpers (pattern-based, no .sh extension)
loadHelpers gcp/workstation
loadHelpers dotrun-anc/utils/common
loadHelpers workstation # Less specific
# List available helpers
ls ~/.config/dotrun/helpers/
# Test with verbose mode
DR_HELPERS_VERBOSE=1 dr myscriptSee Also: Developer Experience, Script Examples
Quick Answer: Pass arguments after the script name: dr scriptname arg1 arg2. Access them in your script using $1, $2, or "$@".
Detailed Explanation: DotRun passes all arguments after the script name directly to your script. Use standard bash argument parsing techniques for flags and options.
Example:
# Call with arguments
dr deploy/staging --env prod --skip-tests
# In the script (deploy/staging.sh)
#!/usr/bin/env bash
set -euo pipefail
ENV="staging"
SKIP_TESTS=false
while [[ $# -gt 0 ]]; do
case "$1" in
--env)
ENV="$2"
shift 2
;;
--skip-tests)
SKIP_TESTS=true
shift
;;
*)
echo "Unknown option: $1"
exit 1
;;
esac
done
echo "Deploying to $ENV (skip tests: $SKIP_TESTS)"See Also: Script Examples, User Guide
Quick Answer: The skeleton is a standard template with shebang, DOC markers, strict mode, and main function structure that ensures consistency.
Detailed Explanation: Using a consistent skeleton improves readability, error handling, and maintainability across all your scripts.
Example:
#!/usr/bin/env bash
### DOC
# scriptname - Brief description of what this script does
### DOC
set -euo pipefail
# Load helpers if needed
[[ -n "${DR_LOAD_HELPERS:-}" ]] && source "$DR_LOAD_HELPERS"
# loadHelpers pattern1 pattern2
main() {
echo "Script logic here..."
echo "Arguments: $*"
}
main "$@"See Also: Script Examples, Developer Experience
Quick Answer: Scripts are executable files (~/.config/dotrun/scripts/*.sh) run via dr scriptname. Aliases are shell shortcuts defined in .aliases files and loaded into your interactive shell.
Detailed Explanation: Use scripts for portable, complex logic with documentation. Use aliases for quick shell-level shortcuts and command abbreviations that work in your terminal.
Example:
# Script (portable, documented, complex logic)
~/.config/dotrun/scripts/deploy/production.sh
# Alias (shell shortcut, simple)
# In ~/.config/dotrun/aliases/10-git.aliases:
alias gs='git status'
alias gp='git pull --rebase'
alias gc='git commit -v'See Also: Configuration Management, User Guide
Quick Answer: v3.0 uses multiple ordered files named NN-category.aliases instead of a single monolithic aliases file, enabling modular organization and deterministic load order.
Detailed Explanation: The file-based approach eliminates merge conflicts, allows team collaboration, and makes it clear what loads when. Each file is independent but numerically ordered.
Example:
# v2.x (old) - single file
~/.config/dotrun/aliases.sh # All aliases in one file
# v3.0 (new) - multiple ordered files
~/.config/dotrun/aliases/
├── 00-core.aliases # Load first
├── 10-git.aliases # Then git aliases
├── 20-docker.aliases # Then docker aliases
└── 30-custom.aliases # Then custom aliasesSee Also: Configuration Management, MIGRATION-v3.0.md
Quick Answer: Files are prefixed with 2+ digit numbers (NN) for load order, followed by a dash and descriptive category name, ending with .aliases or .config extension.
Detailed Explanation: The numeric prefix controls when files load (lower numbers load first). The category name is for human readability and organization. This system ensures predictable, conflict-free loading.
Example:
# Valid naming:
00-env.config # Environment variables (loads first)
05-path.config # PATH configuration
10-dev.aliases # Development aliases
20-cloud.aliases # Cloud tool aliases
100-personal.aliases # Personal overrides (loads last)
# Invalid naming:
env.config # Missing number prefix
10_dev.aliases # Wrong separator (use dash, not underscore)
10-dev.alias # Wrong extension (use .aliases plural)See Also: Configuration Management
Quick Answer: Lower-numbered files load first. Use ranges to organize: 00-09 for core, 10-29 for tools, 30-49 for services, 50+ for overrides.
Detailed Explanation: Reserving numeric ranges makes it easy to insert new files in the right order. Later files can override earlier definitions.
Example:
# Organize by numeric ranges
00-core.config # Core exports (DR_CONFIG, etc.)
05-path.config # PATH setup
10-node.config # Node/npm configuration
11-node.aliases # Node aliases (depends on 10-node.config)
20-git.aliases # Git shortcuts
30-docker.aliases # Docker shortcuts
90-personal.aliases # Personal overrides (loads last)
# Later files override earlier ones:
# 20-git.aliases defines: alias gc='git commit'
# 90-personal.aliases can override: alias gc='git commit -v'See Also: Configuration Management
Quick Answer: Verify files end with .config, are in ~/.config/dotrun/configs/, use valid bash syntax, and reload with dr -c reload.
Detailed Explanation: Common issues include wrong extension, syntax errors, wrong directory, or needing to reload after creation.
Example:
# Check file location and naming
ls -lh ~/.config/dotrun/configs/
# Should show files like:
# 05-path.config
# 10-env.config
# Test for syntax errors
bash -n ~/.config/dotrun/configs/10-env.config
# Reload configs
dr -c reload
# Verify loaded
dr -c listSee Also: Configuration Management, Troubleshooting
Quick Answer: Run dr -a reload (or dr aliases reload) to re-source all alias files in order.
Detailed Explanation: v3.0 provides a reload command that clears and reloads all aliases from .aliases files, applying changes immediately without restarting your shell.
Example:
# Edit alias file
echo "alias k='kubectl'" >>~/.config/dotrun/aliases/20-kubernetes.aliases
# Reload to apply changes
dr -a reload
# Verify it works
k version # Should run kubectl versionSee Also: User Guide, Configuration Management
Quick Answer: In an early-numbered .config file (e.g., 05-path.config) so later configs and aliases can rely on it being set.
Detailed Explanation: PATH should load before tool-specific configurations. Keep it separate from other exports for clarity. Avoid duplicate entries.
Example:
# Create 05-path.config
cat >~/.config/dotrun/configs/05-path.config <<'EOF'
# Add local binaries
export PATH="$HOME/.local/bin:$PATH"
# Add DotRun scripts
export PATH="$HOME/.config/dotrun/scripts:$PATH"
# Add language tools
export PATH="$HOME/.npm/bin:$PATH"
export PATH="$HOME/.cargo/bin:$PATH"
EOF
# Reload
dr -c reload
# Verify
echo $PATHSee Also: Configuration Management
Quick Answer: Yes! Create as many NN-category.aliases files as needed. They all load in numeric order.
Detailed Explanation: Multiple files enable modular organization by domain (git, docker, kubernetes) or team (personal, team-shared). Each file is independent.
Example:
# Organize by tool/domain
~/.config/dotrun/aliases/
├── 10-git.aliases # Git shortcuts
├── 15-git-flow.aliases # Git flow extensions
├── 20-docker.aliases # Docker commands
├── 25-docker-compose.aliases # Docker Compose shortcuts
└── 30-kubernetes.aliases # kubectl aliases
# All load in order (10, 15, 20, 25, 30...)
dr -a reload
dr -a list # Shows all loaded aliasesSee Also: Configuration Management
Quick Answer: Use .aliases for alias definitions and .config for environment variables and configuration exports.
Detailed Explanation: Both are sourced as bash scripts, but the naming convention clarifies intent. .aliases should only contain alias commands; .config should only contain export statements and configuration.
Example:
# Good: 10-git.aliases
alias gs='git status'
alias gp='git pull --rebase'
# Good: 05-env.config
export EDITOR="vim"
export VISUAL="$EDITOR"
export DOTRUN_THEME="dark"
# Bad: mixing in same file
# Don't mix aliases and exports in one fileSee Also: Configuration Management
Quick Answer: Collections are git repositories containing shareable scripts, helpers, aliases, and configs. They're optional but recommended for teams standardizing workflows.
Detailed Explanation: Collections enable version-controlled sharing, dependency management, and conflict resolution. Solo developers can use them for organizing personal toolkits; teams use them for standardization.
Example:
# Install a collection
dr -col add https://github.com/org/devtools.git
# Interactive browser shows available resources
# Select what to import
# Later, update to new version
dr -col update devtoolsSee Also: Team Workflows, User Guide
Quick Answer: Use SSH URLs with configured SSH keys, or HTTPS URLs with credentials. Ensure your git authentication is working first.
Detailed Explanation: Private collections require git authentication. SSH is recommended for private repositories. Test access with ssh -T git@github.com before installing.
Example:
# Test SSH access first
ssh -T git@github.com
# Should see: "Hi username! You've successfully authenticated..."
# Install private collection via SSH
dr -col add git@github.com:myorg/private-tools.git
# Alternative: HTTPS with token (not recommended)
# dr -col add https://token@github.com/myorg/private-tools.gitSee Also: Team Workflows, Troubleshooting
Quick Answer: DotRun fetches the latest version, compares SHA256 hashes to detect modified files, then prompts interactively for conflicts: keep local, take remote, or view diff.
Detailed Explanation: v3.0 tracks file modifications using SHA256 hashing. Unmodified files update silently; modified files trigger interactive conflict resolution with options to keep, overwrite, backup, or diff.
Example:
# Update a collection
dr -col update devtools
# Example interaction:
# → Fetching updates for devtools...
# → scripts/deploy.sh: MODIFIED (local changes detected)
# [K]eep local [O]verwrite [D]iff [B]ackup then overwrite [S]kip
# ? K
# → Keeping local version of scripts/deploy.sh
# → scripts/test.sh: Updating (no local changes)
# → Update completeSee Also: Team Workflows, Developer Experience
Quick Answer: Yes, but modifications are tracked via SHA256 hashes. Updates will detect the drift and prompt you to keep or overwrite.
Detailed Explanation: It's better to copy collection scripts to your local workspace with a different name/namespace for persistent customization, or contribute changes upstream.
Example:
# Option 1: Copy to local namespace (recommended)
cp ~/.config/dotrun/helpers/01-devtools/gcp/deploy.sh \
~/.config/dotrun/scripts/my-deploy.sh
# Customize my-deploy.sh
# Original remains unchanged for updates
# Option 2: Modify in place (will trigger conflict on update)
vim ~/.config/dotrun/helpers/01-devtools/gcp/deploy.sh
# Next update will detect SHA256 mismatch and promptSee Also: Team Workflows, User Guide
Quick Answer: Verify internet connection, git credentials, and repository URL. Try dr -col sync to check all collections.
Detailed Explanation: Common issues include authentication failures (SSH keys, tokens), network problems, or repository access. Git operations have 30-second timeouts.
Example:
# Check sync status for all collections
dr -col sync
# Test git access
ssh -T git@github.com # For SSH URLs
git ls-remote https://github.com/org/collection.git # For HTTPS
# View collection details
dr -col list
# Re-clone if corrupt
dr -col remove devtools
dr -col add https://github.com/org/devtools.gitSee Also: Team Workflows, Troubleshooting
Quick Answer: DotRun stores SHA256 hashes of imported collection files in ~/.config/dotrun/.dr-hashes/ and compares them during updates to detect local modifications.
Detailed Explanation: Hash tracking enables precise drift detection beyond timestamps. When you import a file, its hash is stored. During updates, the current hash is compared against the stored hash to determine if you've made local changes.
Example:
# Hashes stored here:
ls ~/.config/dotrun/.dr-hashes/
# deploy.sh.sha256
# test.sh.sha256
# View a hash
cat ~/.config/dotrun/.dr-hashes/deploy.sh.sha256
# e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
# During update:
# 1. Calculate current file hash
# 2. Compare to stored hash
# 3. If different → "locally modified" (prompt user)
# 4. If same → "unmodified" (safe to update)See Also: Developer Experience, Team Workflows
Quick Answer: v3.0 standardizes on dotrun.collection.yml metadata file. The old v2.x format is no longer supported.
Detailed Explanation: The new metadata format includes versioning, dependency tracking, and compatibility requirements. Old collections need migration to work with v3.0.
Example:
# New format: dotrun.collection.yml
name: devtools
version: 1.2.0
description: Development team shared tools
author: Engineering Team
repository: https://github.com/org/devtools.git
license: MIT
# Optional fields:
homepage: https://docs.example.com
dependencies: []See Also: Team Workflows, User Guide
Quick Answer: Create a git repository with dotrun.collection.yml metadata, organize scripts/helpers/aliases/configs in subdirectories, tag a version, and share the URL.
Detailed Explanation: Collections are standard git repositories with specific structure. Include metadata, organize resources, tag releases with semantic versions (v1.0.0), and share via git URL.
Example:
# Create collection repository
mkdir my-devtools && cd my-devtools
git init
# Create metadata
cat >dotrun.collection.yml <<'EOF'
name: my-devtools
version: 1.0.0
description: Personal development tools
author: Your Name
repository: https://github.com/yourusername/my-devtools.git
EOF
# Organize resources
mkdir -p scripts helpers aliases configs
echo '#!/usr/bin/env bash' >scripts/example.sh
chmod +x scripts/example.sh
# Commit and tag
git add .
git commit -m "Initial collection"
git tag v1.0.0
# Push to GitHub
git remote add origin git@github.com:yourusername/my-devtools.git
git push origin master --tags
# Install your collection
dr -col add git@github.com:yourusername/my-devtools.gitSee Also: Team Workflows, Developer Experience
Quick Answer: Collections use git tags with semantic versioning (vX.Y.Z). The metadata version field must match the git tag.
Detailed Explanation: Tags enable version pinning and reproducible installations. The v prefix in git tags is optional but the metadata version should be numeric only (1.2.3).
Example:
# In dotrun.collection.yml:
version: 1.2.3
# Git tag must match:
git tag v1.2.3 # or git tag 1.2.3
# Install specific version
dr -col add https://github.com/org/tools.git@v1.2.0
# Update checks for newer tags
dr -col sync
# → devtools: v1.2.0 → v1.3.0 available
dr -col update devtoolsSee Also: Team Workflows
Quick Answer: Source the loadHelpers function, then call it with helper names. Helpers are sourced from local, project, collection, or global locations.
Detailed Explanation: The helper system in v3.0 uses pattern-based loading with 5 specificity levels. Load helpers early in your script before using their functions.
Example:
#!/usr/bin/env bash
set -euo pipefail
# Load the loadHelpers function
[[ -n "${DR_LOAD_HELPERS:-}" ]] && source "$DR_LOAD_HELPERS"
# Load specific helpers
loadHelpers gcp/workstation
loadHelpers utils/common
# Use helper functions
echo "Current project: $(gcp_current_project)"
log_info "Deployment starting..."See Also: Developer Experience, Script Examples
Quick Answer: loadHelpers is a function that searches for and sources helper modules using flexible pattern matching across multiple locations.
Detailed Explanation: It supports 5 specificity levels from absolute paths to filename-only matching, searches across collections with namespace normalization, includes de-duplication, circular dependency detection, and security validation.
Example:
# Different specificity levels (all work):
loadHelpers /full/path/to/helper.sh # Level 1: Absolute
loadHelpers helpers/01-dotrun-anc/gcp/workstation.sh # Level 2: Exact path
loadHelpers 01-dotrun-anc/gcp/workstation # Level 3: With extension
loadHelpers dotrun-anc/gcp/workstation # Level 4: Collection normalized
loadHelpers gcp/workstation # Level 4: Path search
loadHelpers workstation # Level 5: Filename only
# Load all helpers from a collection
loadHelpers @dotrun-anc
# Preview matches without loading
loadHelpers gcp/workstation --listSee Also: Developer Experience, CLAUDE.md
Quick Answer: 5 levels from most to least specific: (1) Absolute path, (2) Exact relative path, (3) Path with auto-.sh, (4) Collection search, (5) Filename only.
Detailed Explanation: More specific patterns guarantee unique matches. Less specific patterns may load multiple helpers. Use collection names when possible to avoid ambiguity.
Example:
# Most specific (guaranteed unique)
loadHelpers dotrun-anc/gcp/workstation
# Less specific (may match multiple)
loadHelpers gcp/workstation # Could match in multiple collections
# Least specific (likely multiple matches)
loadHelpers workstation # Might load workstation.sh from all collections
# Best practice: Include collection or full path
loadHelpers dotrun-anc/gcp/workstation # Clear and specificSee Also: Developer Experience
Quick Answer: v3.0 uses namespace flags for management commands: -s/scripts, -a/aliases, -c/config, -col/collections. Both flag and subcommand styles work identically.
Detailed Explanation: The namespace system organizes commands by domain. You can use short flags (-s) or full subcommands (scripts) interchangeably.
Example:
# Scripts namespace
dr -s list # or: dr scripts list
dr -s set scriptname # or: dr scripts set scriptname
# Aliases namespace
dr -a reload # or: dr aliases reload
dr -a list # or: dr aliases list
# Config namespace
dr -c set KEY value # or: dr config set KEY value
dr -c list # or: dr config list
# Collections namespace
dr -col sync # or: dr collections sync
dr -col update name # or: dr collections update nameSee Also: User Guide, Developer Experience
Quick Answer: Zsh completion uses color coding: green for special commands, yellow for folders, cyan for scripts, purple for alias commands, red for config commands.
Detailed Explanation: The color scheme provides visual cues for different command types. Folders show with trailing /, scripts appear without .sh extension.
Example:
# dr <tab> shows:
# - Special commands (green): help, -l, -L
# - Folders (yellow): git/, docker/, deploy/
# - Scripts (cyan): build, test, deploy
# - Hint (dark gray): (hint: -s/scripts, -a/aliases, -c/config, -col/collections)
# dr -s <tab> shows:
# - Script management (green): add, edit, move, rename, help, list
# dr -a <tab> shows:
# - Alias management (purple): init, add, list, edit, remove, reload
# dr -c <tab> shows:
# - Config management (red): init, set, get, list, edit, unset, reloadSee Also: Developer Experience
Quick Answer: Optimize by using lazy helper loading, organizing scripts in folders, and avoiding heavy operations in config files.
Detailed Explanation: Load only needed helpers, keep PATH clean, use numeric ordering to control heavy configs, and minimize shell startup overhead.
Example:
# Good: Load only what you need
loadHelpers gcp/workstation # Just this one
# Bad: Load everything
loadHelpers @dotrun-anc # All helpers from collection
# Optimize PATH (05-path.config)
# Remove duplicates and order by frequency of use
export PATH="$HOME/.local/bin:$HOME/.cargo/bin:$PATH"
# Avoid heavy operations in early configs
# Move them to higher-numbered files or scriptsSee Also: Developer Experience, Configuration Management
When importing collections with conflicts:
# Skip existing scripts
dr collection import tools.tar.gz --skip-existing
# Use prefix to avoid conflicts
dr collection import tools.tar.gz --prefix team-
# Force overwrite (careful!)
dr collection import tools.tar.gz --forceYes! Organize scripts by visibility:
~/.config/dotrun/bin/
├── personal/ # Git-ignored personal scripts
├── team/ # Shared team scripts
└── public/ # Open source scriptsAdd to .gitignore:
bin/personal/
DotRun workspace is a Git repository:
cd ~/.config/dotrun
git add .
git commit -m "Add deployment scripts"
git tag v1.0.0
git push origin mainYes! Use Git branches:
# Stable version
git checkout main
# Development version
git checkout develop
# Personal modifications
git checkout -b personal/customizationsDotRun respects the shebang in your scripts:
-
#!/usr/bin/env bash- Uses bash -
#!/usr/bin/env python3- Uses Python -
#!/usr/bin/env node- Uses Node.js
Default is bash if no shebang is specified.
Yes! DotRun supports any executable script:
#!/usr/bin/env python3
### DOC
# Python script example
### DOC
print("Hello from Python!")#!/usr/bin/env node
### DOC
# Node.js script example
### DOC
console.log("Hello from Node.js!");DotRun searches for executable files in:
-
~/.config/dotrun/bin/(root level) -
~/.config/dotrun/bin/*/(category directories) - Follows symlinks to external scripts
Yes! Use standard debugging techniques:
# Enable debug mode
set -x # In your script
# Or run with bash debug
bash -x ~/.config/dotrun/bin/myscript
# Or add debug flag
if [[ "${DEBUG:-}" == "true" ]]; then
set -x
fiDocument and check dependencies:
#!/usr/bin/env bash
### DOC
# Dependencies:
# - jq: JSON processing
# - curl: HTTP requests
### DOC
# Check dependencies
for cmd in jq curl; do
if ! command -v "$cmd" &>/dev/null; then
echo "Error: $cmd is required but not installed"
exit 1
fi
doneQuick Answer: Ensure ~/.drrc is sourced in your shell RC file, then restart your shell or run dr completion install.
Detailed Explanation: v3.0 tab completion is loaded via the ~/.drrc shell integration file. If completions aren't working, verify the file is sourced and the shell-specific completion files exist.
Example:
# For Bash - check ~/.bashrc contains:
[[ -f ~/.drrc ]] && source ~/.drrc
# For Zsh - check ~/.zshrc contains:
[[ -f ~/.drrc ]] && source ~/.drrc
# Reinstall completions if needed
dr completion install
# Reload shell
exec $SHELL -l
# Test completion
dr <TAB>See Also: Installation Guide, Developer Experience
Quick Answer: Ensure scripts have .sh extension, are executable (chmod +x), and are in ~/.config/dotrun/scripts/ or subdirectories.
Detailed Explanation: DotRun only lists executable .sh files. Hidden files (starting with .) and broken symlinks are ignored.
Example:
# Check script location
ls -lh ~/.config/dotrun/scripts/
# Make executable
chmod +x ~/.config/dotrun/scripts/myscript.sh
# Verify extension
mv ~/.config/dotrun/scripts/myscript ~/.config/dotrun/scripts/myscript.sh
# List scripts
dr -l
dr -L # Long format with pathsSee Also: User Guide, Troubleshooting
Quick Answer: Add ~/.local/bin to your PATH in your shell config, then reload.
Detailed Explanation: The dr command is installed to ~/.local/bin by default. Your shell needs this directory in its PATH.
Example:
# Add to ~/.bashrc or ~/.zshrc
echo 'export PATH="$HOME/.local/bin:$PATH"' >>~/.bashrc
# Reload shell
source ~/.bashrc
# Verify installation
which dr
dr --helpSee Also: Installation Guide
Quick Answer: Lower the alias file's numeric prefix, remove the conflicting alias, or use command cmd to bypass the alias temporarily.
Detailed Explanation: Later-loaded aliases override earlier ones. Use dr -a list to find which file defines the alias, then adjust the load order or remove it.
Example:
# Find the conflicting alias
dr -a list | grep 'alias ls'
# Option 1: Bypass temporarily
command ls # Runs system ls, not alias
# Option 2: Lower the file's load order
mv ~/.config/dotrun/aliases/20-utils.aliases \
~/.config/dotrun/aliases/50-utils.aliases
# Option 3: Remove the alias
# Edit file and remove the alias line
# Reload
dr -a reloadSee Also: Configuration Management
Quick Answer: Use "Keep local" during updates, or copy the script to your local workspace under a different namespace to persist customizations.
Detailed Explanation: Collection updates detect modifications via SHA256 hashing. Persistent local changes are better managed by copying to ~/.config/dotrun/scripts/ with your own namespace.
Example:
# Option 1: Keep local during updates
dr -col update devtools
# When prompted for modified file, choose [K]eep local
# Option 2: Copy to local workspace (recommended)
cp ~/.config/dotrun/helpers/01-devtools/gcp/deploy.sh \
~/.config/dotrun/scripts/my-deploy.sh
# Customize my-deploy.sh without affecting collection updates
vim ~/.config/dotrun/scripts/my-deploy.sh
# Run your customized version
dr my-deploySee Also: Team Workflows, Collections
Quick Answer: Consolidate PATH exports into a single early-numbered .config file and use a helper function to prevent duplicates.
Detailed Explanation: Multiple alias/config files can each append to PATH, creating duplicates. Use a path_add helper to check before adding.
Example:
# Create 05-path.config with deduplication
cat >~/.config/dotrun/configs/05-path.config <<'EOF'
# Helper to add to PATH only if not already present
path_add() {
case ":$PATH:" in
*":$1:"*) ;; # Already in PATH
*) PATH="$1:$PATH" ;;
esac
}
# Add paths (no duplicates)
path_add "$HOME/.local/bin"
path_add "$HOME/.config/dotrun/scripts"
path_add "$HOME/.cargo/bin"
export PATH
EOF
# Reload and verify
dr -c reload
echo $PATH | tr ':' '\n' # Check for duplicatesSee Also: Configuration Management
Quick Answer: Verify helper name case, check it exists with ls ~/.config/dotrun/helpers/, and ensure you're not including the .sh extension in the pattern.
Detailed Explanation: Helper names are case-sensitive. Use verbose mode to see search process and ensure helpers exist in the expected location.
Example:
# Check available helpers
ls -R ~/.config/dotrun/helpers/
# Use verbose mode to debug
DR_HELPERS_VERBOSE=1 loadHelpers gcp/workstation
# Common mistakes:
loadHelpers gcp/workstation.sh # Wrong: don't include .sh
loadHelpers gcp/Workstation # Wrong: case-sensitive
# Correct:
loadHelpers gcp/workstationSee Also: Developer Experience, Advanced Topics
Quick Answer: DotRun caches completions. Restart your shell after deleting scripts.
Detailed Explanation: Shell completions are loaded at startup. After removing scripts, restart your shell to refresh the completion cache.
Example:
# Delete script
rm ~/.config/dotrun/scripts/old-script.sh
# Restart shell to refresh completions
exec $SHELL -l
# Or reload completions manually (zsh)
compinit
# Verify
dr <TAB> # old-script should not appearSee Also: Developer Experience
Quick Answer: Yes! Install DotRun in your CI job, add ~/.local/bin to PATH, install collections, and run scripts.
Detailed Explanation: For CI/CD, disable interactive features, pin collection versions, and cache the DotRun installation for faster builds.
Example:
# GitHub Actions example
steps:
- name: Install DotRun
run: |
curl -fsSL https://raw.githubusercontent.com/jvPalma/dotrun/master/install.sh | bash
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install collections
run: |
dr -col add https://github.com/org/devtools.git@v1.2.3
- name: Run deployment
run: dr deploy/production --ciGitLab CI Example:
deploy:
before_script:
- curl -fsSL https://raw.githubusercontent.com/jvPalma/dotrun/master/install.sh | bash
- export PATH="$HOME/.local/bin:$PATH"
- dr -col add git@github.com:org/devtools.git@v1.2.3
script:
- dr deploy/production --ciSee Also: Team Workflows, Installation Guide
Quick Answer: Use GitHub Issues for bugs, GitHub Discussions for features, and see CONTRIBUTING.md to contribute code.
Detailed Explanation: Provide version info (dr --version), steps to reproduce, and expected vs actual behavior for bugs. For features, describe the use case and benefit.
Example:
# Check version first
dr --version
# Report bug:
# https://github.com/jvPalma/dotrun/issues
# Request feature:
# https://github.com/jvPalma/dotrun/discussions
# Contribute:
# See CONTRIBUTING.md in repositorySee Also: Contributing Guide
Still have questions? Check the Troubleshooting Guide or open an issue on GitHub.