# README

## Build and Development Commands

- `make` - Install all scripts to `/usr/local/lib/dr` and executables to `/usr/local/bin`
- `make watch` - Auto-rebuild when files change using `entr`
- `cd python && make` - Install Python scripts only
- `cd shell && make` - Install shell scripts only

## Architecture Overview

This is a personal utility script collection (`dr-scripts`) that provides a unified command interface through the `dr` dispatcher. The repository contains utility scripts organized by language:

### Core System
- **Dispatcher**: `shell/dr` - Main entry point that routes commands to scripts in `/usr/local/lib/dr/`
- **Build System**: Uses Makefiles to compile and install scripts with automatic dependency management
- **Script Processing**: `shell/compile_script` transforms shell scripts into callable functions with:
  - Automatic import resolution for `dr_*` function calls
  - Local variable declarations
  - Function wrapping (`dr_scriptname`)
  - Source/execute detection

### Directory Structure
- `shell/` - Shell scripts (main collection of utilities)
- `python/` - Python scripts for data processing and AI tasks
- `go/`, `perl/`, `rust/`, `sql/` - Other language-specific utilities
- `archive/` - Deprecated/backup scripts
- `data/` - Static data files
- `envs/` - Environment configurations

### Key Patterns
- Scripts use `dr_` prefix for internal function calls between scripts
- Cross-script dependencies are automatically resolved during compilation
- Scripts can be sourced as libraries or executed directly
- Many scripts integrate with external tools (tmux, git, fzf, rclone, etc.)

### Notable Scripts
- `git_ai_commit` - AI-powered git commit message generation
- `tmux_*` scripts - Extensive tmux workspace management
- `note` and related - Note-taking and knowledge management system
- `choose_*` scripts - Interactive selection utilities using fzf

## Testing and Validation

No automated tests are present. Manual testing involves:
1. Running `make` to ensure compilation succeeds
2. Testing individual scripts with `dr <script-name>`
3. Verifying script dependencies resolve correctly
