A natural-language TUI for safely managing your Windows filesystem with AI-generated PowerShell scripts.
Director.y is a terminal-based tool that lets you navigate, inspect, and manage your Windows filesystem using natural language. Describe a task or ask a question - Director.y will generate a safe PowerShell script, validate it, and execute it only with your approval.
- Natural Language Interface: Manage files without memorizing commands.
- Modern TUI: Clean, responsive interface built with Textual.
- Safety-First Execution: Sandboxing, path validation, script classification, and automatic syntax validation with retry for all scripts.
- Two Modes
- Query Mode: Read-only questions about your filesystem.
- Task Mode: File operations that require explicit approval.
- Live Directory Tree: Auto-refreshing, interactive view of your working directory.
- Flexible LLM Integration: Provider and model agnostic
pip install directory-agentAfter installation, verify the dy command is available:
dy --versionNote: If the dy command isn't recognized, ensure Python's Scripts
directory is in your PATH.
git clone https://github.com/raytonc/Director.y.git
cd Director.y
# Install in development mode
pip install -e .Run the interactive configuration wizard to set up your API key:
dy --configureThe wizard will guide you through:
- Selecting your AI provider
- Entering and validating your API key
- Choosing a model
- Configuring timeouts and output limits
Your configuration will be saved to %APPDATA%\directory\config.toml (Windows).
Director.y enforces a sandbox for safety and must be run from a folder inside
C:\Users\<YourName>.
# Navigate to a folder under your user directory
cd C:\Users\YourName\Downloads
# Run Director.y
dyAsk questions like:
- "What's taking up the most space?"
- "Which files were modified today?"
Flow:
- AI generates a read-only PowerShell script
- Syntax validation (with automatic retry if errors are found)
- Script classification and safety checks
- Execution in the sandbox
- Results are summarized in plain English
Examples:
- "Organize files by type"
- "Move all PDFs to Documents"
- "Delete empty folders"
- "Rename photos with dates"
Flow:
- AI generates a planning script to analyze your request
- Syntax validation with retry (planning script)
- Planning script executes (read-only)
- AI generates an execution script based on the analysis
- Syntax validation with retry (execution script)
- Safety classification check
- You review and approve all changes
- The script executes in the sandbox
- Results are summarized
- Sandboxing -- Never operates outside the directory you run it from
- Path Validation -- All paths must stay within the sandbox
- Script Classification -- Read-only, write, or unsafe
- Syntax Validation with Retry -- All scripts validated before execution; AI automatically fixes syntax errors
- Manual Approval -- Required for all write operations
- Recycle Bin Safety -- Deletions are soft (moved to a temp location)
- Output Size Limits -- Default: 100 KB
- Timeouts -- 60s for read scripts, 300s for write scripts
- Registry access
- Process creation/execution
- Network requests
- Operations outside the sandbox
- Dangerous cmdlets (e.g.,
Invoke-Expression)
src/directory/
├── agents/ # AI agents for different tasks
│ ├── query.py # Generates read-only scripts
│ ├── planner.py # Plans task execution
│ ├── executor.py # Generates write scripts
│ └── summary.py # Summarizes results
├── text/ # System prompts and text content
├── tui/ # Terminal user interface
├── execution.py # Script validation and execution
├── workflows.py # Orchestrates multi-step workflows
└── config.py # Configuration management
Query Flow
User Question → Query Agent → Validation → Execution → Summary
Task Flow
User Task → Planner Agent → Validation → Execution → Executor Agent → Validation → User Approval → Execution → Summary
helpor/help-- Show helpquitorexit-- Exit Director.y/quitor/exit-- Alternative exit aliases
Tab-- Switch between Query and Task modesCtrl+C-- Cancel current operationCtrl+Q-- Quit Director.y
dy --help # Show help message
dy --version # Show version information
dy --configure # Configure API keys and settingspytest tests/ -v- Agents -- Specialized AI agents for planning and execution
- Execution Layer -- Validates and runs PowerShell scripts safely
- TUI Layer -- Interactive interface built with Textual
- Workflow Engine -- Manages multi-step AI interactions with retry logic
- Add system prompt to
src/directory/text/ - Create agent in
src/directory/agents/ - Add workflow in
src/directory/workflows.py - Add tests in
tests/
- Windows (PowerShell required)
- Python 3.11+
Important: Director.y executes PowerShell scripts. Always review proposed changes before approving. Multiple safety layers are in place, but you make the final decision.