@kiyeonjeon21/ncli 0.1.5 → 0.1.7

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.
@@ -4,17 +4,18 @@ import { createInterface } from "readline";
4
4
  import { NCLI_DIR, NCLI_ENV_PATH, loadConfig } from "../core/config.js";
5
5
  import { printJson } from "../core/output.js";
6
6
  function prompt(question, mask = false) {
7
- return new Promise((resolve) => {
8
- process.stderr.write(question);
9
- if (!mask) {
10
- const rl = createInterface({ input: process.stdin, output: process.stderr });
11
- rl.question("", (answer) => {
7
+ if (!mask) {
8
+ const rl = createInterface({ input: process.stdin, output: process.stderr });
9
+ return new Promise((resolve) => {
10
+ rl.question(question, (answer) => {
12
11
  rl.close();
13
12
  resolve(answer.trim());
14
13
  });
15
- return;
16
- }
17
- // Masked input
14
+ });
15
+ }
16
+ // Masked input
17
+ return new Promise((resolve) => {
18
+ process.stderr.write(question);
18
19
  const stdin = process.stdin;
19
20
  const wasRaw = stdin.isRaw;
20
21
  if (stdin.isTTY)
@@ -75,7 +76,7 @@ export const initCommand = new Command("init")
75
76
  process.stderr.write(" Register an app at: https://developers.naver.com/apps/\n");
76
77
  process.stderr.write(" Select APIs: Search, DataLab, etc.\n");
77
78
  process.stderr.write(" Web service URL: http://localhost\n\n");
78
- const clientId = await prompt(" Client ID: ", true);
79
+ const clientId = await prompt(" Client ID: ");
79
80
  if (!clientId) {
80
81
  process.stderr.write(" Aborted — no Client ID provided.\n");
81
82
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiyeonjeon21/ncli",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "Agent-native CLI for Naver Open APIs",
5
5
  "type": "module",
6
6
  "bin": {