@robinpath/cli 2.1.0 → 2.3.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 (2) hide show
  1. package/dist/cli.mjs +16 -17
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -18598,7 +18598,7 @@ function getNativeModules() {
18598
18598
  import { join as join3, basename as basename2 } from "node:path";
18599
18599
  import { homedir as homedir2, platform as platform2 } from "node:os";
18600
18600
  import { existsSync as existsSync2 } from "node:fs";
18601
- var CLI_VERSION = true ? "2.1.0" : "2.1.0";
18601
+ var CLI_VERSION = true ? "2.3.0" : "2.3.0";
18602
18602
  var FLAG_QUIET = false;
18603
18603
  var FLAG_VERBOSE = false;
18604
18604
  var FLAG_AUTO_ACCEPT = false;
@@ -24531,7 +24531,7 @@ function ChatApp({ engine }) {
24531
24531
  /* @__PURE__ */ jsx2(Static, { items: messages, children: (msg) => /* @__PURE__ */ jsx2(Box2, { paddingX: 1, marginBottom: msg.text.startsWith("\u276F") ? 0 : 1, flexDirection: "column", children: msg.text.startsWith("\u276F") ? /* @__PURE__ */ jsxs2(Text2, { children: [
24532
24532
  /* @__PURE__ */ jsx2(Text2, { color: "cyan", bold: true, children: "\u276F" }),
24533
24533
  /* @__PURE__ */ jsx2(Text2, { bold: true, children: msg.text.slice(1) })
24534
- ] }) : msg.dim ? /* @__PURE__ */ jsx2(Text2, { dimColor: true, wrap: "wrap", children: msg.text }) : /* @__PURE__ */ jsx2(Markdown, { children: msg.text }) }, msg.id) }),
24534
+ ] }) : msg.text.includes("\u23BF") ? /* @__PURE__ */ jsx2(Text2, { dimColor: true, wrap: "wrap", children: msg.text }) : msg.dim ? /* @__PURE__ */ jsx2(Text2, { dimColor: true, wrap: "wrap", children: msg.text }) : /* @__PURE__ */ jsx2(Markdown, { children: msg.text }) }, msg.id) }),
24535
24535
  showModelPicker ? /* @__PURE__ */ jsx2(
24536
24536
  ModelSelector,
24537
24537
  {
@@ -24784,26 +24784,25 @@ Type / to see available commands.`;
24784
24784
  await new Promise((r) => setTimeout(r, 100));
24785
24785
  const cmdResults = [];
24786
24786
  for (const cmd of commands) {
24787
- const preview = cmd.split("\n")[0].slice(0, 80);
24788
- ui?.addMessage(`$ ${preview}${cmd.includes("\n") ? " ..." : ""}`, true);
24787
+ const firstLine = cmd.split("\n")[0].slice(0, 70);
24788
+ const isMultiline = cmd.includes("\n");
24789
24789
  const r = await executeShellCommand(cmd);
24790
24790
  cmdResults.push({ command: cmd, stdout: r.stdout || "", stderr: r.stderr || "", exitCode: r.exitCode });
24791
- if (r.exitCode === 0 && r.stdout?.trim()) {
24792
- const lines = r.stdout.trim().split("\n");
24793
- if (lines.length <= 15) {
24794
- ui?.addMessage(lines.join("\n"), true);
24791
+ if (r.exitCode === 0) {
24792
+ const output = (r.stdout || "").trim();
24793
+ if (output) {
24794
+ const lines = output.split("\n");
24795
+ const preview = lines.length <= 4 ? lines.map((l) => ` ${l}`).join("\n") : lines.slice(0, 3).map((l) => ` ${l}`).join("\n") + `
24796
+ \u2026 ${lines.length - 3} more lines`;
24797
+ ui?.addMessage(` \u23BF Execute(${firstLine}${isMultiline ? " \u2026" : ""})
24798
+ ${preview}`, true);
24795
24799
  } else {
24796
- ui?.addMessage(
24797
- `${lines.slice(0, 5).join("\n")}
24798
- ... (${lines.length - 10} lines hidden)
24799
- ${lines.slice(-5).join("\n")}`,
24800
- true
24801
- );
24800
+ ui?.addMessage(` \u23BF Execute(${firstLine}${isMultiline ? " \u2026" : ""})`, true);
24802
24801
  }
24803
- } else if (r.exitCode !== 0) {
24804
- ui?.addMessage(`exit ${r.exitCode}: ${(r.stderr || "").slice(0, 200)}`, true);
24805
24802
  } else {
24806
- ui?.addMessage("done", true);
24803
+ const errLine = (r.stderr || "").trim().split("\n")[0].slice(0, 70);
24804
+ ui?.addMessage(` \u23BF Execute(${firstLine}${isMultiline ? " \u2026" : ""})
24805
+ \u2717 ${errLine}`, true);
24807
24806
  }
24808
24807
  }
24809
24808
  const summary = cmdResults.map((r) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robinpath/cli",
3
- "version": "2.1.0",
3
+ "version": "2.3.0",
4
4
  "description": "AI-powered scripting CLI — automate anything from your terminal",
5
5
  "type": "module",
6
6
  "license": "MIT",