stdin-glob 1.0.0 → 1.0.1

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.
@@ -7,17 +7,19 @@ on:
7
7
  push:
8
8
  branches: [main]
9
9
 
10
+ permissions:
11
+ id-token: write # Required for OIDC
12
+ contents: read
13
+
10
14
  jobs:
11
15
  publish:
12
16
  runs-on: ubuntu-latest
13
17
  steps:
14
18
  - uses: actions/checkout@v4
15
- - uses: actions/setup-node@v3
19
+ - uses: actions/setup-node@v4
16
20
  with:
17
- node-version: '20'
21
+ node-version: '24'
22
+ registry-url: 'https://registry.npmjs.org'
18
23
 
19
24
  - run: npm install
20
-
21
- - uses: JS-DevTools/npm-publish@v3
22
- with:
23
- token: ${{ secrets.NPM_TOKEN }}
25
+ - run: npm publish
package/README.md CHANGED
@@ -1,3 +1,139 @@
1
1
  # stdin-glob
2
2
 
3
- A glob cli to find and print files quickly including reading from stdin so it can be piped to other unix apps.
3
+ [![npm version](https://img.shields.io/npm/v/stdin-glob.svg)](https://www.npmjs.com/package/stdin-glob)
4
+ [![npm license](https://img.shields.io/npm/l/stdin-glob.svg)](https://www.npmjs.com/package/stdin-glob)
5
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.9+-blue.svg)](https://www.typescriptlang.org)
6
+ [![GitHub stars](https://img.shields.io/github/stars/rodnye/stdin-glob.svg)](https://github.com/rodnye/stdin-glob)
7
+
8
+ A simple CLI tool that expands glob patterns and outputs file contents or paths. Perfect for quickly previewing multiple files matching a pattern.
9
+
10
+ ## Why?
11
+
12
+ This tool solves a common pain point: **aggregating file contents into a single, coherent output**. Whether you're doing code reviews, documentation, or working with LLMs, having to manually copy-paste multiple files is tedious and error-prone.
13
+
14
+ I created this for my personal workflow when working with Large Language Models (LLMs). Combined with clipboard tools, it lets me instantly gather specific project context:
15
+
16
+ ```bash
17
+ stdin-glob "src/**/*.ts" "src/**/*.tsx" | pbcopy # On macOS
18
+ # or
19
+ stdin-glob "src/**/*.js" | xclip -selection clipboard # On Linux
20
+ ```
21
+
22
+ This pipes all relevant TypeScript/TSX files directly into my clipboard, ready to paste into ChatGPT, Claude, or any other LLM. Perfect for getting targeted, comprehensive context without the friction of opening and copying files one by one.
23
+
24
+ ## Features
25
+
26
+ - Expand glob patterns to find matching files
27
+ - Output file contents with syntax highlighting markers
28
+ - Support for absolute or relative paths
29
+ - Option to show only file paths without content
30
+ - Written in TypeScript
31
+
32
+ ## Installation
33
+
34
+ ```bash
35
+ npm install -g stdin-glob
36
+ ```
37
+
38
+ ## Usage
39
+
40
+ ```bash
41
+ stdin-glob [options] [patterns...]
42
+ ```
43
+
44
+ ### Options
45
+
46
+ | Option | Description |
47
+ | --------------- | --------------------------------------------------- |
48
+ | `--no-content` | Do not show file contents, only list matching paths |
49
+ | `--absolute` | Show absolute paths for entries |
50
+ | `-V, --version` | Output the version number |
51
+ | `-h, --help` | Display help information |
52
+
53
+ ### Arguments
54
+
55
+ | Argument | Description |
56
+ | ---------- | ------------------------------------------ |
57
+ | `patterns` | Glob patterns to match files (one or more) |
58
+
59
+ ## Pattern Syntax
60
+
61
+ This tool uses [fast-glob](https://github.com/mrmlnc/fast-glob) for pattern matching, which supports the feature set of [picomatch](https://github.com/micromatch/picomatch). For detailed information about available globbing features and syntax options, refer to the [picomatch globbing features documentation](https://github.com/micromatch/picomatch?tab=readme-ov-file#globbing-features).
62
+
63
+ ## Examples
64
+
65
+ ### Basic usage
66
+
67
+ Display contents of all JavaScript files with syntax highlighting markers:
68
+
69
+ ```bash
70
+ stdin-glob "src/**/*.js" --content
71
+ # or
72
+ stdin-glob "src/**/*.js"
73
+ ```
74
+
75
+ Output:
76
+
77
+ ````
78
+ ```js
79
+ // src/index.js
80
+
81
+ console.log('Hello, world!');
82
+ ```
83
+
84
+ ```js
85
+ // src/utils/helpers.js
86
+
87
+ function add(a, b) {
88
+ return a + b;
89
+ }
90
+ ```
91
+ ````
92
+
93
+ ### Only list files
94
+
95
+ List all TypeScript files in the src directory without content:
96
+
97
+ ```bash
98
+ stdin-glob "src/**/*.ts" --no-content
99
+ ```
100
+
101
+ Output:
102
+
103
+ ```text
104
+ src/index.ts
105
+ src/utils/helpers.ts
106
+ src/types/index.ts
107
+ ```
108
+
109
+ ### Multiple patterns
110
+
111
+ Match files with different extensions:
112
+
113
+ ```bash
114
+ stdin-glob "src/**/*.ts" "src/**/*.js" --content
115
+ ```
116
+
117
+ ### Absolute paths
118
+
119
+ Show absolute paths instead of relative ones:
120
+
121
+ ```bash
122
+ stdin-glob "src/**/*.ts" --absolute --no-content
123
+ ```
124
+
125
+ Output:
126
+
127
+ ```
128
+ /home/pedrito/project/src/index.ts
129
+ /home/pedrito/project/src/utils/helpers.ts
130
+ /home/pedrito/project/src/types/index.ts
131
+ ```
132
+
133
+ ### Integration with other commands
134
+
135
+ Use with grep to search for specific content:
136
+
137
+ ```bash
138
+ stdin-glob "src/**/*.ts" | grep "function"
139
+ ```
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "stdin-glob",
3
- "version": "1.0.0",
4
- "description": "Expand glob patterns and output file contents, with support for reading patterns from stdin",
3
+ "version": "1.0.1",
4
+ "description": "Expand glob patterns and output file contents.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "bin": {