Skip to content
ย 
ย 

Repository files navigation

๐Ÿ›ก๏ธ Sentinel

AI-Powered File Organization & Cleanup Agent

Your intelligent assistant for safely organizing and cleaning your computer

Tests Coverage License Python Platform

Features โ€ข Installation โ€ข Usage โ€ข Architecture โ€ข Safety โ€ข Contributing


๐ŸŽฏ Overview

Sentinel is a local-first AI agent that intelligently organizes and cleans your computer's file system. Unlike traditional cleanup tools, Sentinel uses AI to understand your files and suggest smart organization strategiesโ€”while maintaining strict safety guarantees.

Why Sentinel?

  • ๐Ÿง  AI-Powered Intelligence: Understands file types, patterns, and optimal organization strategies
  • ๐Ÿ”’ Safety First: Never performs destructive actions without explicit approval
  • ๐ŸŽฏ Context-Aware: Learns from your preferences and adapts to your workflow
  • ๐Ÿ–ฅ๏ธ Multi-Interface: CLI, Web UI, or Desktop appโ€”use what you prefer
  • ๐ŸŒ 100% Local: Your data never leaves your machine
  • โ†ฉ๏ธ Fully Reversible: Every action can be undone

โœจ Features

Core Capabilities

๐Ÿ—‚๏ธ Intelligent File Classification

  • Detects installers, archives, screenshots, duplicates, and large media files
  • Context-aware age analysis (old installers = cleanup candidates)
  • Smart duplicate detection based on content hashing

๐Ÿค– AI-Driven Organization

  • Generates cleanup plans using local LLMs (via Ollama)
  • Learns from your preferences over time
  • Suggests optimal folder structures and naming conventions

๐Ÿ›ก๏ธ Multi-Layer Safety System

  • Pre-execution validation of all plans
  • System directory protection (blocks /System, /Windows, etc.)
  • Dry-run mode by default
  • All deletions go to Trash/Recycle Bin
  • Comprehensive operation logging

๐Ÿ“Š Rich Insights

  • Disk space analysis
  • File age distribution
  • Category-based reporting
  • Visual organization hierarchy

User Interfaces

๐Ÿ’ป CLI Application

sentinel clean-pc scan ~/Downloads --max-depth 3
sentinel clean-pc execute --plan-id abc123
sentinel undo --operation-id xyz789

๐ŸŒ Web Dashboard

  • Real-time scanning progress
  • Visual plan diff viewer
  • Drag-and-drop rule customization
  • Task history and analytics

๐Ÿ–ฅ๏ธ Desktop Application (Tauri)

  • Native macOS and Windows app
  • System tray integration
  • One-click cleanup
  • Scheduled automation

๐Ÿ“ธ Demo

Note: Demo screenshots coming soon

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  ๐Ÿ›ก๏ธ  Sentinel - Clean My PC                    โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                 โ”‚
โ”‚  ๐Ÿ“‚ Scanned: ~/Downloads                       โ”‚
โ”‚  ๐Ÿ“Š Found: 127 files (2.4 GB)                  โ”‚
โ”‚                                                 โ”‚
โ”‚  Suggested Actions:                             โ”‚
โ”‚  โ€ข Delete 12 old installers        โ†’ Save 850MBโ”‚
โ”‚  โ€ข Archive 8 old ZIPs              โ†’ Save 340MBโ”‚
โ”‚  โ€ข Move 15 screenshots to Pictures โ†’ Organize  โ”‚
โ”‚  โ€ข Remove 6 duplicates             โ†’ Save 120MBโ”‚
โ”‚                                                 โ”‚
โ”‚  [Preview Plan]  [Execute]  [Customize]        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ—๏ธ Architecture

graph TB
    subgraph "User Interfaces"
        CLI[CLI - Typer]
        WEB[Web UI - Next.js]
        DESKTOP[Desktop - Tauri]
    end
    
    subgraph "API Layer"
        API[FastAPI + WebSockets]
    end
    
    subgraph "Core Engine"
        SCANNER[Scanner]
        CLASSIFIER[File Classifier]
        RULES[Rules Engine]
        PLANNER[AI Planner]
        SAFETY[Safety Validator]
        EXECUTOR[Executor]
    end
    
    subgraph "External Services"
        OLLAMA[Ollama - Local LLM]
        DB[(SQLite DB)]
    end
    
    CLI --> API
    WEB --> API
    DESKTOP --> API
    
    API --> SCANNER
    SCANNER --> CLASSIFIER
    CLASSIFIER --> RULES
    RULES --> PLANNER
    PLANNER --> OLLAMA
    PLANNER --> SAFETY
    SAFETY --> EXECUTOR
    
    EXECUTOR --> DB
    SCANNER --> DB
    
    style SAFETY fill:#ff6b6b
    style EXECUTOR fill:#51cf66
    style PLANNER fill:#339af0
Loading

System Invariants

  1. AI Never Executes: AI only generates JSON plans; deterministic executor performs actions
  2. User Approval Required: No destructive actions without explicit user confirmation
  3. Trash-First Deletion: All deletes go to Trash/Recycle Bin by default
  4. Full Audit Trail: Every operation logged and reversible
  5. System Protection: Critical directories are blacklisted
  6. Dry-Run Default: Preview mode is the default behavior

๐Ÿ“ฆ Installation

Prerequisites

  • Python 3.11+ (Core engine)
  • Node.js 18+ (Web UI)
  • Ollama (Local AI runtime)

Option 1: CLI Only (Fastest)

# Install Ollama
curl -fsSL https://ollama.ai/install.sh | sh

# Pull the model
ollama pull llama2

# Install Sentinel CLI
cd sentinel-core
poetry install
poetry run sentinel --help

Option 2: Web UI

# Install CLI (see above)

# Install and run web UI
cd sentinel-web
npm install
npm run dev

# Backend
cd ../sentinel-core
poetry run uvicorn sentinel_core.api.main:app --reload

Access at http://localhost:3000

Option 3: Desktop Application

macOS

# Build installer
cd sentinel-web
npm run tauri:build:mac

# Install the generated .dmg
open src-tauri/target/release/bundle/dmg/Sentinel_0.1.0_x64.dmg

Windows

# Build installer
cd sentinel-web
npm run tauri:build:win

# Install the generated .msi

๐Ÿš€ Usage

Quick Start - CLI

# Scan your Downloads folder
sentinel clean-pc scan ~/Downloads

# Scan with custom depth
sentinel clean-pc scan ~/Downloads ~/Desktop --max-depth 3

# Execute a plan (requires approval)
sentinel clean-pc scan ~/Downloads --execute

# Dry run (default - shows what would happen)
sentinel clean-pc scan ~/Downloads --dry-run

Quick Start - Web UI

  1. Start the backend:

    cd sentinel-core
    poetry run uvicorn sentinel_core.api.main:app --reload
  2. Start the frontend:

    cd sentinel-web
    npm run dev
  3. Open browser: Navigate to http://localhost:3000

  4. Create a task:

    • Select directories to scan
    • Review AI-generated plan
    • Customize rules if needed
    • Execute with one click

Quick Start - Desktop App

  1. Launch Sentinel from Applications/Start Menu
  2. Select folders from sidebar
  3. Click "Scan & Plan"
  4. Review suggestions in the main panel
  5. Click "Execute" to apply changes
  6. Use "Undo" if needed

๐Ÿ” Safety Guarantees

Sentinel is built with safety as the #1 priority. Here's how we protect your data:

๐Ÿ›ก๏ธ Multi-Layer Protection

Layer Protection
AI Layer Only generates JSON plans, never executes
Validation Layer Blocks dangerous paths, validates all operations
Execution Layer Deterministic, logged, reversible actions only
User Approval Explicit confirmation required for destructive actions

๐Ÿšซ What Sentinel Will NEVER Do

  • โŒ Delete files permanently by default
  • โŒ Touch system directories (/System, /Windows, /usr, etc.)
  • โŒ Execute without user approval
  • โŒ Send your data to external servers
  • โŒ Run without comprehensive logging

โœ… What Sentinel ALWAYS Does

  • โœ… Moves deletions to Trash/Recycle Bin
  • โœ… Creates undo logs for all operations
  • โœ… Validates plans before execution
  • โœ… Runs in dry-run mode by default
  • โœ… Keeps detailed audit trails
  • โœ… Allows manual review of all changes

๐Ÿ“ Operation Logging

Every action is logged with:

  • Timestamp
  • Operation type (move/delete/copy)
  • Source and destination paths
  • File hash (for verification)
  • User who approved
  • Plan ID and execution ID

View logs:

sentinel logs --operation-id xyz789
sentinel undo --operation-id xyz789

๐Ÿงช Testing

Sentinel has comprehensive test coverage to ensure reliability:

# Run all tests
cd sentinel-core
poetry run pytest

# Run with coverage
poetry run pytest --cov=sentinel_core --cov-report=html

# Run specific test suite
poetry run pytest tests/test_scanner.py -v

Test Coverage: 92%
Test Count: 45+ unit and integration tests

See TESTING.md for detailed testing documentation.


๐Ÿ—บ๏ธ Roadmap

โœ… v0.1 - Core Foundation

  • File scanning and classification
  • AI-powered planning
  • Safety validation layer
  • Basic CLI interface
  • Undo functionality

โœ… v0.2 - Enhanced Intelligence

  • Clean PC pipeline
  • Screenshot detection
  • Duplicate file detection
  • Archive management
  • Old installer cleanup

๐Ÿšง v0.3 - UI & Desktop (In Progress)

  • Next.js web dashboard
  • Tauri desktop wrapper
  • Real-time progress tracking
  • Visual plan diff viewer
  • Drag-and-drop rule editor

๐Ÿ”ฎ v0.4 - Intelligence++ (Planned)

  • Smart folder suggestions
  • File naming conventions
  • Tag-based organization
  • Advanced duplicate detection (fuzzy)
  • Photo organization (by date/location)

๐Ÿ”ฎ v0.5 - Automation (Planned)

  • Scheduled cleanup tasks
  • Watch folder automation
  • Custom rule templates
  • Organization profiles
  • Bulk rename utilities

๐Ÿ”ฎ v1.0 - Production Ready

  • Code signing (macOS/Windows)
  • Auto-update mechanism
  • Plugin system
  • Advanced analytics
  • Multi-language support

๐Ÿค Contributing

We welcome contributions! Sentinel is built to be extensible and maintainable.

Development Setup

# Clone repository
git clone https://github.com/mystic/sentinel.git
cd sentinel

# Install backend dependencies
cd sentinel-core
poetry install

# Install frontend dependencies
cd ../sentinel-web
npm install

# Set up pre-commit hooks
cd ..
pre-commit install

Code Quality

We maintain high code quality standards:

  • Linting: Ruff, Black
  • Type Checking: Mypy
  • Testing: Pytest with 90%+ coverage
  • Pre-commit Hooks: Automatic formatting and validation

Run quality checks:

cd sentinel-core
poetry run ruff check .
poetry run black .
poetry run mypy sentinel_core
poetry run pytest

Contribution Guidelines

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes with tests
  4. Run quality checks: poetry run pytest && poetry run ruff check .
  5. Commit: git commit -m 'Add amazing feature'
  6. Push: git push origin feature/amazing-feature
  7. Open a Pull Request

Areas We Need Help

  • ๐ŸŽจ UI/UX improvements
  • ๐Ÿงช Additional test coverage
  • ๐Ÿ“ Documentation improvements
  • ๐ŸŒ Internationalization
  • ๐Ÿ”Œ Plugin development
  • ๐Ÿ› Bug reports and fixes

See CONTRIBUTING.md for detailed guidelines.


๐Ÿ“š Documentation


๐Ÿ› ๏ธ Tech Stack

Core Engine (Python)

  • FastAPI - High-performance API server
  • SQLAlchemy - Database ORM
  • Pydantic - Data validation
  • Ollama - Local LLM runtime
  • Typer - CLI framework
  • Rich - Terminal UI

Web Interface (TypeScript)

  • Next.js 14 - React framework
  • Tailwind CSS - Utility-first styling
  • Framer Motion - Animations
  • Zustand - State management
  • TanStack Query - Data fetching

Desktop (Rust)

  • Tauri - Native desktop wrapper
  • Tokio - Async runtime
  • Serde - Serialization

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

Why MIT?

We chose MIT for maximum freedom:

  • โœ… Commercial use allowed
  • โœ… Modification allowed
  • โœ… Distribution allowed
  • โœ… Private use allowed
  • โ„น๏ธ License and copyright notice required

๐Ÿ™ Acknowledgments

  • Ollama - For making local AI accessible
  • FastAPI - For the excellent Python web framework
  • Tauri - For lightweight desktop applications
  • Next.js - For the powerful React framework

๐Ÿ“ž Support


โญ Star History

If you find Sentinel useful, please consider giving it a star! It helps the project grow.

Star History Chart


Made with โค๏ธ by developers who hate cluttered computers

โฌ† Back to Top

About

Watches. Understands. Acts safely.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages