refineo-cli 0.0.7 → 0.1.4

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
@@ -3,7 +3,7 @@
3
3
  [![npm version](https://img.shields.io/npm/v/refineo-cli)](https://www.npmjs.com/package/refineo-cli)
4
4
  [![PyPI version](https://img.shields.io/pypi/v/refineo-cli)](https://pypi.org/project/refineo-cli/)
5
5
 
6
- CLI and MCP tools for [Refineo](https://refineo.app) - Transform AI-generated text into natural human writing.
6
+ CLI and MCP tools for [Refineo](https://www.refineo.app) - Transform AI-generated text into natural human writing.
7
7
 
8
8
  ## Quick Start
9
9
 
@@ -49,6 +49,7 @@ refineo humanize "text" --model enhanced # Use enhanced model (default)
49
49
  refineo humanize "text" --model standard # Use standard model
50
50
  refineo humanize --file input.txt # Read from file
51
51
  refineo humanize --file input.txt --output output.txt # Write to file
52
+ refineo humanize "text" --verbose # Show debug output
52
53
  echo "text" | refineo humanize # Read from stdin
53
54
  ```
54
55
 
@@ -78,56 +79,61 @@ Refineo provides an MCP server for integration with Claude Desktop, Cursor, and
78
79
  | `humanize_text` | Transform AI-generated text into natural human writing |
79
80
  | `get_usage` | Check remaining quota for current billing period |
80
81
 
81
- ### Setup for Claude Desktop
82
+ ### Authentication Options
82
83
 
83
- 1. First, get your access token:
84
- ```bash
85
- refineo login
86
- cat ~/.refineo/credentials.json # Copy accessToken value
87
- ```
84
+ **Option 1: API Key (Recommended for MCP)**
88
85
 
89
- 2. Add to Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):
90
- ```json
91
- {
92
- "mcpServers": {
93
- "refineo": {
94
- "url": "https://refineo.app/mcp/mcp",
95
- "headers": {
96
- "Authorization": "Bearer YOUR_ACCESS_TOKEN"
97
- }
98
- }
99
- }
100
- }
101
- ```
86
+ API keys are long-lived (7 days to 1 year) and don't require refresh. Create one at [www.refineo.app/dashboard/api-keys](https://www.refineo.app/dashboard/api-keys).
102
87
 
103
- ### Setup for Cursor
88
+ **Option 2: Bearer Token**
104
89
 
105
- Add to Cursor MCP settings:
90
+ Use the CLI to get a short-lived access token (15 minutes). Suitable for quick testing.
91
+
92
+ ### Setup for Claude Code
93
+
94
+ Run this command (replace `sk_your_api_key` with your actual key):
95
+
96
+ ```bash
97
+ claude mcp add-json refineo '{"type":"http","url":"https://www.refineo.app/mcp/mcp","headers":{"X-API-Key":"sk_your_api_key"}}'
98
+ ```
99
+
100
+ ### Setup for Claude Desktop (Native OAuth - Recommended)
101
+
102
+ 1. Open Claude Desktop → Settings → Connectors
103
+ 2. Click "Add custom connector"
104
+ 3. Enter URL: `https://www.refineo.app/mcp/mcp`
105
+ 4. Click Add → Sign in with your Refineo account
106
+
107
+ No API key needed - uses OAuth authentication.
108
+
109
+ ### Setup for Claude Desktop / Cursor (API Key)
110
+
111
+ Alternatively, use an API key with the config file:
112
+ - **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
113
+ - **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
106
114
 
107
115
  ```json
108
116
  {
109
117
  "mcpServers": {
110
118
  "refineo": {
111
- "url": "https://refineo.app/mcp/mcp",
112
- "headers": {
113
- "Authorization": "Bearer YOUR_ACCESS_TOKEN"
114
- }
119
+ "command": "npx",
120
+ "args": [
121
+ "mcp-remote",
122
+ "https://www.refineo.app/mcp/mcp",
123
+ "--header",
124
+ "X-API-Key:sk_your_api_key_here"
125
+ ]
115
126
  }
116
127
  }
117
128
  }
118
129
  ```
119
130
 
120
- ### Token Refresh
121
-
122
- Access tokens expire after 15 minutes. For long-running MCP sessions, you may need to refresh periodically:
131
+ > Requires Node.js. Uses [mcp-remote](https://github.com/geelen/mcp-remote) as a proxy.
123
132
 
124
- ```bash
125
- # Check token status
126
- refineo stats
133
+ ### Token Refresh
127
134
 
128
- # Re-login if expired
129
- refineo login
130
- ```
135
+ - **API Keys**: No refresh needed until expiry (7d-1y). Create new keys at [dashboard/api-keys](https://www.refineo.app/dashboard/api-keys).
136
+ - **Bearer Tokens**: Expire after 15 minutes. Run `refineo login` to refresh.
131
137
 
132
138
  ## Development
133
139
 
@@ -150,9 +156,10 @@ refineo login
150
156
 
151
157
  ## Links
152
158
 
153
- - [Refineo App](https://refineo.app)
154
- - [Pricing](https://refineo.app/pricing)
155
- - [Manage Connected Devices](https://refineo.app/dashboard/sessions)
159
+ - [Refineo App](https://www.refineo.app)
160
+ - [Pricing](https://www.refineo.app/pricing)
161
+ - [Manage API Keys](https://www.refineo.app/dashboard/api-keys)
162
+ - [Manage Connected Devices](https://www.refineo.app/dashboard/sessions)
156
163
 
157
164
  ## License
158
165
 
package/dist/cjs/api.js CHANGED
@@ -74,9 +74,11 @@ function getPlatformInfo() {
74
74
 
75
75
  // src/api.ts
76
76
  var USER_AGENT = getPlatformInfo();
77
- var DEBUG = process.env.REFINEO_DEBUG === "1" || process.env.REFINEO_DEBUG === "true";
77
+ function isDebug() {
78
+ return process.env.REFINEO_DEBUG === "1" || process.env.REFINEO_DEBUG === "true";
79
+ }
78
80
  function debug(...args) {
79
- if (DEBUG) {
81
+ if (isDebug()) {
80
82
  console.error("[refineo-debug]", ...args);
81
83
  }
82
84
  }
@@ -121,7 +123,14 @@ async function apiRequest(path, options = {}) {
121
123
  } catch {
122
124
  error = { error: errorText || "Unknown error" };
123
125
  }
124
- throw new Error(error.message || error.error_description || error.error || `HTTP ${response.status}`);
126
+ let errorMessage = "";
127
+ if (Array.isArray(error.details) && error.details.length > 0) {
128
+ errorMessage = error.details.map((d) => d.message).filter(Boolean).join("; ");
129
+ }
130
+ if (!errorMessage) {
131
+ errorMessage = error.message || error.error_description || error.error || `HTTP ${response.status}`;
132
+ }
133
+ throw new Error(errorMessage);
125
134
  }
126
135
  return response.json();
127
136
  }
package/dist/cjs/cli.js CHANGED
@@ -81,9 +81,11 @@ function getPlatformInfo() {
81
81
 
82
82
  // src/api.ts
83
83
  var USER_AGENT = getPlatformInfo();
84
- var DEBUG = process.env.REFINEO_DEBUG === "1" || process.env.REFINEO_DEBUG === "true";
84
+ function isDebug() {
85
+ return process.env.REFINEO_DEBUG === "1" || process.env.REFINEO_DEBUG === "true";
86
+ }
85
87
  function debug(...args) {
86
- if (DEBUG) {
88
+ if (isDebug()) {
87
89
  console.error("[refineo-debug]", ...args);
88
90
  }
89
91
  }
@@ -128,7 +130,14 @@ async function apiRequest(path, options = {}) {
128
130
  } catch {
129
131
  error = { error: errorText || "Unknown error" };
130
132
  }
131
- throw new Error(error.message || error.error_description || error.error || `HTTP ${response.status}`);
133
+ let errorMessage = "";
134
+ if (Array.isArray(error.details) && error.details.length > 0) {
135
+ errorMessage = error.details.map((d) => d.message).filter(Boolean).join("; ");
136
+ }
137
+ if (!errorMessage) {
138
+ errorMessage = error.message || error.error_description || error.error || `HTTP ${response.status}`;
139
+ }
140
+ throw new Error(errorMessage);
132
141
  }
133
142
  return response.json();
134
143
  }
@@ -258,7 +267,7 @@ async function getUsage() {
258
267
  }
259
268
 
260
269
  // src/cli.ts
261
- var VERSION = "0.1.0";
270
+ var VERSION = "0.1.4";
262
271
  var colors = {
263
272
  reset: "\x1B[0m",
264
273
  bold: "\x1B[1m",
@@ -386,6 +395,7 @@ async function humanizeCommand(args) {
386
395
  let model = "enhanced";
387
396
  let inputFile = "";
388
397
  let outputFile = "";
398
+ let verbose = false;
389
399
  for (let i = 0; i < args.length; i++) {
390
400
  const arg = args[i];
391
401
  if (arg === "--model" || arg === "-m") {
@@ -400,10 +410,15 @@ async function humanizeCommand(args) {
400
410
  inputFile = args[++i];
401
411
  } else if (arg === "--output" || arg === "-o") {
402
412
  outputFile = args[++i];
413
+ } else if (arg === "--verbose" || arg === "-v") {
414
+ verbose = true;
403
415
  } else if (!arg.startsWith("-")) {
404
416
  text = arg;
405
417
  }
406
418
  }
419
+ if (verbose) {
420
+ process.env.REFINEO_DEBUG = "1";
421
+ }
407
422
  if (inputFile) {
408
423
  if (!(0, import_fs2.existsSync)(inputFile)) {
409
424
  printError(`File not found: ${inputFile}`);
@@ -458,6 +473,7 @@ ${colors.bold}Humanize Options:${colors.reset}
458
473
  -m, --model <model> Model: "standard" or "enhanced" (default: enhanced)
459
474
  -f, --file <path> Read input from file
460
475
  -o, --output <path> Write output to file
476
+ -v, --verbose Show debug output
461
477
 
462
478
  ${colors.bold}Examples:${colors.reset}
463
479
  ${colors.dim}# Login to your account${colors.reset}
@@ -479,7 +495,7 @@ ${colors.bold}Examples:${colors.reset}
479
495
  refineo stats
480
496
 
481
497
  ${colors.bold}More Info:${colors.reset}
482
- https://refineo.app/docs/cli
498
+ https://www.refineo.app/docs/cli
483
499
  `);
484
500
  }
485
501
  function versionCommand() {
package/dist/cjs/index.js CHANGED
@@ -88,9 +88,11 @@ function getPlatformInfo() {
88
88
 
89
89
  // src/api.ts
90
90
  var USER_AGENT = getPlatformInfo();
91
- var DEBUG = process.env.REFINEO_DEBUG === "1" || process.env.REFINEO_DEBUG === "true";
91
+ function isDebug() {
92
+ return process.env.REFINEO_DEBUG === "1" || process.env.REFINEO_DEBUG === "true";
93
+ }
92
94
  function debug(...args) {
93
- if (DEBUG) {
95
+ if (isDebug()) {
94
96
  console.error("[refineo-debug]", ...args);
95
97
  }
96
98
  }
@@ -135,7 +137,14 @@ async function apiRequest(path, options = {}) {
135
137
  } catch {
136
138
  error = { error: errorText || "Unknown error" };
137
139
  }
138
- throw new Error(error.message || error.error_description || error.error || `HTTP ${response.status}`);
140
+ let errorMessage = "";
141
+ if (Array.isArray(error.details) && error.details.length > 0) {
142
+ errorMessage = error.details.map((d) => d.message).filter(Boolean).join("; ");
143
+ }
144
+ if (!errorMessage) {
145
+ errorMessage = error.message || error.error_description || error.error || `HTTP ${response.status}`;
146
+ }
147
+ throw new Error(errorMessage);
139
148
  }
140
149
  return response.json();
141
150
  }
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EAGlB,cAAc,EACd,UAAU,EACX,MAAM,YAAY,CAAC;AAuHpB;;GAEG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAcvE;AAED;;GAEG;AACH,wBAAsB,YAAY,CAChC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,MAAM,IAAI,GAClB,OAAO,CAAC,WAAW,CAAC,CA8DtB;AAED;;GAEG;AACH,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,MAAM,EACZ,KAAK,GAAE,UAAU,GAAG,UAAuB,GAC1C,OAAO,CAAC,cAAc,CAAC,CAqBzB;AAED;;GAEG;AACH,wBAAsB,QAAQ,IAAI,OAAO,CAAC,UAAU,CAAC,CAoBpD"}
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EAGlB,cAAc,EACd,UAAU,EACX,MAAM,YAAY,CAAC;AAmIpB;;GAEG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAcvE;AAED;;GAEG;AACH,wBAAsB,YAAY,CAChC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,MAAM,IAAI,GAClB,OAAO,CAAC,WAAW,CAAC,CA8DtB;AAED;;GAEG;AACH,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,MAAM,EACZ,KAAK,GAAE,UAAU,GAAG,UAAuB,GAC1C,OAAO,CAAC,cAAc,CAAC,CAqBzB;AAED;;GAEG;AACH,wBAAsB,QAAQ,IAAI,OAAO,CAAC,UAAU,CAAC,CAoBpD"}
package/dist/esm/api.js CHANGED
@@ -45,9 +45,11 @@ function getPlatformInfo() {
45
45
 
46
46
  // src/api.ts
47
47
  var USER_AGENT = getPlatformInfo();
48
- var DEBUG = process.env.REFINEO_DEBUG === "1" || process.env.REFINEO_DEBUG === "true";
48
+ function isDebug() {
49
+ return process.env.REFINEO_DEBUG === "1" || process.env.REFINEO_DEBUG === "true";
50
+ }
49
51
  function debug(...args) {
50
- if (DEBUG) {
52
+ if (isDebug()) {
51
53
  console.error("[refineo-debug]", ...args);
52
54
  }
53
55
  }
@@ -92,7 +94,14 @@ async function apiRequest(path, options = {}) {
92
94
  } catch {
93
95
  error = { error: errorText || "Unknown error" };
94
96
  }
95
- throw new Error(error.message || error.error_description || error.error || `HTTP ${response.status}`);
97
+ let errorMessage = "";
98
+ if (Array.isArray(error.details) && error.details.length > 0) {
99
+ errorMessage = error.details.map((d) => d.message).filter(Boolean).join("; ");
100
+ }
101
+ if (!errorMessage) {
102
+ errorMessage = error.message || error.error_description || error.error || `HTTP ${response.status}`;
103
+ }
104
+ throw new Error(errorMessage);
96
105
  }
97
106
  return response.json();
98
107
  }
package/dist/esm/cli.js CHANGED
@@ -58,9 +58,11 @@ function getPlatformInfo() {
58
58
 
59
59
  // src/api.ts
60
60
  var USER_AGENT = getPlatformInfo();
61
- var DEBUG = process.env.REFINEO_DEBUG === "1" || process.env.REFINEO_DEBUG === "true";
61
+ function isDebug() {
62
+ return process.env.REFINEO_DEBUG === "1" || process.env.REFINEO_DEBUG === "true";
63
+ }
62
64
  function debug(...args) {
63
- if (DEBUG) {
65
+ if (isDebug()) {
64
66
  console.error("[refineo-debug]", ...args);
65
67
  }
66
68
  }
@@ -105,7 +107,14 @@ async function apiRequest(path, options = {}) {
105
107
  } catch {
106
108
  error = { error: errorText || "Unknown error" };
107
109
  }
108
- throw new Error(error.message || error.error_description || error.error || `HTTP ${response.status}`);
110
+ let errorMessage = "";
111
+ if (Array.isArray(error.details) && error.details.length > 0) {
112
+ errorMessage = error.details.map((d) => d.message).filter(Boolean).join("; ");
113
+ }
114
+ if (!errorMessage) {
115
+ errorMessage = error.message || error.error_description || error.error || `HTTP ${response.status}`;
116
+ }
117
+ throw new Error(errorMessage);
109
118
  }
110
119
  return response.json();
111
120
  }
@@ -235,7 +244,7 @@ async function getUsage() {
235
244
  }
236
245
 
237
246
  // src/cli.ts
238
- var VERSION = "0.1.0";
247
+ var VERSION = "0.1.4";
239
248
  var colors = {
240
249
  reset: "\x1B[0m",
241
250
  bold: "\x1B[1m",
@@ -363,6 +372,7 @@ async function humanizeCommand(args) {
363
372
  let model = "enhanced";
364
373
  let inputFile = "";
365
374
  let outputFile = "";
375
+ let verbose = false;
366
376
  for (let i = 0; i < args.length; i++) {
367
377
  const arg = args[i];
368
378
  if (arg === "--model" || arg === "-m") {
@@ -377,10 +387,15 @@ async function humanizeCommand(args) {
377
387
  inputFile = args[++i];
378
388
  } else if (arg === "--output" || arg === "-o") {
379
389
  outputFile = args[++i];
390
+ } else if (arg === "--verbose" || arg === "-v") {
391
+ verbose = true;
380
392
  } else if (!arg.startsWith("-")) {
381
393
  text = arg;
382
394
  }
383
395
  }
396
+ if (verbose) {
397
+ process.env.REFINEO_DEBUG = "1";
398
+ }
384
399
  if (inputFile) {
385
400
  if (!existsSync2(inputFile)) {
386
401
  printError(`File not found: ${inputFile}`);
@@ -435,6 +450,7 @@ ${colors.bold}Humanize Options:${colors.reset}
435
450
  -m, --model <model> Model: "standard" or "enhanced" (default: enhanced)
436
451
  -f, --file <path> Read input from file
437
452
  -o, --output <path> Write output to file
453
+ -v, --verbose Show debug output
438
454
 
439
455
  ${colors.bold}Examples:${colors.reset}
440
456
  ${colors.dim}# Login to your account${colors.reset}
@@ -456,7 +472,7 @@ ${colors.bold}Examples:${colors.reset}
456
472
  refineo stats
457
473
 
458
474
  ${colors.bold}More Info:${colors.reset}
459
- https://refineo.app/docs/cli
475
+ https://www.refineo.app/docs/cli
460
476
  `);
461
477
  }
462
478
  function versionCommand() {
package/dist/esm/index.js CHANGED
@@ -53,9 +53,11 @@ function getPlatformInfo() {
53
53
 
54
54
  // src/api.ts
55
55
  var USER_AGENT = getPlatformInfo();
56
- var DEBUG = process.env.REFINEO_DEBUG === "1" || process.env.REFINEO_DEBUG === "true";
56
+ function isDebug() {
57
+ return process.env.REFINEO_DEBUG === "1" || process.env.REFINEO_DEBUG === "true";
58
+ }
57
59
  function debug(...args) {
58
- if (DEBUG) {
60
+ if (isDebug()) {
59
61
  console.error("[refineo-debug]", ...args);
60
62
  }
61
63
  }
@@ -100,7 +102,14 @@ async function apiRequest(path, options = {}) {
100
102
  } catch {
101
103
  error = { error: errorText || "Unknown error" };
102
104
  }
103
- throw new Error(error.message || error.error_description || error.error || `HTTP ${response.status}`);
105
+ let errorMessage = "";
106
+ if (Array.isArray(error.details) && error.details.length > 0) {
107
+ errorMessage = error.details.map((d) => d.message).filter(Boolean).join("; ");
108
+ }
109
+ if (!errorMessage) {
110
+ errorMessage = error.message || error.error_description || error.error || `HTTP ${response.status}`;
111
+ }
112
+ throw new Error(errorMessage);
104
113
  }
105
114
  return response.json();
106
115
  }
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "refineo-cli",
3
- "version": "0.0.7",
3
+ "version": "0.1.4",
4
4
  "description": "Refineo AI Text Humanizer CLI - Transform AI-generated text into natural human writing",
5
5
  "type": "module",
6
6
  "main": "./dist/esm/index.js",
7
7
  "module": "./dist/esm/index.js",
8
8
  "types": "./dist/esm/index.d.ts",
9
9
  "bin": {
10
- "refineo": "./dist/esm/cli.js"
10
+ "refineo": "dist/esm/cli.js"
11
11
  },
12
12
  "exports": {
13
13
  ".": {
@@ -44,7 +44,11 @@
44
44
  ],
45
45
  "author": "Refineo",
46
46
  "license": "MIT",
47
- "homepage": "https://refineo.app",
47
+ "homepage": "https://www.refineo.app",
48
+ "repository": {
49
+ "type": "git",
50
+ "url": "https://github.com/DADAExperiments/refineo-ai-tools.git"
51
+ },
48
52
  "engines": {
49
53
  "node": ">=18.0.0"
50
54
  },