This repository has ben archived and won't be maintained. Please check OneShotPrompt instead.
AI.FileOrganizer is an AI-powered command-line tool that helps you organize files and folders using natural language instructions.
It is built with the Microsoft Agent Framework and uses pluggable AI providers to interpret intent, select the right tools, and safely execute file operations.
- Accepts natural language requests from a CLI.
- Uses an AI agent to classify intent and choose appropriate tools.
- Performs file and folder operations through focused tool modules.
- Supports multiple AI backends through a provider abstraction layer.
flowchart LR
User["User (Natural Language Request)"] --> CLI["AI.FileOrganizer.CLI"]
CLI --> Agent["Microsoft Agent Framework Orchestrator"]
Agent --> Selector["ToolSelector"]
Selector --> FileTools["FileTools"]
Selector --> FolderTools["FolderTools"]
Agent --> Providers["AI Provider Layer\n(OpenAI / Azure OpenAI / Ollama)"]
FileTools --> FS["Local File System"]
FolderTools --> FS
AI.FileOrganizer: Core library containing intent handling and tool selection.AI.FileOrganizer.CLI: Command-line host that runs the agent workflow.
Prebuilt binaries are published for each tagged release in GitHub Releases:
AI.FileOrganizer-win-x64.zipAI.FileOrganizer-linux-x64.zipAI.FileOrganizer-osx-arm64.zip
Download from: Releases
Extract the archive for your platform into any folder.
Open config.yaml in the extracted folder and set the provider you want to use.
Example:
OpenAI:
ApiKey: "your-api-key"
Model: "gpt-4o-mini"Windows (win-x64):
.\AI.FileOrganizer.CLI.exeLinux (linux-x64):
chmod +x ./AI.FileOrganizer.CLI
./AI.FileOrganizer.CLImacOS Apple Silicon (osx-arm64):
chmod +x ./AI.FileOrganizer.CLI
./AI.FileOrganizer.CLIThe app will prompt you to choose a provider and then accept natural-language file organization requests.
The recommended scheduling model is to run the CLI once per job and let the operating system handle recurrence.
Why this design:
- The current app is a console host, not a Windows service.
- OS schedulers are more reliable for restarts, missed runs, and machine reboots.
- Each run stays deterministic: load config, execute one prompt, exit.
Add one or more jobs to config.yaml:
Jobs:
- Name: "downloads-cleanup"
Prompt: "Organize files in Downloads by type"
Provider: "OpenAI"
AutoApprove: true
PersistMemory: false
ThinkingLevel: "low"
Schedule: "Daily at midnight"
Enabled: trueGenerate a sample job block:
dotnet run --project AI.FileOrganizer.CLI/AI.FileOrganizer.CLI.csproj -- --job-template downloads-cleanupCreate a job interactively and write it into config.yaml:
dotnet run --project AI.FileOrganizer.CLI/AI.FileOrganizer.CLI.csproj -- --create-jobRun a job once:
dotnet run --project AI.FileOrganizer.CLI/AI.FileOrganizer.CLI.csproj -- --job downloads-cleanupList configured jobs:
dotnet run --project AI.FileOrganizer.CLI/AI.FileOrganizer.CLI.csproj -- --list-jobsPrint the Windows Task Scheduler action for a job:
dotnet run --project AI.FileOrganizer.CLI/AI.FileOrganizer.CLI.csproj -- --task-command downloads-cleanupYou can also use the wrapper scripts instead of the full dotnet run command.
PowerShell:
./scripts/ai-fileorganizer.ps1 create-job
./scripts/ai-fileorganizer.ps1 list-jobs
./scripts/ai-fileorganizer.ps1 job-template downloads-cleanup
./scripts/ai-fileorganizer.ps1 run-job downloads-cleanup
./scripts/ai-fileorganizer.ps1 task-command downloads-cleanupLinux/macOS:
chmod +x ./scripts/ai-fileorganizer.sh
./scripts/ai-fileorganizer.sh create-job
./scripts/ai-fileorganizer.sh list-jobs
./scripts/ai-fileorganizer.sh job-template downloads-cleanup
./scripts/ai-fileorganizer.sh run-job downloads-cleanup
./scripts/ai-fileorganizer.sh task-command downloads-cleanupFor unattended execution, set AutoApprove: true. If a job triggers an approval-gated tool and AutoApprove is false, the run will fail instead of hanging.
Create a task that runs the CLI on your preferred cadence. Example action:
dotnet run --project "C:\path\to\AI.FileOrganizer.CLI\AI.FileOrganizer.CLI.csproj" -- --job downloads-cleanupIf you publish the app first, point Task Scheduler to the published executable instead of dotnet run.
dotnet build AI.FileOrganizer.slnx
dotnet run --project AI.FileOrganizer.CLI/AI.FileOrganizer.CLI.csprojThis project is licensed under the MIT License.
Powered by Microsoft Agent Framework.