AI-powered filesystem management via natural language
Project description
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file directory_agent-1.0.2.tar.gz.
File metadata
- Download URL: directory_agent-1.0.2.tar.gz
- Upload date:
- Size: 35.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a53239d9d7fca78c73f9ca91dc17b942c1d3505e0710da3634af42e3db1030c4
|
|
| MD5 |
991e99d4ffc920ce9ca5d213cf280cbe
|
|
| BLAKE2b-256 |
8f12ec42708904b433c595bef493b90dc4669abd458563607371196b40654c2c
|
File details
Details for the file directory_agent-1.0.2-py3-none-any.whl.
File metadata
- Download URL: directory_agent-1.0.2-py3-none-any.whl
- Upload date:
- Size: 37.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
abcd7843174e5b9ff59beb6f604020e3a52cfd4ad9f9fc7b657a9afc056bb59c
|
|
| MD5 |
c308349f7ac3dacc89b6ca90070004e5
|
|
| BLAKE2b-256 |
9b53a4defd3016c1355af12b16add366398943ff60f313492e6e974ce758aacc
|