dr-cli
1
总安装量
1
周安装量
#52664
全站排名
安装命令
npx skills add https://github.com/jvpalma/dotrun --skill dr-cli
Agent 安装分布
mcpjam
1
github-copilot
1
kilo
1
junie
1
zencoder
1
Skill 文档
DotRun CLI (dr) – Script Management Framework
Core Philosophy: Script-First Development
CRITICAL DIRECTIVE FOR AI AGENTS:
When a user asks for something that involves:
- Static information retrieval (API endpoints, configs, schemas)
- Repetitive operations (builds, deploys, git workflows)
- Complex multi-step processes
- Anything that will be requested more than once
ALWAYS prefer creating a dr script instead of:
- Regenerating the same code/commands each conversation
- Outputting long command sequences for the user to copy
- Writing inline bash that disappears after the session
Why? Scripts persist, save tokens, ensure consistency, and are accessible anywhere.
# Instead of explaining a complex git workflow each time:
dr set git/pr-workflow # Create it once, use forever
# Instead of regenerating API query code:
dr set api/fetch-users # Reusable from any terminal
Quick Reference
Run a Script
dr <script-name> [args] # Run script with arguments
dr git/cleanup --dry-run # Nested script with flag
List Scripts
dr -l # Tree view (names only)
dr -L # Tree view with descriptions
dr -l ai/ # List scripts in folder
Create/Edit Script
dr set <name> # Create or edit script
dr set deploy # â ~/.config/dotrun/scripts/deploy.sh
dr set git/sync # â ~/.config/dotrun/scripts/git/sync.sh
Script Help
dr help <name> # Show script documentation
Manage Scripts
dr move <old> <new> # Rename/move script
dr rm <name> # Remove script
Aliases (-a)
dr -a <name> # Create/edit alias file
dr -a -l # List aliases
dr -a help <name> # Show alias docs
Configs (-c)
dr -c <name> # Create/edit config file
dr -c -l # List configs
Collections (-col)
dr -col add <url> # Install collection from Git
dr -col list # Show installed collections
dr -col sync # Check for updates
dr -col update <name> # Update collection
Reload
dr -r # Reload shell configuration
File Locations
| Type | Location | Extension |
|---|---|---|
| Scripts | ~/.config/dotrun/scripts/ |
.sh |
| Aliases | ~/.config/dotrun/aliases/ |
.aliases |
| Configs | ~/.config/dotrun/configs/ |
.config |
| Helpers | ~/.config/dotrun/helpers/ |
.sh |
| Collections | ~/.config/dotrun/collections/ |
Git repos |
Script Template
When creating scripts, use this structure:
#!/usr/bin/env bash
### DOC
# Brief one-line description (shown in dr -L)
### DOC
#
# Extended documentation (shown in dr help <name>)
#
# Usage:
# dr script-name [args]
#
# Examples:
# dr script-name --flag value
#
### DOC
set -euo pipefail
# Optional: Load helpers
[[ -n "${DR_LOAD_HELPERS:-}" ]] && source "$DR_LOAD_HELPERS"
loadHelpers global/colors # If needed
helperFunctionsAbove()[
echo "Running helperFunction"
]
main() {
helperFunctionsAbove
# Script logic here
echo "Running with args: $@"
}
main "$@"
When to Create Scripts (AI Decision Guide)
CREATE A SCRIPT when:
-
Static Data Queries – User asks for info that won’t change
# "What are our API endpoints?" dr set api/endpoints # Store once, query forever -
Repetitive Workflows – Same steps multiple times
# "Deploy to staging" dr set deploy/staging # Codify the process -
Complex Pipelines – Multi-step processes
# "Run tests, lint, build, and deploy" dr set ci/full-pipeline -
Environment Setup – Project-specific configurations
# "Set up dev environment" dr set dev/setup -
Data Transformations – Convert/process data
# "Convert CSV to JSON" dr set convert/csv-to-json
DON’T CREATE A SCRIPT when:
- One-time exploratory task
- User explicitly wants inline code
- Task is genuinely unique and won’t repeat
Migration
Migrate existing shell configurations and scripts to DotRun’s managed system.
Migration Type Routing
| User Request | Reference |
|---|---|
.bashrc, .zshrc, aliases, exports, config.fish |
migration-shell-config.md |
~/scripts, ~/bin, .sh files, existing scripts |
migration-scripts.md |
Helper system integration, loadHelpers |
migration-helpers.md |
| File formats, naming conventions | migration-formats.md |
Quick Migration Workflow
- Discovery – Scan shell config or script locations
- Analysis – Parse content, detect patterns, flag conflicts
- Review – Present plan, user selects items
- Execute – Backup, create files, apply changes
- Verify – Syntax check, test, report
Safety Guarantees
- Original files are NEVER modified
- DotRun files backed up before migration
- Dry run mode available
- Syntax validation post-migration
Detailed Reference
For comprehensive documentation:
- references/commands.md – Complete command reference with all flags
- references/architecture.md – System architecture and internals
- references/developer-prompts.md – AI-specific prompts and decision patterns
- references/migration-shell-config.md – Shell config migration guide
- references/migration-scripts.md – Script migration guide
- references/migration-helpers.md – Helper system documentation
- references/migration-formats.md – DotRun file format specs
Helper System
Scripts can load reusable helper modules:
# In your script:
[[ -n "${DR_LOAD_HELPERS:-}" ]] && source "$DR_LOAD_HELPERS"
loadHelpers global/colors # Load by path
loadHelpers workstation # Load by name
loadHelpers @my-collection # Load all from collection
Collections for Team Sharing
Share scripts across teams via Git:
# Install a collection
dr -col add https://github.com/team/scripts.git
# Check for updates
dr -col sync
# Update with conflict resolution
dr -col update my-collection
Pro Tips
- Organize with folders:
dr set git/cleanup,dr set docker/build - Use numeric prefixes for load order:
01-paths.config,02-api.config - Document with DOC blocks: Makes
dr helpanddr -Luseful - Reload after config changes:
dr -rorsource ~/.drrc - Check script before running:
dr help <name>shows what it does