indytag 0.0.0-stage → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,15 @@
1
+ ISC License
2
+
3
+ Copyright (c) 2026 LuxDev
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted, provided that the above
7
+ copyright notice and this permission notice appear in all copies.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
10
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
12
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
14
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15
+ PERFORMANCE OF THIS SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,137 @@
1
- # Temporary Holding Version
1
+ # indytag
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Tag paths in a tree, turn those marks into durable artifacts agents can consume,
4
+ then act on the inventory later.
5
+
6
+ 1. **Tag** — pick files/folders and assign labels (`project`, `skill`, `vault`, … or custom).
7
+ 2. **Write rules + indexes** — emit ignore rules, per-tag files, `index.md`, and a `.indytag/` inventory.
8
+ 3. **Act** — import that inventory (or scan a scope) and move / recycle / delete / zip / csv / meta / dedupe / atomize.
9
+
10
+ One Python file, standard library only. The npm package is a thin launcher: it
11
+ finds a Python 3 interpreter and hands it the real terminal, so the interactive
12
+ selector keeps its raw-mode keys, mouse and animation.
13
+
14
+ ```sh
15
+ npm i -g indytag
16
+ # or: npm i -g @agnamo/indytag
17
+ indytag .
18
+ ```
19
+
20
+ ## What it writes
21
+
22
+ Run against a folder and it produces:
23
+
24
+ | Path | What it is |
25
+ |---|---|
26
+ | `.ignore`, `.aiignore` | gitignore-syntax rules for the paths you tagged |
27
+ | `.indytag/tags.<tag>` | one rule file per tag (e.g. `tags.project`, `tags.vault`) |
28
+ | `index.md` | layered directory index for humans and agents |
29
+ | `.indytag/manifest.json` | counts, tag map and file locations |
30
+ | `.indytag/inventory/` | `index.md`, `manifest.json`, `list.csv` |
31
+ | `.indytag/index/` | `index-all.md`, `manifest-all.json` (full depth) |
32
+
33
+ Everything except `index.md` and `.ignore` lives inside the hidden `.indytag/`
34
+ container, so the folder you aimed it at stays readable.
35
+
36
+ ## Default tags
37
+
38
+ ```
39
+ project skill agent archive review private vault app frozen stale
40
+ ```
41
+
42
+ Files written: `.indytag/tags.project`, `.indytag/tags.skill`, … one per tag.
43
+
44
+ Add your own with `--tags` (comma list). Custom names become `tags.<custom>` the same way:
45
+
46
+ ```sh
47
+ indytag . --tags project,skill,mine,yours
48
+ ```
49
+
50
+ ## Interactive selector
51
+
52
+ ```
53
+ indytag . # tag + index, selector first
54
+ indytag . --no-select --yes # scripted run, no prompts
55
+ ```
56
+
57
+ | Key | Action |
58
+ |---|---|
59
+ | `Space` | tag / untag the current path with the active tag |
60
+ | `Tab`, `1`–`9` | switch the active tag (first nine presets) |
61
+ | `a` / `n` / `i` | tag all / clear all / invert for the active tag |
62
+ | `/` | filter; `Enter` keeps it |
63
+ | `←` `→` `e` `c` | collapse, expand, expand all, collapse all |
64
+ | `Backspace` / `0` | clear tags on the current path |
65
+ | `Enter` | save and continue |
66
+ | `q` / `Esc` | cancel, write nothing |
67
+
68
+ ## Import a previous run
69
+
70
+ Point `--import` at a `manifest.json`, `index.md` or `list.csv` written by
71
+ indytag, or by the standalone `index.py` that shares the same manifest shape.
72
+ The format is detected from the content, so the file name does not matter.
73
+
74
+ ```sh
75
+ indytag --import .indytag/inventory/manifest.json # asks what to do
76
+ indytag --import index.md --action list # just print them
77
+ indytag --import index.md --action csv --target picks.csv
78
+ indytag --import manifest-all.json --action zip --target bundle.zip
79
+ indytag --import index.md --action move --target ../keep # keeps layout
80
+ indytag --import index.md --action recycle --pick 'build/*'
81
+ ```
82
+
83
+ | Action | Effect |
84
+ |---|---|
85
+ | `list` | print the imported paths, change nothing |
86
+ | `move` | move into `--target`, root-relative layout preserved |
87
+ | `recycle` | Recycle Bin on Windows, `.indytag/trash/<stamp>/` elsewhere |
88
+ | `delete` | permanent removal of the imported paths |
89
+ | `zip` | one archive, root-relative entry names |
90
+ | `csv` | imported paths only: path, kind, size, modified, tags |
91
+ | `meta` | full scope walk → rich CSV (size, times, mode, sha256) |
92
+ | `dedupe` | byte-match duplicates in a scope; recycle extras |
93
+ | `atomize` | byte-match duplicates in a scope; permanent delete extras |
94
+
95
+ ### meta
96
+
97
+ One row per file. Does not need an import when you pass a scope:
98
+
99
+ ```sh
100
+ indytag --action meta --scope other --other ./tree --target meta.csv
101
+ indytag --action meta --scope workspace --no-hash # skip sha256
102
+ indytag --action meta --scope drives --drive C:\ --drive Z:\
103
+ ```
104
+
105
+ Columns: `path, name, parent, kind, extension, size_bytes, size_human,
106
+ created_utc, modified_utc, accessed_utc, mode, sha256, is_symlink,
107
+ symlink_target, exists`.
108
+
109
+ ### dedupe vs atomize
110
+
111
+ Both scan a scope (`workspace` / `drives` / `all` / `other`), group files by
112
+ size then sha256, keep one copy per set, remove the rest.
113
+
114
+ | | `dedupe` | `atomize` |
115
+ |---|---|---|
116
+ | extras go to | Recycle Bin (or `.indytag/trash/`) | permanent delete — **no recycle** |
117
+ | confirm | yes (unless `--yes`) | yes, stronger wording (unless `--yes`) |
118
+
119
+ ```sh
120
+ indytag --action dedupe --scope other --other ./tree --dry-run
121
+ indytag --action atomize --scope other --other ./tree --yes
122
+ ```
123
+
124
+ Safety: absolute paths, drive letters and `..` segments are refused and
125
+ counted, a nested path collapses when its ancestor is already selected,
126
+ `--dry-run` writes nothing, and a non-interactive run needs `--yes` before
127
+ anything is moved, recycled, deleted or atomized.
128
+
129
+ ## Requirements
130
+
131
+ Python 3.8 or newer on `PATH`. Override the interpreter with
132
+ `INDYTAG_PYTHON` (or `PYTHON`). Node 18+ is only needed for the npm launcher.
133
+
134
+ ```
135
+ indytag --version
136
+ indytag --help
137
+ ```
package/bin/indytag.js ADDED
@@ -0,0 +1,59 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ // Node bin shim for the single-file Python CLI.
5
+ //
6
+ // It finds a Python 3 interpreter, then hands the terminal to indytag.py with
7
+ // inherited stdio - every byte of the raw-mode TUI has to reach the real
8
+ // console, so nothing may be piped or buffered here.
9
+
10
+ const path = require("path");
11
+ const { spawnSync } = require("child_process");
12
+
13
+ const script = path.join(__dirname, "..", "indytag.py");
14
+
15
+ function launchers() {
16
+ const found = [];
17
+ const fromEnv = (process.env.INDYTAG_PYTHON || process.env.PYTHON || "").trim();
18
+ if (fromEnv) {
19
+ found.push([fromEnv]);
20
+ }
21
+ if (process.platform === "win32") {
22
+ found.push(["py", "-3"]);
23
+ }
24
+ found.push(["python3"], ["python"]);
25
+ return found;
26
+ }
27
+
28
+ function runs(argv) {
29
+ const probe = spawnSync(argv[0], argv.slice(1).concat(["--version"]), {
30
+ stdio: "ignore",
31
+ });
32
+ return !probe.error && probe.status === 0;
33
+ }
34
+
35
+ const launcher = launchers().find(runs);
36
+
37
+ if (!launcher) {
38
+ process.stderr.write(
39
+ "indytag: no Python 3 interpreter found.\n" +
40
+ "Install Python 3 and put `python3` (or `python`) on PATH,\n" +
41
+ "or set INDYTAG_PYTHON to the interpreter to use.\n"
42
+ );
43
+ process.exit(1);
44
+ }
45
+
46
+ const result = spawnSync(
47
+ launcher[0],
48
+ launcher.slice(1).concat([script], process.argv.slice(2)),
49
+ { stdio: "inherit" }
50
+ );
51
+
52
+ if (result.error) {
53
+ process.stderr.write(
54
+ "indytag: failed to launch " + launcher[0] + ": " + result.error.message + "\n"
55
+ );
56
+ process.exit(1);
57
+ }
58
+
59
+ process.exit(result.status === null ? 1 : result.status);