catco 0.0.1 → 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/README.md +41 -1
- package/package.json +57 -51
- package/dist/index.cjs +0 -34
- package/dist/index.js +0 -33
package/README.md
CHANGED
|
@@ -1,11 +1,51 @@
|
|
|
1
1
|
# catco
|
|
2
2
|
|
|
3
|
+
Glob copy file contents to ya clipboard. Use it to quickly share many files with an AI code assistant.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
3
7
|
```
|
|
4
8
|
npm i -g catco
|
|
5
9
|
```
|
|
6
10
|
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
7
13
|
Tell it what files, and it will concatenate them all and copy them to your clipboard (whitespace minimized) so you can go paste that shit to GPT, Perplexity, Claude, whatever AI to ask for help or whatever.
|
|
8
14
|
|
|
9
15
|
```
|
|
10
|
-
catco
|
|
16
|
+
catco src/components/**/*.ts
|
|
17
|
+
|
|
18
|
+
catco src/components/**/*.ts src/styles/**/*.css
|
|
19
|
+
|
|
20
|
+
catco src/components/**/*.ts src/styles/**/*.css --ignore *.test.ts
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Default Ignore Patterns
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
node_modules
|
|
27
|
+
node_modules/**
|
|
28
|
+
.git
|
|
29
|
+
.git/**
|
|
30
|
+
.github
|
|
31
|
+
.github/**
|
|
32
|
+
dist
|
|
33
|
+
dist/**
|
|
34
|
+
build
|
|
35
|
+
build/**
|
|
36
|
+
coverage
|
|
37
|
+
coverage/**
|
|
38
|
+
.next
|
|
39
|
+
.next/**
|
|
40
|
+
.vercel
|
|
41
|
+
.vercel/**
|
|
42
|
+
.turbo
|
|
43
|
+
.turbo/**
|
|
44
|
+
.DS_Store
|
|
45
|
+
*.log
|
|
46
|
+
npm-debug.log
|
|
47
|
+
yarn-error.log
|
|
48
|
+
pnpm-debug.log
|
|
49
|
+
.env
|
|
50
|
+
.env.*
|
|
11
51
|
```
|
package/package.json
CHANGED
|
@@ -1,53 +1,59 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
2
|
+
"name": "catco",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.cjs",
|
|
6
|
+
"module": "./dist/index.js",
|
|
7
|
+
"description": "Glob copy file contents to ya clipboard.",
|
|
8
|
+
"exports": {
|
|
9
|
+
"import": "./dist/index.js",
|
|
10
|
+
"require": "./dist/index.cjs"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsx",
|
|
14
|
+
"start": "tsx src/index.ts ./src/**/*.ts"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"keywords": [
|
|
20
|
+
"ai",
|
|
21
|
+
"ai-assistant",
|
|
22
|
+
"ai-tools",
|
|
23
|
+
"gpt",
|
|
24
|
+
"copy",
|
|
25
|
+
"clipboard",
|
|
26
|
+
"claude",
|
|
27
|
+
"chatgpt",
|
|
28
|
+
"chatgpt4o",
|
|
29
|
+
"chatgpt4o-mini"
|
|
30
|
+
],
|
|
31
|
+
"bin": {
|
|
32
|
+
"catco": "./dist/index.js"
|
|
33
|
+
},
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"homepage": "https://github.com/tasteee/catco",
|
|
36
|
+
"repository": {
|
|
37
|
+
"type": "git",
|
|
38
|
+
"url": "git+https://github.com/tasteee/catco.git"
|
|
39
|
+
},
|
|
40
|
+
"bugs": "https://github.com/tasteee/catco/issues",
|
|
41
|
+
"author": "tasteink <rocolcleasure@gmail.com>",
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@types/minimist": "^1.2.5",
|
|
44
|
+
"prettier": "^3.5.3",
|
|
45
|
+
"tsx": "^4.19.2",
|
|
46
|
+
"typescript": "^5.6.3",
|
|
47
|
+
"vitest": "^2.1.3"
|
|
48
|
+
},
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"clipboardy": "^4.0.0",
|
|
51
|
+
"globby": "^14.0.2",
|
|
52
|
+
"meow": "^13.2.0",
|
|
53
|
+
"minimist": "^1.2.8",
|
|
54
|
+
"sade": "^1.8.1"
|
|
55
|
+
},
|
|
56
|
+
"publishConfig": {
|
|
57
|
+
"access": "public"
|
|
58
|
+
}
|
|
53
59
|
}
|
package/dist/index.cjs
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var globby = require('globby');
|
|
4
|
-
var fs = require('node:fs');
|
|
5
|
-
var path = require('node:path');
|
|
6
|
-
var clipboard = require('clipboardy');
|
|
7
|
-
|
|
8
|
-
function minify(content) {
|
|
9
|
-
return content.replace(/\s+/g, " ").replace(/\s*([\{\}\[\]\(\),;:])\s*/g, "$1").replace(/\s*=\s*/g, "=").replace(/\s*>\s*/g, ">").replace(/;\s*/g, ";").replace(/"\s+/g, '"').replace(/\s+"/g, '"').replace(/'\s+/g, "'").replace(/\s+'/g, "'").trim();
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
async function catco(patterns) {
|
|
13
|
-
let allContents = "";
|
|
14
|
-
for (const pattern of patterns) {
|
|
15
|
-
const files = await globby.globby(pattern);
|
|
16
|
-
for (const file of files) {
|
|
17
|
-
const content = await fs.promises.readFile(file, "utf-8");
|
|
18
|
-
const minifiedContent = minify(content);
|
|
19
|
-
allContents += `/* FILE: ${path.resolve(file)} */ ${minifiedContent} `;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
if (allContents) {
|
|
23
|
-
await clipboard.write(allContents);
|
|
24
|
-
console.log("Contents copied to clipboard!");
|
|
25
|
-
} else {
|
|
26
|
-
console.log("No matching files found.");
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
const args = process.argv.slice(2);
|
|
30
|
-
if (args.length === 0) {
|
|
31
|
-
console.log("Usage: catco [...patterns]");
|
|
32
|
-
process.exit(1);
|
|
33
|
-
}
|
|
34
|
-
catco(args);
|
package/dist/index.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { globby } from 'globby';
|
|
3
|
-
import fs from 'node:fs';
|
|
4
|
-
import path from 'node:path';
|
|
5
|
-
import clipboard from 'clipboardy';
|
|
6
|
-
|
|
7
|
-
function minify(content) {
|
|
8
|
-
return content.replace(/\s+/g, " ").replace(/\s*([\{\}\[\]\(\),;:])\s*/g, "$1").replace(/\s*=\s*/g, "=").replace(/\s*>\s*/g, ">").replace(/;\s*/g, ";").replace(/"\s+/g, '"').replace(/\s+"/g, '"').replace(/'\s+/g, "'").replace(/\s+'/g, "'").trim();
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
async function catco(patterns) {
|
|
12
|
-
let allContents = "";
|
|
13
|
-
for (const pattern of patterns) {
|
|
14
|
-
const files = await globby(pattern);
|
|
15
|
-
for (const file of files) {
|
|
16
|
-
const content = await fs.promises.readFile(file, "utf-8");
|
|
17
|
-
const minifiedContent = minify(content);
|
|
18
|
-
allContents += `/* FILE: ${path.resolve(file)} */ ${minifiedContent} `;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
if (allContents) {
|
|
22
|
-
await clipboard.write(allContents);
|
|
23
|
-
console.log("Contents copied to clipboard!");
|
|
24
|
-
} else {
|
|
25
|
-
console.log("No matching files found.");
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
const args = process.argv.slice(2);
|
|
29
|
-
if (args.length === 0) {
|
|
30
|
-
console.log("Usage: catco [...patterns]");
|
|
31
|
-
process.exit(1);
|
|
32
|
-
}
|
|
33
|
-
catco(args);
|