pplx-zero 1.0.1 → 1.1.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.
Files changed (3) hide show
  1. package/README.md +110 -30
  2. package/dist/cli.js +101 -49
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -29,16 +29,25 @@ A fast TypeScript CLI for Perplexity AI search with multimodal support. Built wi
29
29
 
30
30
  **📦 Package Manager Installation (Recommended)**
31
31
 
32
+ <p align="center">
33
+ <a href="https://badge.fury.io/js/pplx-zero"><img src="https://badge.fury.io/js/pplx-zero.svg" alt="npm version"></a>
34
+ <a href="https://aur.archlinux.org/packages/pplx-zero"><img src="https://img.shields.io/aur/version/pplx-zero?style=flat-square" alt="AUR package"></a>
35
+ </p>
36
+
32
37
  ```bash
33
- # npm (Node.js package manager)
38
+ # npm (Node.js package manager) - Global installation
34
39
  npm install -g pplx-zero
35
40
 
36
- # AUR (Arch Linux)
41
+ # AUR (Arch Linux) - Binary package
37
42
  yay -S pplx-zero
38
- # or manual AUR
43
+
44
+ # AUR (Arch Linux) - Manual build
39
45
  git clone https://aur.archlinux.org/pplx-zero.git
40
46
  cd pplx-zero
41
47
  makepkg -si
48
+
49
+ # Verify installation
50
+ pplx --version
42
51
  ```
43
52
 
44
53
  **🔨 Manual Installation**
@@ -51,6 +60,9 @@ bun install && bun run build
51
60
 
52
61
  # Add to PATH
53
62
  sudo ln -s "$(pwd)/dist/cli.js" /usr/local/bin/pplx
63
+
64
+ # Verify installation
65
+ pplx --version
54
66
  ```
55
67
 
56
68
  ### 2️⃣ Setup API Key
@@ -67,46 +79,90 @@ setx PERPLEXITY_API_KEY "your-api-key"
67
79
 
68
80
  **Get your API key:** https://www.perplexity.ai/account/api/keys
69
81
 
70
- ### 3️⃣ Start Searching
82
+ ### 3️⃣ Start Searching (Simplified Interface)
71
83
 
72
84
  ```bash
73
- # Basic search
85
+ # Simple search
74
86
  pplx "latest AI developments"
75
87
 
76
- # Choose model
77
- pplx --model sonar-pro "Detailed analysis"
88
+ # Choose model for detailed analysis
89
+ pplx --model sonar-pro "Explain quantum computing"
78
90
 
79
- # Document analysis
80
- pplx --attach report.pdf "Summarize this document"
91
+ # Analyze document (simplified syntax)
92
+ pplx --file report.pdf "Summarize this document"
81
93
 
82
- # Image analysis
83
- pplx --attach-image screenshot.png "Analyze this interface"
94
+ # Analyze image (simplified syntax)
95
+ pplx --image screenshot.png "What does this interface do?"
84
96
 
85
- # Batch processing
86
- pplx --input queries.json
97
+ # Document + image analysis
98
+ pplx --file data.csv --image chart.png "Analyze this data"
87
99
 
88
- # Stream processing
89
- cat queries.jsonl | pplx --stdin
100
+ # Advanced AI models
101
+ pplx --model sonar-reasoning "Solve this math problem"
102
+ pplx --model sonar-deep-research "History of artificial intelligence"
103
+
104
+ # See basic help
105
+ pplx --help
106
+
107
+ # See advanced options
108
+ pplx --help-advanced
109
+ ```
110
+
111
+ **🔄 Migration from v1.0.x:**
112
+ ```bash
113
+ # OLD: pplx --format jsonl --input queries.json "search"
114
+ # NEW: pplx --format jsonl --input queries.json "search" # format flag unchanged
115
+
116
+ # OLD: pplx --attach document.pdf "analyze"
117
+ # NEW: pplx --file document.pdf "analyze" # simplified syntax
90
118
  ```
91
119
 
92
120
  ## Usage Guide
93
121
 
94
122
  ### Command Line Options
95
123
 
124
+ **Simplified Interface (Everyday Usage):**
96
125
  ```bash
97
- # Search with custom settings
98
- pplx --concurrency 10 --timeout 60000 --format jsonl "machine learning trends"
126
+ # Basic search with model selection
127
+ pplx --model sonar-pro "Detailed analysis"
128
+
129
+ # File attachments (simplified syntax)
130
+ pplx --file document.pdf "Summarize this report"
131
+ pplx --image chart.png "Analyze this chart"
132
+
133
+ # Multiple attachments
134
+ pplx --file doc1.pdf --image img1.png "Analyze these files"
99
135
 
100
- # Model selection
136
+ # Output format selection
137
+ pplx --format jsonl "Machine learning trends"
138
+
139
+ # Choose AI models
101
140
  pplx --model sonar-pro "Detailed analysis"
102
141
  pplx --model sonar-reasoning "Complex problem solving"
142
+ ```
103
143
 
104
- # File attachments
105
- pplx --attach document.pdf "Summarize this report"
106
- pplx --attach-image chart.png "Analyze this chart"
144
+ **Advanced Interface (Power Users):**
145
+ ```bash
146
+ # Custom concurrency and timeout
147
+ pplx --concurrency 10 --timeout 60000 --format jsonl "machine learning trends"
107
148
 
108
- # Async processing
149
+ # Batch processing
150
+ pplx --input queries.json --concurrency 5
151
+
152
+ # Stream processing
153
+ cat queries.jsonl | pplx --stdin
154
+
155
+ # Advanced attachments (multiple files)
156
+ pplx --attach doc1.pdf --attach doc2.txt --attach-image img1.png "Analyze all files"
157
+
158
+ # Async processing with webhook
109
159
  pplx --async --webhook https://api.example.com/callback "Research task"
160
+
161
+ # Custom workspace
162
+ pplx --workspace /tmp/research "Custom workspace search"
163
+
164
+ # See all advanced options
165
+ pplx --help-advanced
110
166
  ```
111
167
 
112
168
  ### Batch Processing
@@ -139,7 +195,7 @@ pplx --input queries.json --format jsonl
139
195
  Supported file formats for analysis:
140
196
 
141
197
  **Documents (max 50MB):**
142
- - PDF, DOC, DOCX, TXT, RTF
198
+ - PDF, DOC, DOCX, TXT, RTF, MD
143
199
 
144
200
  **Images (max 50MB):**
145
201
  - PNG, JPEG, WebP, HEIF, HEIC, GIF
@@ -176,20 +232,44 @@ console.log(result);
176
232
 
177
233
  ## Configuration
178
234
 
235
+ ### Simplified Options (Everyday Usage)
236
+
179
237
  | Option | Short | Type | Default | Description |
180
238
  |--------|-------|------|---------|-------------|
181
- | `--input` | `-i` | string | - | Read batch requests from JSON file |
239
+ | `--file` | `-f` | string | - | Attach document (PDF, DOC, DOCX, TXT, RTF, MD) |
240
+ | `--image` | `-i` | string | - | Attach image (PNG, JPEG, WebP, HEIF, HEIC, GIF) |
241
+ | `--format` | `-o` | string | json | Output format: json|jsonl |
242
+ | `--model` | `-m` | string | sonar | AI model: sonar, sonar-pro, sonar-deep-research, sonar-reasoning |
243
+ | `--version` | `-v` | boolean | - | Show version |
244
+ | `--help` | `-h` | boolean | - | Show basic help |
245
+
246
+ ### Advanced Options (Power Users)
247
+
248
+ | Option | Short | Type | Default | Description |
249
+ |--------|-------|------|---------|-------------|
250
+ | `--input` | `-I` | string | - | Read batch requests from JSON file |
182
251
  | `--stdin` | `-s` | boolean | false | Read JSONL requests from stdin |
183
252
  | `--concurrency` | `-c` | number | 5 | Max concurrent requests (1-20) |
184
253
  | `--timeout` | `-t` | number | 30000 | Request timeout in ms (1000-300000) |
185
- | `--format` | `-f` | string | json | Output format: json|jsonl |
186
- | `--model` | `-m` | string | sonar | AI model to use |
187
- | `--attach` | - | string[] | - | Attach document files |
188
- | `--attach-image` | - | string[] | - | Attach image files |
254
+ | `--workspace` | `-w` | string | - | Workspace directory for sandboxing |
255
+ | `--attach` | - | string[] | - | Attach document files (multiple) |
256
+ | `--attach-image` | - | string[] | - | Attach image files (multiple) |
189
257
  | `--async` | - | boolean | false | Process requests asynchronously |
190
258
  | `--webhook` | - | string | - | Webhook URL for async notifications |
191
- | `--version` | `-v` | boolean | - | Show version |
192
- | `--help` | `-h` | boolean | - | Show help |
259
+ | `--help-advanced` | - | boolean | - | Show advanced help with all options |
260
+
261
+ ### Quick Reference
262
+
263
+ ```bash
264
+ # Basic usage (simplified)
265
+ pplx -f doc.pdf -m sonar-pro "analyze this"
266
+
267
+ # Advanced usage (full control)
268
+ pplx -I batch.json -c 10 -t 60000 --format jsonl "process all"
269
+
270
+ # See all available options
271
+ pplx --help-advanced
272
+ ```
193
273
 
194
274
  ### AI Models
195
275
 
package/dist/cli.js CHANGED
@@ -31,7 +31,7 @@ var __export = (target, all) => {
31
31
  var require_package = __commonJS((exports, module) => {
32
32
  module.exports = {
33
33
  name: "pplx-zero",
34
- version: "1.0.1",
34
+ version: "1.1.0",
35
35
  description: "Fast Perplexity AI search CLI with multimodal support - minimal setup, maximal results",
36
36
  type: "module",
37
37
  main: "dist/index.js",
@@ -94,7 +94,7 @@ var require_package = __commonJS((exports, module) => {
94
94
  license: "MIT",
95
95
  repository: {
96
96
  type: "git",
97
- url: "https://github.com/codewithkenzo/pplx-zero.git"
97
+ url: "git+https://github.com/codewithkenzo/pplx-zero.git"
98
98
  },
99
99
  files: [
100
100
  "dist",
@@ -6496,7 +6496,9 @@ var DOCUMENT_MIME_TYPES = {
6496
6496
  ".doc": "application/msword",
6497
6497
  ".docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
6498
6498
  ".txt": "text/plain",
6499
- ".rtf": "application/rtf"
6499
+ ".rtf": "application/rtf",
6500
+ ".md": "text/markdown",
6501
+ ".markdown": "text/markdown"
6500
6502
  };
6501
6503
  var MAX_FILE_SIZE = 50 * 1024 * 1024;
6502
6504
  var MAX_ATTACHMENTS = 10;
@@ -6671,9 +6673,6 @@ class PerplexitySearchTool {
6671
6673
  } else if (validatedInput.args.attachments) {
6672
6674
  attachments = validatedInput.args.attachments;
6673
6675
  }
6674
- if (validatedInput.args.attachments) {
6675
- attachments = [...attachments, ...validatedInput.args.attachments];
6676
- }
6677
6676
  const timeoutMs = validatedInput.options?.timeoutMs || 30000;
6678
6677
  const controller = new AbortController;
6679
6678
  if (signal) {
@@ -6984,15 +6983,18 @@ var __dirname2 = dirname(__filename2);
6984
6983
  var { values: cliOptions, positionals: commandLineQueries } = parseArgs({
6985
6984
  args: process.argv.slice(2),
6986
6985
  options: {
6987
- input: { type: "string", short: "i" },
6986
+ model: { type: "string", short: "m" },
6987
+ file: { type: "string", short: "f" },
6988
+ image: { type: "string", short: "i" },
6989
+ format: { type: "string", short: "o", default: "json" },
6990
+ version: { type: "boolean", short: "v" },
6991
+ help: { type: "boolean", short: "h" },
6992
+ "help-advanced": { type: "boolean" },
6993
+ input: { type: "string", short: "I" },
6988
6994
  stdin: { type: "boolean", short: "s" },
6989
6995
  concurrency: { type: "string", short: "c" },
6990
6996
  timeout: { type: "string", short: "t" },
6991
6997
  workspace: { type: "string", short: "w" },
6992
- format: { type: "string", short: "f", default: "json" },
6993
- version: { type: "boolean", short: "v" },
6994
- help: { type: "boolean", short: "h" },
6995
- model: { type: "string", short: "m" },
6996
6998
  attach: { type: "string", multiple: true },
6997
6999
  "attach-image": { type: "string", multiple: true },
6998
7000
  async: { type: "boolean" },
@@ -7002,62 +7004,100 @@ var { values: cliOptions, positionals: commandLineQueries } = parseArgs({
7002
7004
  });
7003
7005
  if (cliOptions.help) {
7004
7006
  console.error(`
7005
- PPLX-Zero - Minimal, fast Perplexity AI search CLI with multimodal support
7007
+ PPLX-Zero - Fast Perplexity AI search CLI with multimodal support
7006
7008
 
7007
7009
  USAGE:
7008
7010
  pplx [OPTIONS] [QUERY...]
7009
7011
 
7010
- OPTIONS:
7011
- -i, --input <file> Read batch requests from JSON file
7012
- -s, --stdin Read JSONL requests from stdin
7013
- -c, --concurrency <n> Max concurrent requests (default: 5)
7014
- -t, --timeout <ms> Request timeout in milliseconds (default: 30000)
7015
- -w, --workspace <path> Workspace directory for sandboxing
7016
- -f, --format <format> Output format: json|jsonl (default: json)
7017
- -m, --model <model> AI model: sonar, sonar-pro, sonar-deep-research, sonar-reasoning (default: sonar)
7018
- --attach <file> Attach document files (PDF, DOC, DOCX, TXT, RTF) - can be used multiple times
7019
- --attach-image <file> Attach image files (PNG, JPEG, WebP, HEIF, HEIC, GIF) - can be used multiple times
7020
- --async Process requests asynchronously
7021
- --webhook <url> Webhook URL for async notifications
7022
- -v, --version Show version
7023
- -h, --help Show this help
7012
+ BASIC OPTIONS:
7013
+ -m, --model <model> Choose AI model (sonar, sonar-pro, sonar-deep-research, sonar-reasoning)
7014
+ -f, --file <file> Attach document (PDF, DOC, DOCX, TXT, RTF)
7015
+ -i, --image <file> Attach image (PNG, JPEG, WebP, HEIF, HEIC, GIF)
7016
+ -o, --format <format> Output format (json, jsonl)
7017
+
7018
+ -v, --version Show version
7019
+ -h, --help Show this help
7024
7020
 
7025
7021
  EXAMPLES:
7026
- # Basic query
7022
+ # Simple search
7027
7023
  pplx "latest AI developments"
7028
7024
 
7029
- # Model selection
7030
- pplx --model sonar-pro "Detailed analysis"
7031
- pplx --model sonar-deep-research "Comprehensive research"
7032
- pplx --model sonar-reasoning "Complex problem solving"
7025
+ # Choose model for detailed analysis
7026
+ pplx --model sonar-pro "Explain quantum computing"
7033
7027
 
7034
- # Image analysis
7035
- pplx --attach-image screenshot.png --model sonar-pro "Analyze this interface"
7028
+ # Analyze document
7029
+ pplx --file report.pdf "Summarize this document"
7036
7030
 
7037
- # Document analysis
7038
- pplx --attach report.pdf --model sonar-deep-research "Summarize this document"
7031
+ # Analyze image
7032
+ pplx --image screenshot.png "What does this interface do?"
7039
7033
 
7040
- # Multimodal analysis
7041
- pplx --attach document.txt --attach-image chart.png --model sonar-reasoning "Analyze this data"
7034
+ # Document + image analysis
7035
+ pplx --file data.csv --image chart.png "Analyze this data"
7042
7036
 
7043
- # Async processing with webhook
7044
- pplx --async --webhook https://api.example.com/callback "Long research task"
7037
+ # Different AI models
7038
+ pplx --model sonar-reasoning "Solve this math problem"
7039
+ pplx --model sonar-deep-research "History of artificial intelligence"
7040
+
7041
+ # Advanced Usage (see --help-advanced):
7042
+ pplx --help-advanced
7043
+
7044
+ SUPPORTED FORMATS:
7045
+ Documents: PDF, DOC, DOCX, TXT, RTF (max 50MB)
7046
+ Images: PNG, JPEG, WebP, HEIF, HEIC, GIF (max 50MB)
7045
7047
 
7046
- # Batch from file
7048
+ Get your API key: https://www.perplexity.ai/account/api/keys
7049
+ Set environment variable: export PERPLEXITY_API_KEY="your-key"
7050
+ `);
7051
+ process.exit(0);
7052
+ }
7053
+ if (cliOptions["help-advanced"]) {
7054
+ console.error(`
7055
+ PPLX-Zero - Advanced Usage Options
7056
+
7057
+ USAGE:
7058
+ pplx [ADVANCED-OPTIONS] [QUERY...]
7059
+
7060
+ ADVANCED OPTIONS:
7061
+ -I, --input <file> Read batch requests from JSON file
7062
+ -s, --stdin Read JSONL requests from stdin
7063
+ -c, --concurrency <n> Max concurrent requests (default: 5, max: 20)
7064
+ -t, --timeout <ms> Request timeout in milliseconds (default: 30000)
7065
+ -w, --workspace <path> Workspace directory for sandboxing
7066
+ -o, --format <format> Output format: json|jsonl (default: json)
7067
+ -m, --model <model> AI model (default: sonar)
7068
+
7069
+ --attach <file> Attach document files (can be used multiple times)
7070
+ --attach-image <file> Attach image files (can be used multiple times)
7071
+ --async Process requests asynchronously
7072
+ --webhook <url> Webhook URL for async notifications
7073
+
7074
+ -v, --version Show version
7075
+ -h, --help Show basic help
7076
+
7077
+ ADVANCED EXAMPLES:
7078
+ # Batch processing
7047
7079
  pplx --input queries.json
7048
7080
 
7049
- # Streaming from stdin
7081
+ # Stream processing
7050
7082
  cat queries.jsonl | pplx --stdin
7051
7083
 
7052
- # JSONL output for streaming
7053
- pplx --format jsonl --input queries.json
7084
+ # Custom concurrency and timeout
7085
+ pplx --concurrency 10 --timeout 60000 "Multiple searches"
7054
7086
 
7055
- # High concurrency batch with attachments
7056
- pplx --concurrency 10 --timeout 60000 --input queries.json --attach appendix.pdf
7087
+ # High performance batch
7088
+ pplx --input queries.json --concurrency 15 --format jsonl
7057
7089
 
7058
- SUPPORTED FORMATS:
7059
- Images: PNG, JPEG, WebP, HEIF, HEIC, GIF (max 50MB, 10 files)
7060
- Documents: PDF, DOC, DOCX, TXT, RTF (max 50MB, 10 files)
7090
+ # Multiple attachments (advanced syntax)
7091
+ pplx --attach doc1.pdf --attach doc2.txt --attach-image img1.png "Analyze all files"
7092
+
7093
+ # Async processing with webhook
7094
+ pplx --async --webhook https://api.example.com/webhook "Long research task"
7095
+
7096
+ # Custom workspace
7097
+ pplx --workspace /tmp/research "Custom workspace search"
7098
+
7099
+ # Basic Usage (see --help):
7100
+ pplx --help
7061
7101
  `);
7062
7102
  process.exit(0);
7063
7103
  }
@@ -7164,7 +7204,7 @@ async function main() {
7164
7204
  model: selectedModel,
7165
7205
  async: cliOptions.async,
7166
7206
  webhook: cliOptions.webhook,
7167
- hasAttachments: (cliOptions.attach?.length || 0) + (cliOptions["attach-image"]?.length || 0) > 0
7207
+ hasAttachments: (cliOptions.file || cliOptions.image || (cliOptions.attach?.length || 0) + (cliOptions["attach-image"]?.length || 0)) > 0
7168
7208
  }
7169
7209
  });
7170
7210
  let batchSearchInput;
@@ -7178,6 +7218,18 @@ async function main() {
7178
7218
  } else if (commandLineQueries.length > 0) {
7179
7219
  const combinedQuery = commandLineQueries.join(" ");
7180
7220
  const attachmentInputs = [];
7221
+ if (cliOptions.file) {
7222
+ attachmentInputs.push({
7223
+ path: cliOptions.file,
7224
+ type: "document"
7225
+ });
7226
+ }
7227
+ if (cliOptions.image) {
7228
+ attachmentInputs.push({
7229
+ path: cliOptions.image,
7230
+ type: "image"
7231
+ });
7232
+ }
7181
7233
  if (cliOptions.attach && cliOptions.attach.length > 0) {
7182
7234
  for (const filePath of cliOptions.attach) {
7183
7235
  attachmentInputs.push({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pplx-zero",
3
- "version": "1.0.1",
3
+ "version": "1.1.1",
4
4
  "description": "Fast Perplexity AI search CLI with multimodal support - minimal setup, maximal results",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -63,7 +63,7 @@
63
63
  "license": "MIT",
64
64
  "repository": {
65
65
  "type": "git",
66
- "url": "https://github.com/codewithkenzo/pplx-zero.git"
66
+ "url": "git+https://github.com/codewithkenzo/pplx-zero.git"
67
67
  },
68
68
  "files": [
69
69
  "dist",
@@ -71,4 +71,4 @@
71
71
  "LICENSE",
72
72
  "package.json"
73
73
  ]
74
- }
74
+ }