context_spook 1.0.1 → 1.1.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.
- checksums.yaml +4 -4
- data/README.md +22 -11
- data/bin/context_spook +17 -9
- data/context_spook.gemspec +2 -2
- data/lib/context_spook/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 41d55af33ce0adb0f4950f6a24b43fdc6d5c6d7401e6c6eb59bdce08d149043f
|
|
4
|
+
data.tar.gz: fa121dce3b5c17f234a51133e93c947420609849bcc048676e4f0d5f9e718d42
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 812003a9986f5ca5bad980b57fececfc09085de3787dd671197453f977feaa249c67a1af858e93ba2be810ae941b1389dbc28e222fac853550b33b6e3d2076ac
|
|
7
|
+
data.tar.gz: 6579a56156f1e6deaf64427d2038de99a2e68749e397fc57860fdf4b6c33359f467d72e7a2cc1a0effd691c7c8411666f23c8b414334d5ab0e55e6540ee39d98
|
data/README.md
CHANGED
|
@@ -127,20 +127,20 @@ File.write 'context.json', context.to_json
|
|
|
127
127
|
Generate context and save to file:
|
|
128
128
|
|
|
129
129
|
```bash
|
|
130
|
-
|
|
130
|
+
context_spook .contexts/project.rb > context.json
|
|
131
131
|
```
|
|
132
132
|
|
|
133
133
|
Or pipe directly to another tool:
|
|
134
134
|
|
|
135
135
|
```bash
|
|
136
|
-
|
|
136
|
+
context_spook .contexts/project.rb | ollama_chat_send
|
|
137
137
|
```
|
|
138
138
|
|
|
139
139
|
The CLI tool also supports verbose output:
|
|
140
140
|
|
|
141
141
|
```bash
|
|
142
142
|
# Generate context without verbose output
|
|
143
|
-
|
|
143
|
+
context_spook .contexts/project.rb ~v
|
|
144
144
|
```
|
|
145
145
|
|
|
146
146
|
Now you can see two orange warning messages, that demonstrates how errors like
|
|
@@ -150,7 +150,7 @@ The CLI tool also supports file redirection:
|
|
|
150
150
|
|
|
151
151
|
```bash
|
|
152
152
|
# Generate context and save to file
|
|
153
|
-
|
|
153
|
+
context_spook .contexts/project.rb -o context.json
|
|
154
154
|
```
|
|
155
155
|
|
|
156
156
|
You can also use include patterns to automatically collect files without
|
|
@@ -158,22 +158,33 @@ manually specifying each one:
|
|
|
158
158
|
|
|
159
159
|
```bash
|
|
160
160
|
# Collect all Ruby files from lib/ and spec/ directories
|
|
161
|
-
|
|
161
|
+
context_spook -i 'lib/**/*.rb' -i 'spec/**/*.rb'
|
|
162
162
|
|
|
163
163
|
# Collect Markdown and YAML files from current directory
|
|
164
|
-
|
|
164
|
+
context_spook -i '*.md' -i '*.yaml' -i '*.yml'
|
|
165
165
|
|
|
166
166
|
# Collect files with complex patterns
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
167
|
+
context_spook -i 'lib/**/{*.rb,*.rake}' # Brace expansion
|
|
168
|
+
context_spook -i 'lib/**/*_spec.rb' # Pattern matching
|
|
169
|
+
context_spook -i 'lib/**/*.rb' -i 'spec/**/*_spec.rb' # Mixed patterns
|
|
170
170
|
```
|
|
171
171
|
|
|
172
|
+
### Size Estimation
|
|
173
|
+
|
|
174
|
+
To estimate the size of your context without generating the large output file:
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
# Show context size information only
|
|
178
|
+
context_spook .contexts/project.rb -S
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
This is useful for optimizing context size before committing to large output files.
|
|
182
|
+
|
|
172
183
|
This is how you can show the usage message:
|
|
173
184
|
|
|
174
185
|
```
|
|
175
186
|
# Show help
|
|
176
|
-
|
|
187
|
+
context_spook -h
|
|
177
188
|
```
|
|
178
189
|
|
|
179
190
|
## What Gets Collected
|
|
@@ -232,4 +243,4 @@ assistants understand:
|
|
|
232
243
|
|
|
233
244
|
## License
|
|
234
245
|
|
|
235
|
-
The gem is available as open source under the terms of the [MIT License](
|
|
246
|
+
The gem is available as open source under the terms of the [MIT License](LICENSE)
|
data/bin/context_spook
CHANGED
|
@@ -22,10 +22,11 @@ def usage
|
|
|
22
22
|
|
|
23
23
|
Options:
|
|
24
24
|
-o FILE Write output to FILE instead of stdout
|
|
25
|
-
~v Disable verbose output, enabled by default
|
|
26
|
-
-
|
|
25
|
+
~v Disable verbose informational output, enabled by default
|
|
26
|
+
-S suppress output (just show informational output)
|
|
27
27
|
-i PATTERN Include files matching PATTERN (can be used multiple times)
|
|
28
28
|
Supports glob patterns like **, *, ?, [abc], {a,b,c}
|
|
29
|
+
-h Show this help message
|
|
29
30
|
|
|
30
31
|
Examples:
|
|
31
32
|
# Generate context and output to stdout
|
|
@@ -44,13 +45,16 @@ def usage
|
|
|
44
45
|
# Generate context without verbose output
|
|
45
46
|
#{File.basename($0)} .contexts/project.rb ~v
|
|
46
47
|
|
|
48
|
+
# Generate informational output only to estimate context size
|
|
49
|
+
#{File.basename($0)} .contexts/project.rb -S
|
|
50
|
+
|
|
47
51
|
# Generate context and save to file
|
|
48
52
|
#{File.basename($0)} .contexts/project.rb -o context.json
|
|
49
53
|
EOT
|
|
50
54
|
exit 0
|
|
51
55
|
end
|
|
52
56
|
|
|
53
|
-
opts = go 'o:i:
|
|
57
|
+
opts = go 'o:i:pvSh', defaults: { ?v => true }
|
|
54
58
|
opts[?h] and usage
|
|
55
59
|
context = nil
|
|
56
60
|
output = nil
|
|
@@ -72,12 +76,16 @@ else
|
|
|
72
76
|
context = ContextSpook.generate_context(filename, verbose: opts[?v])
|
|
73
77
|
end
|
|
74
78
|
|
|
75
|
-
if
|
|
76
|
-
|
|
77
|
-
fail "Filename #{output_filename.inspect} already exists!"
|
|
78
|
-
end
|
|
79
|
-
output = File.new output_filename, ?w
|
|
79
|
+
if opts[?S]
|
|
80
|
+
output = NULL
|
|
80
81
|
else
|
|
81
|
-
|
|
82
|
+
if output_filename = opts[?o]
|
|
83
|
+
if File.exist?(output_filename)
|
|
84
|
+
fail "Filename #{output_filename.inspect} already exists!"
|
|
85
|
+
end
|
|
86
|
+
output = File.new output_filename, ?w
|
|
87
|
+
else
|
|
88
|
+
output = STDOUT
|
|
89
|
+
end
|
|
82
90
|
end
|
|
83
91
|
JSON.dump(context.as_json, output)
|
data/context_spook.gemspec
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
|
2
|
-
# stub: context_spook 1.0
|
|
2
|
+
# stub: context_spook 1.1.0 ruby lib
|
|
3
3
|
|
|
4
4
|
Gem::Specification.new do |s|
|
|
5
5
|
s.name = "context_spook".freeze
|
|
6
|
-
s.version = "1.0
|
|
6
|
+
s.version = "1.1.0".freeze
|
|
7
7
|
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
|
9
9
|
s.require_paths = ["lib".freeze]
|