nexrall-code 0.5.208 → 0.5.209

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 +1 -1
  2. package/dist/index.js +42 -19
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -7,7 +7,7 @@ npm install -g nexrall-code
7
7
  nex
8
8
  ```
9
9
 
10
- Requires Node.js 20+ and a Nexrall account — it signs in with the same account as the extension; billing stays in one place and there are no API keys to configure.
10
+ Requires Node.js 20+ and a Nexrall account. **Signing in happens in the terminal** — no editor, no VS Code login first: the first `nex` (or `nex auth`) asks how you want to sign in, with a browser hand-off that works for Google/Apple/SSO accounts as well as email + password or a token. It is the same account as the extension, so billing stays in one place and there are no API keys to configure.
11
11
 
12
12
  ## Quick start
13
13
 
package/dist/index.js CHANGED
@@ -80240,6 +80240,12 @@ function parseAuthMethod(input) {
80240
80240
  return "token";
80241
80241
  return null;
80242
80242
  }
80243
+ function shouldOfferLogin(ctx) {
80244
+ return ctx.isTTY && !ctx.headless;
80245
+ }
80246
+ function stripPasteMarkers(raw) {
80247
+ return raw.replace(/\u001b\[[0-9;?]*[~A-Za-z]/g, "").replace(/\u001b/g, "");
80248
+ }
80243
80249
  function prompt(question, hidden = false) {
80244
80250
  return new Promise((resolve19) => {
80245
80251
  const rl = readline.createInterface({
@@ -80250,30 +80256,38 @@ function prompt(question, hidden = false) {
80250
80256
  if (hidden) {
80251
80257
  process.stdout.write(question);
80252
80258
  let value = "";
80259
+ let finished = false;
80253
80260
  const { stdin } = process;
80254
80261
  const wasRaw = stdin.isRaw;
80255
80262
  stdin.setRawMode(true);
80256
80263
  stdin.resume();
80257
80264
  stdin.setEncoding("utf8");
80258
- const onData = (char) => {
80259
- if (char === "\n" || char === "\r" || char === "") {
80260
- stdin.setRawMode(wasRaw ?? false);
80261
- stdin.pause();
80262
- stdin.removeListener("data", onData);
80263
- rl.close();
80264
- process.stdout.write("\n");
80265
- if (char === "") {
80266
- process.exit(0);
80267
- }
80268
- resolve19(value);
80269
- return;
80270
- }
80271
- if (char === "\x7F" || char === "\b") {
80272
- if (value.length > 0)
80273
- value = value.slice(0, -1);
80265
+ const finish = (submit) => {
80266
+ if (finished)
80274
80267
  return;
80268
+ finished = true;
80269
+ stdin.setRawMode(wasRaw ?? false);
80270
+ stdin.pause();
80271
+ stdin.removeListener("data", onData);
80272
+ rl.close();
80273
+ process.stdout.write("\n");
80274
+ if (!submit)
80275
+ process.exit(0);
80276
+ resolve19(stripPasteMarkers(value));
80277
+ };
80278
+ const onData = (chunk) => {
80279
+ for (const char of chunk) {
80280
+ if (char === "\n" || char === "\r")
80281
+ return finish(true);
80282
+ if (char === "")
80283
+ return finish(false);
80284
+ if (char === "\x7F" || char === "\b") {
80285
+ if (value.length > 0)
80286
+ value = value.slice(0, -1);
80287
+ continue;
80288
+ }
80289
+ value += char;
80275
80290
  }
80276
- value += char;
80277
80291
  };
80278
80292
  stdin.on("data", onData);
80279
80293
  } else {
@@ -114900,8 +114914,17 @@ program2.option("-y, --yolo", "Auto-approve all tool calls (no permission prompt
114900
114914
  "Settings (permissions, hooks\u2026) for this run only: a JSON file or an inline JSON object; merged over the user/project settings"
114901
114915
  ).option("--debug-file <path>", "Write the --debug diagnostics log to this file (implies --debug)").argument("[prompt...]", "One-shot prompt \u2014 if omitted, starts interactive mode").action(async (promptParts, options) => {
114902
114916
  if (!(0, import_code_core78.isAuthenticated)()) {
114903
- console.error("Not logged in. Run: nex auth");
114904
- process.exit(1);
114917
+ if (!shouldOfferLogin({
114918
+ isTTY: !!process.stdin.isTTY,
114919
+ headless: !!(options.print || options.outputFormat)
114920
+ })) {
114921
+ console.error("Not logged in. Run: nex auth (or set NEXRALL_TOKEN for CI)");
114922
+ process.exit(1);
114923
+ }
114924
+ console.log(paint.dim(" Not signed in yet \u2014 signing in first (Ctrl+C cancels)."));
114925
+ await authCommand();
114926
+ if (!(0, import_code_core78.isAuthenticated)())
114927
+ process.exit(process.exitCode || 1);
114905
114928
  }
114906
114929
  const model = options.model ?? "deepseek-flash";
114907
114930
  const workDir = options.dir ? path35.resolve(options.dir) : process.cwd();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexrall-code",
3
- "version": "0.5.208",
3
+ "version": "0.5.209",
4
4
  "description": "Nexrall Code — AI coding assistant for your terminal (headless agent for scripts, CI and automation)",
5
5
  "keywords": [
6
6
  "ai",