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.
  • Two Modes
    • Query Mode: Read-only questions about your filesystem.
    • Task Mode: File operations that require explicit approval.
  • Safety-First Execution: Sandboxing, path validation, script classification, and multi-step validation.
  • Automatic Retry: AI automatically fixes PowerShell syntax errors.
  • Live Directory Tree: Auto-refreshing, interactive view of your working directory.

Quick Start

Developer Installation

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 (Anthropic Claude)
  2. Entering and validating your API key
  3. Choosing a model (claude-haiku-4-5, claude-sonnet-4-5, or claude-opus-4-5)
  4. Configuring timeouts and output limits

Your configuration will be saved to %APPDATA%\directory\config.toml (Windows) or ~/.config/directory/config.toml (Linux/Mac).


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

Configuration Options

Configuration is stored in TOML format (%APPDATA%\directory\config.toml on Windows).

Use dy --configure to set up or modify your configuration interactively.

Example configuration:

[global]
default_provider = "anthropic"
max_output_size = 100000     # Maximum script output size (bytes)
read_timeout = 60            # Timeout for read operations (seconds)
write_timeout = 300          # Timeout for write operations (seconds)

[providers.anthropic]
enabled = true
api_key = "sk-ant-api03-..."
model = "claude-sonnet-4-5"  # Model alias (haiku-4-5, sonnet-4-5, opus-4-5)
validated_at = "2025-12-02T14:30:00"

Note: Model aliases (e.g., "claude-sonnet-4-5") automatically map to the latest model versions, ensuring your app stays up-to-date as models evolve.


Development

Running Tests

pytest tests/ -v

Project Structure Highlights

  • Agents -- Specialized AI components for planning and execution
  • Prompt Text -- Stored in /text for maintainability
  • Execution Layer -- Validates and runs PowerShell scripts in a sandbox
  • 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+
  • Anthropic API Key
  • 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.1.tar.gz (33.1 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.1-py3-none-any.whl (33.2 kB view details)

Uploaded Python 3

File details

Details for the file directory_agent-1.0.1.tar.gz.

File metadata

  • Download URL: directory_agent-1.0.1.tar.gz
  • Upload date:
  • Size: 33.1 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.1.tar.gz
Algorithm Hash digest
SHA256 d8646150584adaa0c0ca68df446737aee716552567f0b8717ccc956f986cf7d9
MD5 79ebf789e855e9aa9d898d697431f8f9
BLAKE2b-256 2d596a3d1d00313b7994deb3b7f487116152a09c9c2556a7a5aca8eb531de48d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for directory_agent-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5053060ffc824d5ec437e3e6920181694f7e5110086a2c87e610d0a524cfefdb
MD5 946aecd8b8fa335807f48a03958a12b3
BLAKE2b-256 a5aa6d22c6450a15947eb78d43a0730b241ffa7dbfd7d3691d0baad685da3fd1

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