Skip to content

matt-grain/Claude-Library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Python 3.13+ MIT License Platform

πŸ“š Claude Library

A beautiful real-time markdown file watcher with live TUI dashboard

Watch your Claude projects, sync markdown files, and browse them in style.
All from a single command with a gorgeous terminal interface.


β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ πŸ“ MD SYNC  β€’  Markdown File Watcher                                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”Œβ”€ Configuration ──────────────┐ β”Œβ”€ Activity ───────────────────────────────────┐
β”‚ Watch   C:\Projects\MyProjectβ”‚ β”‚ 14:32:15 ● modified  docs/README.md          β”‚
β”‚ Mirror  C:\Projects\MD\md    β”‚ β”‚ 14:32:15 β—† index     142 files               β”‚
β”‚ Index   files.json           β”‚ β”‚ 14:31:02 ✚ created   notes/todo.md           β”‚
β”‚ Server  http://localhost:7777β”‚ β”‚ 14:30:45 ↓ sync      docs/api.md             β”‚
β”œβ”€ Statistics ────────────────── β”‚ 14:30:44 βœ– deleted   old/deprecated.md       β”‚
β”‚ Files in Index          142  β”‚ β”‚ 14:30:43 β†’ moved     drafts/idea.md          β”‚
β”‚ Files Synced             87  β”‚ β”‚                                              β”‚
β”‚ Events                   23  β”‚ β”‚                                              β”‚
β”‚ Uptime            00:05:32   β”‚ β”‚                                              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ ● Watching for changes...  β€’  Last: 3s ago                                   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

✨ Features

  • πŸ–₯️ Live TUI Dashboard β€” Beautiful real-time terminal interface powered by Rich
  • πŸ”„ Smart File Sync β€” Watches your project and mirrors .md files with intelligent debouncing
  • 🌐 Embedded Web Server β€” Browse your markdown files in the browser, no extra process needed
  • ⚑ Concurrent-Safe β€” Handles file locks gracefully when other tools are editing
  • 🎨 Color-Coded Events β€” Instantly see creates, modifies, deletes, and moves
  • πŸ“Š Real-Time Stats β€” Track synced files, events, uptime, and errors
  • πŸš€ Zero Config β€” Just point it at your project and go

πŸš€ Quick Start

Prerequisites

  • Python 3.13+
  • uv (recommended) or pip

Installation

git clone https://github.com/yourusername/claude-library.git
cd claude-library
uv sync

Usage

# Watch a project and start the web server
uv run watch.py /path/to/your/claude-project

# Open in browser
open http://localhost:7777

That's it! The dashboard will show you everything in real-time.

πŸ“– Options

Option Short Default Description
watch_dir β€” . Directory to watch for .md files
--mirror-to β€” ./md Local directory to sync files into
--out -o files.json Output index file
--port -p 7777 HTTP server port
--max-depth β€” unlimited Limit directory recursion depth
--prune β€” off Remove stale files from mirror
--no-tui β€” off Simple logging instead of TUI
--no-server β€” off Disable embedded HTTP server

Examples

# Basic usage - watch project, sync to ./md, serve on :7777
uv run watch.py ../MyProject

# Custom port and limited depth (useful for large projects)
uv run watch.py ../MyProject --port 8080 --max-depth 3

# Sync only, no web server
uv run watch.py ../MyProject --no-server

# Clean mode - remove files that no longer exist in source
uv run watch.py ../MyProject --prune

# Headless mode for CI/scripts
uv run watch.py ../MyProject --no-tui

🎯 Event Types

The dashboard shows different event types with distinct icons:

Icon Event Description
✚ created New file added
● modified File content changed
βœ– deleted File removed
β†’ moved File renamed/moved
↓ sync Initial sync copy
β—† index Index regenerated
βœ‚ prune Stale file removed
β—Œ skip File locked, will retry

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Source Project │────▢│   Watcher    │────▢│  Mirror (./md)  β”‚
β”‚  (your files)   β”‚     β”‚  (watchdog)  β”‚     β”‚  (local copy)   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
                               β–Ό
                        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                        β”‚  files.json  β”‚
                        β”‚   (index)    β”‚
                        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
                               β–Ό
                        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                        β”‚  Web Server  │────▢│    Browser      β”‚
                        β”‚   (:7777)    β”‚     β”‚  (index.html)   β”‚
                        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Development

# Install dev dependencies
uv sync

# Run linting
uv run ruff check watch.py

# Run type checking
uv run pyright watch.py

# Run security scan
uv run bandit watch.py

# Format code
uv run ruff format watch.py

πŸ“„ License

MIT License - do whatever you want with it.


Made with β˜• and πŸ€– by humans and Claude

Releases

No releases published