-
-
Notifications
You must be signed in to change notification settings - Fork 0
Quick Start Tutorial
Skill Level: Beginner • Time: 5 minutes
Get up and running with DotRun in about 5 minutes. This tutorial walks you through installation, creating your first script, and understanding the core workflow.
- Operating System: Linux, macOS, or Windows (WSL)
- Shell: Bash 4.0+, Zsh, or Fish
- Required: Git (for version control)
- Recommended: A text editor you're comfortable with
curl -fsSL https://raw.githubusercontent.com/jvPalma/dotrun/master/install.sh | shWhat this does:
- Downloads DotRun to
~/.config/dotrun - Installs the
drcommand to your PATH - Sets up shell completion
- Creates initial directory structure
# Check version
dr --version
# List available example scripts
dr -l
# Get help
dr --helpExpected output:
DotRun v3.1.0
Available scripts:
ai/gpt
git/branchCleanup
examples/hello-world
# Set your preferred editor
export EDITOR="code" # VS Code
export EDITOR="vim" # Vim
export EDITOR="nano" # Nano
# Make it permanent
echo 'export EDITOR="code"' >>~/.bashrc# Create your first script (opens in your editor)
dr set helloThis opens your editor with a template. Replace the content with:
#!/usr/bin/env bash
### DOC
# A friendly greeting script
# Usage: dr hello [name]
### DOC
set -euo pipefail
main() {
local name="${1:-World}"
echo "👋 Hello, $name!"
echo "🎉 Your first DotRun script is working!"
}
main "$@"Save and exit your editor.
# Run without arguments
dr hello
# Run with a name
dr hello "Developer"Expected output:
👋 Hello, Developer!
🎉 Your first DotRun script is working!
# Show inline documentation
dr help hello
# Edit the script again (works for both create and modify)
dr set hello# Create scripts in categories
dr set git/quick-status
dr set docker/cleanup
dr set utils/backup-homeLet's make the git script actually useful:
# Edit the git status script
dr set git/quick-statusAdd this content:
#!/usr/bin/env bash
### DOC
# Quick git status with branch info and stash count
# Shows clean status with colors and helpful info
### DOC
set -euo pipefail
main() {
if ! git rev-parse --git-dir >/dev/null 2>&1; then
echo "❌ Not in a git repository"
exit 1
fi
local branch=$(git branch --show-current)
local stash_count=$(git stash list | wc -l)
local status=$(git status --porcelain)
echo "🌿 Branch: $branch"
echo "📦 Stashed changes: $stash_count"
if [[ -z "$status" ]]; then
echo "✅ Working directory clean"
else
echo "📝 Uncommitted changes:"
git status --short
fi
}
main "$@"# Run from any git repository
cd ~/projects/some-repo
dr git/quick-status# Simple list
dr -l
# Detailed list with descriptions
dr -L# Import DotRun's example collection
dr import https://github.com/jvPalma/dotrun.git examples
# List all collections
dr collections list
# Use a script from the collection
dr examples/git/branchCleanup# Create a new collection directory
mkdir ~/my-team-scripts
cd ~/my-team-scripts
# Initialize as a git repository
git init
git remote add origin git@github.com:yourteam/scripts.git
# Export your personal scripts to share
dr export ~/.config/dotrun/bin ./shared-scripts
# Commit and push
git add .
git commit -m "Initial team scripts collection"
git push -u origin mainTeam members can now import your collection:
dr import git@github.com:yourteam/scripts.git team-tools# Rename a script (preserves documentation)
dr move hello utils/greeting
# Reorganize scripts
dr move git/quick-status git/status-enhanced
# Run the moved script
dr utils/greeting "Team"If completion wasn't set up automatically:
# For Bash - add to ~/.bashrc
echo 'source ~/.config/dotrun/dr_completion.bash' >>~/.bashrc
# For Zsh - add to ~/.zshrc
echo 'source ~/.config/dotrun/dr_completion.zsh' >>~/.zshrc
# For Fish
cp ~/.config/dotrun/dr_completion.fish ~/.config/fish/completions/dr.fish
# Reload your shell
source ~/.bashrc # or exec $SHELLTest completion:
dr <TAB><TAB> # Shows available scripts
dr git/<TAB><TAB> # Shows git category scripts
dr set <TAB><TAB> # Shows scripts to editIf you use Claude Code or other AI coding assistants, install the DotRun skill for smarter script creation:
# For Claude Code
npx skills add jvPalma/dotrunThis teaches AI agents to create properly structured scripts, use helpers, and follow DotRun conventions.
-
Create Daily Workflow Scripts:
dr set dev/start-project dr set deploy/staging dr set testing/run-all
-
Integrate with Your Dotfiles:
# If using yadm dr yadm-init # Manual integration ln -s ~/.config/dotrun ~/dotfiles/dotrun
-
Explore Examples:
dr -L # See all available scripts dr examples/ai/gpt . # AI code analysis dr examples/git/branchCleanup # Git branch cleanup
-
Set Up Team Collection:
- Create a shared repository
- Export common scripts
- Document team conventions
-
Establish Workflow:
- Regular script updates
- Code review for shared scripts
- Documentation standards
-
Advanced Collaboration:
- Multiple collections for different teams
- Script namespacing strategies
- Version management
Solution: Ensure ~/.local/bin is in your PATH:
export PATH="$PATH:~/.local/bin"
echo 'export PATH="$PATH:~/.local/bin"' >>~/.bashrcSolution: Check permissions:
chmod +x ~/.config/dotrun/bin/your-script.shSolution: Set your EDITOR variable:
export EDITOR="nano" # or your preferred editorSolution: Restart your shell or source the completion:
source ~/.config/dotrun/dr_completion.bash
# or exec $SHELLIn this tutorial, you've:
✅ Installed DotRun with shell completion ✅ Created your first script with documentation ✅ Organized scripts into logical categories ✅ Set up team collaboration with collections ✅ Learned advanced features like move/rename
You now have:
- A working DotRun v3.1.0 installation
- Personal scripts organized in categories
- Understanding of team collaboration workflow
- Foundation for building complex automation
- Script Development Best Practices - Learn professional scripting patterns
- Team Collaboration Best Practices - Deep dive into team workflows
- Advanced Script Patterns - Complex automation techniques
- Workflow Recipes - See real-world examples
- API Reference - Complete command documentation
Happy scripting! 🚀
This tutorial should take about 5 minutes to complete. If you run into issues, check the Troubleshooting Guide or create an issue.