rskim 0.2.4 → 0.3.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
CHANGED
|
@@ -16,7 +16,7 @@ Think of it like `cat`, but smart about what code to show.
|
|
|
16
16
|
### Try it (no install required)
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
|
-
npx
|
|
19
|
+
npx skim file.ts
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
### Install globally (recommended for regular use)
|
|
@@ -35,22 +35,22 @@ cargo install rskim
|
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
37
|
# Try it with npx (no install)
|
|
38
|
-
npx
|
|
38
|
+
npx skim file.ts
|
|
39
39
|
|
|
40
40
|
# Or install globally for better performance
|
|
41
41
|
npm install -g rskim
|
|
42
42
|
|
|
43
43
|
# Read TypeScript with structure mode
|
|
44
|
-
|
|
44
|
+
skim file.ts
|
|
45
45
|
|
|
46
46
|
# Extract Python function signatures
|
|
47
|
-
|
|
47
|
+
skim file.py --mode signatures
|
|
48
48
|
|
|
49
49
|
# Pipe to syntax highlighter
|
|
50
|
-
|
|
50
|
+
skim file.rs | bat -l rust
|
|
51
51
|
|
|
52
52
|
# Read from stdin
|
|
53
|
-
cat code.ts |
|
|
53
|
+
cat code.ts | skim - --language=typescript
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
## Features
|
|
@@ -66,7 +66,7 @@ cat code.ts | rskim - --language=typescript
|
|
|
66
66
|
### Basic Usage
|
|
67
67
|
|
|
68
68
|
```bash
|
|
69
|
-
|
|
69
|
+
skim <FILE>
|
|
70
70
|
```
|
|
71
71
|
|
|
72
72
|
### Options
|
|
@@ -88,7 +88,7 @@ Options:
|
|
|
88
88
|
Removes function bodies while preserving signatures (70-80% reduction).
|
|
89
89
|
|
|
90
90
|
```bash
|
|
91
|
-
|
|
91
|
+
skim file.ts
|
|
92
92
|
```
|
|
93
93
|
|
|
94
94
|
**Input:**
|
|
@@ -110,7 +110,7 @@ function add(a: number, b: number): number { /* ... */ }
|
|
|
110
110
|
Extracts only function and method signatures (85-92% reduction).
|
|
111
111
|
|
|
112
112
|
```bash
|
|
113
|
-
|
|
113
|
+
skim file.py --mode signatures
|
|
114
114
|
```
|
|
115
115
|
|
|
116
116
|
**Input:**
|
|
@@ -131,7 +131,7 @@ def calculate_total(items: list[Item], tax_rate: float) -> Decimal:
|
|
|
131
131
|
Extracts only type definitions (90-95% reduction).
|
|
132
132
|
|
|
133
133
|
```bash
|
|
134
|
-
|
|
134
|
+
skim file.ts --mode types
|
|
135
135
|
```
|
|
136
136
|
|
|
137
137
|
**Input:**
|
|
@@ -159,7 +159,7 @@ interface User {
|
|
|
159
159
|
Returns original code unchanged (0% reduction).
|
|
160
160
|
|
|
161
161
|
```bash
|
|
162
|
-
|
|
162
|
+
skim file.rs --mode full
|
|
163
163
|
```
|
|
164
164
|
|
|
165
165
|
## Examples
|
|
@@ -168,37 +168,37 @@ rskim file.rs --mode full
|
|
|
168
168
|
|
|
169
169
|
```bash
|
|
170
170
|
# Get overview of all TypeScript files
|
|
171
|
-
find src -name '*.ts' -exec
|
|
171
|
+
find src -name '*.ts' -exec skim {} \;
|
|
172
172
|
|
|
173
173
|
# Extract all Python function signatures
|
|
174
|
-
|
|
174
|
+
skim app.py --mode signatures > api.txt
|
|
175
175
|
|
|
176
176
|
# Review Rust types
|
|
177
|
-
|
|
177
|
+
skim lib.rs --mode types | less
|
|
178
178
|
```
|
|
179
179
|
|
|
180
180
|
### Prepare code for LLMs
|
|
181
181
|
|
|
182
182
|
```bash
|
|
183
183
|
# Reduce token count before sending to GPT
|
|
184
|
-
|
|
184
|
+
skim large_file.ts | wc -w
|
|
185
185
|
# Output: 150 (was 600)
|
|
186
186
|
|
|
187
187
|
# Get just the API surface
|
|
188
|
-
|
|
188
|
+
skim server.py --mode signatures | pbcopy
|
|
189
189
|
```
|
|
190
190
|
|
|
191
191
|
### Pipe workflows
|
|
192
192
|
|
|
193
193
|
```bash
|
|
194
194
|
# Skim and highlight
|
|
195
|
-
|
|
195
|
+
skim file.rs | bat -l rust
|
|
196
196
|
|
|
197
197
|
# Skim and search
|
|
198
|
-
|
|
198
|
+
skim file.ts | grep "interface"
|
|
199
199
|
|
|
200
200
|
# Skim multiple files
|
|
201
|
-
cat *.py |
|
|
201
|
+
cat *.py | skim - --language=python
|
|
202
202
|
```
|
|
203
203
|
|
|
204
204
|
## Supported Languages
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/bin/{rskim.js → skim.js}
RENAMED
|
@@ -7,9 +7,9 @@ function getBinaryPath() {
|
|
|
7
7
|
const platform = process.platform;
|
|
8
8
|
const arch = process.arch;
|
|
9
9
|
|
|
10
|
-
let binaryName = '
|
|
10
|
+
let binaryName = 'skim';
|
|
11
11
|
if (platform === 'win32') {
|
|
12
|
-
binaryName = '
|
|
12
|
+
binaryName = 'skim.exe';
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
// Try to find the binary in the package
|
|
@@ -24,7 +24,7 @@ function getBinaryPath() {
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
console.error('ERROR:
|
|
27
|
+
console.error('ERROR: skim binary not found for your platform');
|
|
28
28
|
console.error(`Platform: ${platform}, Architecture: ${arch}`);
|
|
29
29
|
console.error('Please report this issue at: https://github.com/dean0x/skim/issues');
|
|
30
30
|
process.exit(1);
|
|
Binary file
|
package/package.json
CHANGED