Director.y
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.
Features
- 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 retries.
- 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
Installation
From PyPI (Recommended)
pip install directory-agent
After installation, verify the dy command is available:
dy --version
Note: If the dy command isn't recognized, ensure Python's Scripts
directory is in your PATH.
From Source (For Development)
git clone https://github.com/raytonc/Director.y.git
cd Director.y
# Install in development mode
pip install -e .
Configuration
Run the interactive configuration wizard to set up your API key:
dy --configure
The 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).
Usage
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
dy
How It Works
Query Mode (Read-Only)
Ask questions like:
- "What's taking up the most space?"
- "How many PDFs are here?"
- "Which files were modified today?"
Flow:
- AI generates a read-only PowerShell script
- The script is validated
- It runs safely in the sandbox
- Results are summarized in plain English
Task Mode (With Approval)
Examples:
- "Organize files by type"
- "Move all PDFs to Documents"
- "Delete empty folders"
- "Rename photos with dates"
Flow:
- AI analyzes your request
- A read-only planning script is generated
- An execution script is produced
- You review and approve all changes
- The script executes in the sandbox
- Results are summarized
Safety Features
Multi-Layer Protection
- 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 -- PowerShell syntax checked before execution
- 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
Blocked Operations
- Registry access
- Process creation/execution
- Network requests
- Operations outside the sandbox
- Dangerous cmdlets (e.g.,
Invoke-Expression)
Architecture
Core Components
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
Workflow Overview
Query Flow
User Question → Query Agent → Validation → Execution → Summary → User
Task Flow
User Task → Planner Agent → Planning Script → Execution Plan
→ Executor Agent → Validation → Syntax Check → User Approval
→ Execute → Summary → User
Commands
In-App Commands
helpor/help-- Show helpquitorexit-- Exit Director.y/quitor/exit-- Alternative exit aliases
Keyboard Shortcuts
Tab-- Switch between Query and Task modesCtrl+C-- Cancel current operationCtrl+Q-- Quit Director.y
CLI Options
dy --help # Show help message
dy --version # Show version information
dy --configure # Configure API keys and settings
Development
Running Tests
pytest tests/ -v
Project Structure Highlights
- 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
Adding New Features
- Add system prompt to
src/directory/text/ - Create agent in
src/directory/agents/ - Add workflow in
src/directory/workflows.py - Add tests in
tests/
Requirements
- Windows (PowerShell required)
- Python 3.11+
- Must be run from directories under
C:\Users\*
Important: Director.y executes PowerShell scripts. Always review proposed changes before approving. Multiple safety layers are in place, but you make the final decision.
Metadata
Release files for directory-agent 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| directory_agent-1.0.3.tar.gz | 35.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| directory_agent-1.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 72.9 kB
Release files / directory_agent-1.0.3.tar.gz
| Download URL | directory_agent-1.0.3.tar.gz |
|---|---|
| Size | 35.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
976a8248029c231e7c18a77cc53039b3f546f80eeb0f9f97536c97134b3180cc
|
|
BLAKE2b-256 checksum How to use checksums |
7c68ec29e48faf759ddd0caddf4568c59526773619c5d2fc7e4da86d4442944b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.3
|
Release files / directory_agent-1.0.3-py3-none-any.whl
| Download URL | directory_agent-1.0.3-py3-none-any.whl |
|---|---|
| Size | 37.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3612054116a8229a9c5c6c526841f8bbde8de51252ce1428f7c9e2a6dd140d5b
|
|
BLAKE2b-256 checksum How to use checksums |
ef02ce12b57d0ea8254d4990cd456885a02d7198bc55b2cec7ded4b81b6a1539
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.3
|
Security for directory-agent 1.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.