tidyf 1.0.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 +21 -0
- package/README.md +299 -0
- package/dist/cli.js +19340 -0
- package/dist/fsevents-hj42pnne.node +0 -0
- package/dist/index.js +17617 -0
- package/package.json +58 -0
- package/src/cli.ts +63 -0
- package/src/commands/config.ts +630 -0
- package/src/commands/organize.ts +396 -0
- package/src/commands/watch.ts +302 -0
- package/src/index.ts +93 -0
- package/src/lib/config.ts +335 -0
- package/src/lib/opencode.ts +380 -0
- package/src/lib/scanner.ts +296 -0
- package/src/lib/watcher.ts +151 -0
- package/src/types/config.ts +69 -0
- package/src/types/organizer.ts +144 -0
- package/src/utils/files.ts +198 -0
- package/src/utils/icons.ts +195 -0
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "tidyf",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "AI-powered file organizer using opencode.ai",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"tidyf": "./dist/cli.js",
|
|
9
|
+
"td": "./dist/cli.js",
|
|
10
|
+
"tidyfiles": "./dist/cli.js"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/yafyx/tidyf.git"
|
|
15
|
+
},
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public",
|
|
18
|
+
"registry": "https://registry.npmjs.org/"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"start": "node dist/cli.js",
|
|
22
|
+
"dev": "bun --watch src/cli.ts",
|
|
23
|
+
"build": "bun build src/cli.ts --outdir=dist --target=node --format=esm && bun build src/index.ts --outdir=dist --target=node --format=esm",
|
|
24
|
+
"typecheck": "tsc --noEmit",
|
|
25
|
+
"prepublishOnly": "bun run build"
|
|
26
|
+
},
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=18.0.0"
|
|
29
|
+
},
|
|
30
|
+
"keywords": [
|
|
31
|
+
"file-organizer",
|
|
32
|
+
"ai",
|
|
33
|
+
"opencode",
|
|
34
|
+
"cli",
|
|
35
|
+
"downloads",
|
|
36
|
+
"tidy",
|
|
37
|
+
"automation"
|
|
38
|
+
],
|
|
39
|
+
"author": "",
|
|
40
|
+
"license": "MIT",
|
|
41
|
+
"files": [
|
|
42
|
+
"dist",
|
|
43
|
+
"src"
|
|
44
|
+
],
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@clack/prompts": "^0.11.0",
|
|
47
|
+
"@opencode-ai/sdk": "^1.0.155",
|
|
48
|
+
"chokidar": "^3.5.3",
|
|
49
|
+
"commander": "^12.1.0",
|
|
50
|
+
"mime-types": "^2.1.35",
|
|
51
|
+
"picocolors": "^1.1.1"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@types/bun": "latest",
|
|
55
|
+
"@types/mime-types": "^2.1.4",
|
|
56
|
+
"typescript": "^5.7.2"
|
|
57
|
+
}
|
|
58
|
+
}
|
package/src/cli.ts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* tidy - AI-powered file organizer CLI
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { Command } from "commander";
|
|
8
|
+
import { configCommand } from "./commands/config.ts";
|
|
9
|
+
import { organizeCommand } from "./commands/organize.ts";
|
|
10
|
+
import { watchCommand } from "./commands/watch.ts";
|
|
11
|
+
|
|
12
|
+
const program = new Command();
|
|
13
|
+
|
|
14
|
+
program
|
|
15
|
+
.name("tidyf")
|
|
16
|
+
.description("AI-powered file organizer using opencode.ai")
|
|
17
|
+
.version("1.0.0");
|
|
18
|
+
|
|
19
|
+
// Default command - organize files
|
|
20
|
+
program
|
|
21
|
+
.argument("[path]", "Directory to organize (default: ~/Downloads)")
|
|
22
|
+
.option("-d, --dry-run", "Preview changes without moving files")
|
|
23
|
+
.option("-y, --yes", "Skip confirmation prompts and apply all")
|
|
24
|
+
.option("-r, --recursive", "Scan subdirectories")
|
|
25
|
+
.option("--depth <n>", "Max subdirectory depth to scan", "1")
|
|
26
|
+
.option("-s, --source <path>", "Source directory to organize")
|
|
27
|
+
.option("-t, --target <path>", "Target directory for organized files")
|
|
28
|
+
.option("-m, --model <id>", "Override model (provider/model)")
|
|
29
|
+
.action(async (path, options) => {
|
|
30
|
+
await organizeCommand({ path: path || options.source, ...options });
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
// Watch command - monitor folders for new files
|
|
34
|
+
program
|
|
35
|
+
.command("watch")
|
|
36
|
+
.alias("w")
|
|
37
|
+
.description("Watch folders for new files and auto-organize")
|
|
38
|
+
.argument("[paths...]", "Directories to watch")
|
|
39
|
+
.option("-d, --delay <ms>", "Debounce delay in milliseconds", "3000")
|
|
40
|
+
.option("-a, --auto", "Auto-apply without confirmation")
|
|
41
|
+
.option("-q, --queue", "Queue files for review instead of auto-apply")
|
|
42
|
+
.option("-m, --model <id>", "Override model (provider/model)")
|
|
43
|
+
.action(async (paths, options) => {
|
|
44
|
+
await watchCommand({ paths, ...options });
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
// Config command - configure settings
|
|
48
|
+
program
|
|
49
|
+
.command("config")
|
|
50
|
+
.alias("c")
|
|
51
|
+
.description("Configure AI models, target folders, and rules")
|
|
52
|
+
.option("-l, --local", "Configure local settings (current directory)")
|
|
53
|
+
.action(async (options) => {
|
|
54
|
+
await configCommand(options);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
// Handle errors gracefully
|
|
58
|
+
process.on("unhandledRejection", (error: Error) => {
|
|
59
|
+
console.error("Error:", error.message);
|
|
60
|
+
process.exit(1);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
program.parse();
|