The Ultimate Command-Line File Tagging System - Transform chaos into order with intelligent file organization
Project description
๐ท๏ธ TagManager
The Ultimate Command-Line File Tagging System
Transform chaos into order with intelligent file organization
Features โข Installation โข Quick Start โข Commands โข Examples
๐ Why TagManager?
Folder hierarchies force you to put a file in one place. Tags let a file belong to everything it actually is.
# One command to tag โ one command to find
tm add report.pdf --tags work client-a q1 2024 final
tm search --tags work q1 # instantly surface it
TagManager stores tags in a lightweight JSON sidecar (~/file_tags.json) โ no database, no daemon required โ and ships a full command set for search, bulk operations, smart filtering, an interactive network graph, and a file-system watcher that tags new files automatically.
โจ Features
| Category | What you get |
|---|---|
| Core | Add/remove/search tags, fuzzy path search, list & tree views |
| Bulk | Mass-tag with glob patterns, retag, bulk-remove โ all with --dry-run |
| Auto-tag | Extension-based tag suggestions (60+ file types built-in) |
| Aliases | Normalize tag variants: py โ python, js โ javascript |
| Presets | Save named tag bundles and apply them in one flag |
| Filters | Duplicate sets, orphans, similarity (Jaccard), clusters, isolated files |
| Stats | Tag frequency, co-occurrence, ASCII bar charts & histograms |
| Visualizer | Interactive 2D/3D network graph in your browser โ click to open files |
| Watch mode | Auto-tag files the moment they land in a directory |
| Move tracking | tm mv keeps tag records in sync when you rename files |
| Config | Full dot-notation config system with export/import |
| Shell completion | Tab-complete tag names, presets, and alias names |
๐ Installation
pip install tagmanager-cli
Commands are available as both tm (short) and tagmanager (long form).
Optional: Watch mode
Watch mode requires watchdog:
pip install tagmanager-cli[watch]
# or separately
pip install watchdog
Install from source
git clone https://github.com/davidtbilisi/TagManager.git
cd TagManager
pip install -e .
โก Quick Start
# Tag a file (auto-tags by extension too)
tm add main.py --tags backend core
# Tag everything matching a glob
tm bulk add "src/**/*.py" --tags python
# Find files
tm search --tags backend core # either tag
tm search --tags backend --match-all core # both tags
# Visual overview
tm ls --tree
tm tags --cloud
tm stats --chart
# Interactive network graph (opens in browser)
tm graph
# Watch a directory โ auto-tag as files arrive
tm watch ~/Downloads --tags inbox
๐ Commands
tm add โ Tag files
tm add <file> --tags <tag> [<tag>...] # basic
tm add <file> --tags python --preset webproject # combine with preset
tm add <file> --no-auto # skip extension-based auto-tags
tm add <file> --no-aliases # skip alias resolution
tm search โ Find files
tm search --tags python web # files with EITHER tag
tm search --tags python --match-all # files with ALL listed tags
tm search --path /projects/ # by path fragment
tm search --tags python --exact # exact tag match (no fuzzy)
tm ls โ List tagged files
tm ls # flat table
tm ls --tree # directory tree with inline tags
tm tags โ Explore tags
tm tags # list all tags
tm tags --search py # filter tags by name
tm tags --cloud # frequency cloud
tm tags --where python # which files carry this tag
tm stats โ Analytics
tm stats # summary
tm stats --chart # ASCII bar charts
tm stats --tag python # deep-dive on one tag (co-occurrence, file types)
tm graph โ Interactive network visualizer
Opens a self-contained HTML graph in your default browser.
tm graph # tag co-occurrence graph, 2D
tm graph --3d # start in 3D (toggle button in UI too)
tm graph --mode file # file similarity graph (Jaccard)
tm graph --mode mixed # bipartite fileโtag graph
tm graph --export gexf # also export tag_network.gexf (Gephi)
tm graph --export graphml # for Cytoscape / yEd
tm graph --min-weight 2 # only show edges with โฅ2 co-occurrences
tm graph --output ~/graph.html # save to a specific path
In the browser UI:
- Sidebar with 10 live filters (search, tag/extension multi-select, weight & degree sliders, cluster highlight, color-by)
- 2D / 3D toggle โ WebGL via Three.js, handles thousands of nodes
- Click any file node โ opens it in your OS file explorer
- Download GEXF / GraphML buttons (embedded, no server needed)
tm watch โ Auto-tag new files
Monitors a directory with watchdog and tags files as they arrive.
tm watch # watch current dir
tm watch ~/Downloads # watch a specific dir
tm watch . --tags inbox # always add "inbox" to every new file
tm watch . --preset webproject # apply a saved preset
tm watch . --no-auto # skip extension auto-tagging
tm watch . --clean-on-delete # remove tag entry when file is deleted
tm watch . --no-recursive # top-level only
tm watch . --ignore "*.log" # extra ignore patterns
tm watch . --plain # plain text output (no Rich live display)
Rich live display shows a colour-coded event log (โ created, โ moved, โ deleted) with resolved tags. Press Ctrl+C to stop.
tm filter โ Smart analysis
tm filter duplicates # files with identical tag sets
tm filter orphans # files with no tags
tm filter similar <file> # files similar to this one (Jaccard)
tm filter clusters # group files by shared tag
tm filter isolated # files that share few tags with others
tm bulk โ Mass operations
tm bulk add "*.py" --tags python # tag by glob
tm bulk remove --tag deprecated # remove a tag from all files
tm bulk retag --from js --to javascript # rename a tag everywhere
# All bulk commands support --dry-run
Aliases, Presets, Move tracking
# Aliases โ normalize tag variants
tm alias add py python
tm alias list
tm alias remove py
# Presets โ named tag bundles
tm preset save webproject --tags python django web
tm preset apply webproject app.py
tm preset list
# Move tracking โ keep the DB in sync
tm mv old/path.py new/path.py
tm clean # remove entries for deleted files
tm clean --dry-run # preview
Config
tm config list # all settings
tm config set display.emojis false
tm config set search.fuzzy_threshold 0.8
tm config export --file settings.json
tm config import team_settings.json
tm config reset # back to defaults
๐จ Examples
Network graph
Tag co-occurrence network โ 42 nodes, 180 edges
Sidebar filters: search ยท tag multiselect ยท min-weight slider ยท degree range
color-by cluster ยท highlight cluster ยท show/hide node types
2D โ 3D toggle | Download GEXF | Download GraphML
Click file node โ opens in Finder/Explorer
Watch mode output
Watching: /home/user/Downloads
Recursive: True | Auto-tag: True | Clean-on-delete: False
Always add tags: ['inbox']
Press Ctrl+C to stop.
[14:02:11] โ created โ report_q1.pdf [inbox, pdf, document]
[14:02:45] โ created โ script.py [inbox, python]
[14:03:10] โ moved โ script.py โ processed/script.py
Tag cloud
โ๏ธ Tag Cloud
โ
python(15) โ web(8) โ documentation(5) โข config(3) ยท backup(1)
Tree view
โโโ ๐ projects/
โโโ ๐ backend/
โ โโโ ๐ api.py ๐ท๏ธ [python, web, api, core]
โโโ ๐ docs/
โโโ ๐ README.md ๐ท๏ธ [docs, markdown]
๐๏ธ Architecture
tagmanager/
โโโ cli.py # Typer CLI โ all commands registered here
โโโ app/
โโโ add/ # tm add
โโโ bulk/ # tm bulk
โโโ filter/ # tm filter
โโโ search/ # tm search
โโโ stats/ # tm stats
โโโ graph/ # tm graph (HTML generator, GEXF/GraphML export)
โโโ watch/ # tm watch (watchdog integration)
โโโ alias/ # tm alias
โโโ preset/ # tm preset
โโโ autotag/ # extension โ tag mappings
โโโ move/ # tm mv / tm clean
โโโ visualization/ # tree, cloud, ASCII charts
โโโ config/ # tm config
โโโ helpers.py # load_tags() / save_tags() โ atomic JSON I/O
Storage: ~/file_tags.json (path configurable). Plain JSON โ easy to inspect, back up, or version-control.
๐งช Testing
pytest tests/ -v # full suite (406 tests)
pytest tests/ --cov=tagmanager # with coverage
pytest tests/test_graph_service.py -v # graph module only
pytest tests/test_watch_service.py -v # watch module only
406 tests across 21 test files. Watch mode integration tests require pip install watchdog.
๐ค Contributing
- Fork the repo
- Create a feature branch
- Add tests
- Open a PR
Bug reports and feature requests: GitHub Issues
๐ License
MIT โ see LICENSE.
โญ Star this repo if TagManager helps you stay organized!
Made by David Chincharashvili โข Built with Typer and Rich
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tagmanager_cli-1.4.0.tar.gz.
File metadata
- Download URL: tagmanager_cli-1.4.0.tar.gz
- Upload date:
- Size: 61.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
737dd5bb2b7906a72fd5e033df4e7cdfaa1f0e49cf7cf2738cb0f4d5c054bd9d
|
|
| MD5 |
c3a3b7bf91e6e8a08faeef3c82e1b186
|
|
| BLAKE2b-256 |
8f866732db1987d1db576e8757c7a74a093e488bd693c252dfdefbe044a62557
|
File details
Details for the file tagmanager_cli-1.4.0-py3-none-any.whl.
File metadata
- Download URL: tagmanager_cli-1.4.0-py3-none-any.whl
- Upload date:
- Size: 75.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c0165c84ff49dda8912519ad5eb1835e2160237baaf77783e506b0b6585b4c35
|
|
| MD5 |
151173cc469368a987d9b54a228651da
|
|
| BLAKE2b-256 |
aed9425ff6a3abbf4980f2cf20d0fe3fd90077a4b9e2a1213e8ed00a15395b27
|