@rikalabs/parallel 0.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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +233 -0
  3. package/dist/index.js +41519 -0
  4. package/package.json +60 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Rika Labs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,233 @@
1
+ # Parallel CLI
2
+
3
+ [![npm](https://img.shields.io/npm/v/@rikalabs/parallel.svg)](https://www.npmjs.com/package/@rikalabs/parallel)
4
+ [![GitHub](https://img.shields.io/badge/GitHub-Rika--Labs%2Fparallel-black.svg)](https://github.com/Rika-Labs/parallel)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
+ [![CI](https://github.com/Rika-Labs/parallel/actions/workflows/ci.yml/badge.svg)](https://github.com/Rika-Labs/parallel/actions/workflows/ci.yml)
7
+
8
+ A Unix-friendly CLI for the [Parallel](https://parallel.ai/) Search and Extract APIs.
9
+
10
+ [Parallel](https://parallel.ai/) provides semantic search and content extraction APIs that understand intent, not just keywords. This CLI brings those capabilities to your terminal with full Unix composability.
11
+
12
+ ## Features
13
+
14
+ - **Semantic Search**: Declarative objectives instead of just keywords
15
+ - **Content Extraction**: Clean markdown from URLs and PDFs
16
+ - **Batch Processing**: Parallelize multiple queries with bounded concurrency
17
+ - **Config Management**: Securely manage your API key globally
18
+ - **Unix Composable**: Works great with `stdin`, `stdout`, and pipes
19
+
20
+ ## Quick Start
21
+
22
+ ```bash
23
+ # Set your API key (get one at https://parallel.ai/)
24
+ parallel config set-key --key <your-key>
25
+
26
+ # Search
27
+ parallel search --query "What is declarative semantic search?"
28
+
29
+ # Extract
30
+ parallel extract --url https://docs.parallel.ai/home --objective "Find pricing"
31
+ ```
32
+
33
+ ## Installation
34
+
35
+ ### Via bun (recommended)
36
+
37
+ ```bash
38
+ bun install -g @rikalabs/parallel
39
+ ```
40
+
41
+ ### From source
42
+
43
+ ```bash
44
+ # Clone and install dependencies
45
+ git clone https://github.com/Rika-Labs/parallel.git
46
+ cd parallel
47
+ bun install
48
+
49
+ # Build the CLI
50
+ bun run build
51
+
52
+ # Add alias to your shell profile
53
+ echo 'alias parallel="bun $(pwd)/dist/index.js"' >> ~/.zshrc
54
+ source ~/.zshrc
55
+ ```
56
+
57
+ ## Usage
58
+
59
+ ### Configuration
60
+
61
+ ```bash
62
+ # Set API key (stored securely in ~/Library/Application Support/parallel/)
63
+ parallel config set-key --key <key>
64
+
65
+ # View current API key
66
+ parallel config get-key
67
+
68
+ # Remove API key
69
+ parallel config unset-key
70
+
71
+ # Show config file path
72
+ parallel config path
73
+
74
+ # Or use environment variable
75
+ export PARALLEL_API_KEY=<key>
76
+ ```
77
+
78
+ ### Search
79
+
80
+ ```bash
81
+ # Basic search
82
+ parallel search --query "Effect TS best practices"
83
+
84
+ # Agentic mode (multi-step reasoning)
85
+ parallel search --query "Compare React and Vue" --mode agentic
86
+
87
+ # Control results
88
+ parallel search --query "TypeScript tips" --max-results 20 --excerpt-chars 3000
89
+
90
+ # Text format output
91
+ parallel search --query "Bun runtime" --format text
92
+
93
+ # Pretty JSON
94
+ parallel search --query "Effect TS examples" --pretty
95
+
96
+ # Multiple queries
97
+ parallel search --query "React hooks" --query "Vue composition API" --concurrency 2
98
+ ```
99
+
100
+ ### Extract
101
+
102
+ ```bash
103
+ # Extract from URL
104
+ parallel extract --url https://example.com
105
+
106
+ # With objective
107
+ parallel extract --url https://docs.effect.website --objective "Find error handling patterns"
108
+
109
+ # Full content extraction
110
+ parallel extract --url https://example.com --full-content
111
+
112
+ # Multiple URLs
113
+ parallel extract --url https://a.com --url https://b.com --url https://c.com --concurrency 3
114
+
115
+ # Text format
116
+ parallel extract --url https://example.com --format text --pretty
117
+ ```
118
+
119
+ ### Batch Processing
120
+
121
+ ```bash
122
+ # Batch search from file (one query per line)
123
+ cat queries.txt | parallel search --stdin --concurrency 10
124
+
125
+ # Batch extract (one URL per line)
126
+ cat urls.txt | parallel extract --stdin --concurrency 5 --format text
127
+
128
+ # Pipe to other tools
129
+ parallel search --query "API design" --format json | jq '.results[].url'
130
+ ```
131
+
132
+ ## API Reference
133
+
134
+ This CLI wraps the [Parallel](https://parallel.ai/) v1beta endpoints:
135
+
136
+ | Endpoint | Method | Description |
137
+ |----------|--------|-------------|
138
+ | `/v1beta/search` | POST | Semantic web search |
139
+ | `/v1beta/extract` | POST | Content extraction from URLs |
140
+
141
+ Get your API key at [parallel.ai](https://parallel.ai/).
142
+
143
+ ## Tech Stack
144
+
145
+ | Technology | Purpose |
146
+ |------------|---------|
147
+ | [Bun](https://bun.sh) | Runtime & bundler |
148
+ | [Effect TS](https://effect.website) | Functional effects, error handling, concurrency |
149
+ | [@effect/cli](https://github.com/Effect-TS/effect/tree/main/packages/cli) | Declarative CLI parsing |
150
+ | [Oxlint](https://oxc.rs/docs/guide/usage/linter.html) | Fast linting |
151
+ | [Husky](https://typicode.github.io/husky/) | Git hooks |
152
+
153
+ ## Development
154
+
155
+ ```bash
156
+ # Run in development
157
+ bun run dev -- search --query "test"
158
+
159
+ # Lint
160
+ bun run lint
161
+
162
+ # Run tests
163
+ bun test
164
+
165
+ # Coverage (90%+ enforced)
166
+ bun test --coverage
167
+
168
+ # Build
169
+ bun run build
170
+ ```
171
+
172
+ ## Architecture
173
+
174
+ Built with functional programming principles:
175
+
176
+ - **Typed Errors**: `CliError`, `ApiError`, `ConfigError` with Effect's error channel
177
+ - **Bounded Concurrency**: Effect's `forEach` for parallel batch operations
178
+ - **Secure Config**: Effect-based file I/O with proper permissions
179
+
180
+ ## Contributing
181
+
182
+ This project uses [Conventional Commits](https://www.conventionalcommits.org/) to automate releases.
183
+
184
+ ### Commit Format
185
+
186
+ ```
187
+ <type>(<scope>): <description>
188
+
189
+ [optional body]
190
+
191
+ [optional footer]
192
+ ```
193
+
194
+ ### Types & Release Behavior
195
+
196
+ | Type | Description | Release |
197
+ |------|-------------|---------|
198
+ | `feat` | New feature | **Minor** (0.x.0) |
199
+ | `fix` | Bug fix | **Patch** (0.0.x) |
200
+ | `perf` | Performance improvement | **Patch** (0.0.x) |
201
+ | `docs` | Documentation only | No release |
202
+ | `style` | Code style changes | No release |
203
+ | `refactor` | Code refactor | No release |
204
+ | `test` | Adding/updating tests | No release |
205
+ | `build` | Build system changes | No release |
206
+ | `ci` | CI configuration | No release |
207
+ | `chore` | Maintenance | No release |
208
+
209
+ ### Breaking Changes
210
+
211
+ Add `!` after type or include `BREAKING CHANGE:` in footer for **major** release:
212
+
213
+ ```bash
214
+ feat!: remove deprecated --objective flag
215
+ # or
216
+ feat: new search API
217
+
218
+ BREAKING CHANGE: removed --objective in favor of --query
219
+ ```
220
+
221
+ ### Examples
222
+
223
+ ```bash
224
+ git commit -m "feat: add --verbose flag for detailed output"
225
+ git commit -m "fix: handle empty query gracefully"
226
+ git commit -m "docs: update installation instructions"
227
+ ```
228
+
229
+ ## License
230
+
231
+ MIT © [Rika Labs](https://github.com/Rika-Labs)
232
+
233
+ See [LICENSE](LICENSE) for details.