Skip to main content

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:

  1. Selecting your AI provider
  2. Entering and validating your API key
  3. Choosing a model
  4. 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:

  1. AI generates a read-only PowerShell script
  2. The script is validated
  3. It runs safely in the sandbox
  4. 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:

  1. AI analyzes your request
  2. A read-only planning script is generated
  3. An execution script is produced
  4. You review and approve all changes
  5. The script executes in the sandbox
  6. Results are summarized

Safety Features

Multi-Layer Protection

  1. Sandboxing -- Never operates outside the directory you run it from
  2. Path Validation -- All paths must stay within the sandbox
  3. Script Classification -- Read-only, write, or unsafe
  4. Syntax Validation -- PowerShell syntax checked before execution
  5. Manual Approval -- Required for all write operations
  6. Recycle Bin Safety -- Deletions are soft (moved to a temp location)
  7. Output Size Limits -- Default: 100 KB
  8. 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

  • help or /help -- Show help
  • quit or exit -- Exit Director.y
  • /quit or /exit -- Alternative exit aliases

Keyboard Shortcuts

  • Tab -- Switch between Query and Task modes
  • Ctrl+C -- Cancel current operation
  • Ctrl+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

  1. Add system prompt to src/directory/text/
  2. Create agent in src/directory/agents/
  3. Add workflow in src/directory/workflows.py
  4. 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

directory_agent-1.0.2.tar.gz (35.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

directory_agent-1.0.2-py3-none-any.whl (37.6 kB view details)

Uploaded Python 3

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

Hashes for directory_agent-1.0.2.tar.gz
Algorithm Hash digest
SHA256 a53239d9d7fca78c73f9ca91dc17b942c1d3505e0710da3634af42e3db1030c4
MD5 991e99d4ffc920ce9ca5d213cf280cbe
BLAKE2b-256 8f12ec42708904b433c595bef493b90dc4669abd458563607371196b40654c2c

See more details on using hashes here.

File details

Details for the file directory_agent-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for directory_agent-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 abcd7843174e5b9ff59beb6f604020e3a52cfd4ad9f9fc7b657a9afc056bb59c
MD5 c308349f7ac3dacc89b6ca90070004e5
BLAKE2b-256 9b53a4defd3016c1355af12b16add366398943ff60f313492e6e974ce758aacc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page