@llmist/cli 16.2.5 → 17.1.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.
package/dist/cli.js CHANGED
@@ -110,7 +110,7 @@ import { Command, InvalidArgumentError as InvalidArgumentError2 } from "commande
110
110
  // package.json
111
111
  var package_default = {
112
112
  name: "@llmist/cli",
113
- version: "16.2.5",
113
+ version: "17.1.0",
114
114
  description: "CLI for llmist - run LLM agents from the command line",
115
115
  type: "module",
116
116
  main: "dist/cli.js",
@@ -167,7 +167,7 @@ var package_default = {
167
167
  node: ">=22.0.0"
168
168
  },
169
169
  dependencies: {
170
- llmist: "^16.2.5",
170
+ llmist: "^17.1.0",
171
171
  "@unblessed/node": "^1.0.0-alpha.23",
172
172
  "diff-match-patch": "^1.0.5",
173
173
  chalk: "^5.6.2",
@@ -182,7 +182,7 @@ var package_default = {
182
182
  zod: "^4.1.12"
183
183
  },
184
184
  devDependencies: {
185
- "@llmist/testing": "^16.2.5",
185
+ "@llmist/testing": "^17.1.0",
186
186
  "@types/diff": "^8.0.0",
187
187
  "@types/diff-match-patch": "^1.0.36",
188
188
  "@types/js-yaml": "^4.0.9",
@@ -2756,74 +2756,58 @@ function spawn2(argv, options = {}) {
2756
2756
  // src/builtins/run-command.ts
2757
2757
  var runCommand = createGadget9({
2758
2758
  name: "RunCommand",
2759
- description: "Execute a command with arguments and return its output. Uses argv array to bypass shell - arguments are passed directly without interpretation. Returns stdout/stderr combined with exit status.",
2759
+ description: "Execute a shell command and return its output. Supports pipes (|), redirects (>, >>), chaining (&&, ||), and all shell features. Returns stdout/stderr combined with exit status.",
2760
2760
  schema: z9.object({
2761
- argv: z9.array(z9.string()).describe("Command and arguments as array (e.g., ['git', 'commit', '-m', 'message'])"),
2761
+ command: z9.string().describe("Shell command to execute (e.g., 'ls -la', 'echo hello | grep h')"),
2762
2762
  cwd: z9.string().optional().describe("Working directory for the command (default: current directory)"),
2763
2763
  timeout: z9.number().default(3e4).describe("Timeout in milliseconds (default: 30000)")
2764
2764
  }),
2765
2765
  examples: [
2766
2766
  {
2767
- params: { argv: ["ls", "-la"], timeout: 3e4 },
2767
+ params: { command: "ls -la", timeout: 3e4 },
2768
2768
  output: "status=0\n\ntotal 24\ndrwxr-xr-x 5 user staff 160 Nov 27 10:00 .\ndrwxr-xr-x 3 user staff 96 Nov 27 09:00 ..\n-rw-r--r-- 1 user staff 1024 Nov 27 10:00 package.json",
2769
- comment: "List directory contents with details"
2769
+ comment: "List directory contents"
2770
2770
  },
2771
2771
  {
2772
- params: { argv: ["echo", "Hello World"], timeout: 3e4 },
2773
- output: "status=0\n\nHello World",
2774
- comment: "Echo without shell - argument passed directly"
2775
- },
2776
- {
2777
- params: { argv: ["cat", "nonexistent.txt"], timeout: 3e4 },
2772
+ params: { command: "cat nonexistent.txt", timeout: 3e4 },
2778
2773
  output: "status=1\n\ncat: nonexistent.txt: No such file or directory",
2779
2774
  comment: "Command that fails returns non-zero status"
2780
2775
  },
2781
2776
  {
2782
- params: { argv: ["pwd"], cwd: "/tmp", timeout: 3e4 },
2777
+ params: { command: "pwd", cwd: "/tmp", timeout: 3e4 },
2783
2778
  output: "status=0\n\n/tmp",
2784
2779
  comment: "Execute command in a specific directory"
2785
2780
  },
2786
2781
  {
2787
2782
  params: {
2788
- argv: [
2789
- "gh",
2790
- "pr",
2791
- "review",
2792
- "123",
2793
- "--comment",
2794
- "--body",
2795
- "Review with `backticks` and 'quotes'"
2796
- ],
2783
+ command: `curl -X POST --header 'Content-Type: application/json' --data '{"key": "value", "count": 42}' https://api.example.com/items`,
2797
2784
  timeout: 3e4
2798
2785
  },
2799
- output: "status=0\n\n(no output)",
2800
- comment: "Complex arguments with special characters - no escaping needed"
2786
+ output: 'status=0\n\n{"id": "abc123", "created": true}',
2787
+ comment: "Complex flags with JSON data - just write the command naturally"
2788
+ },
2789
+ {
2790
+ params: { command: "echo 'hello world' | tr 'h' 'H'", timeout: 3e4 },
2791
+ output: "status=0\n\nHello world",
2792
+ comment: "Piping output between commands"
2801
2793
  },
2802
2794
  {
2803
2795
  params: {
2804
- argv: [
2805
- "gh",
2806
- "pr",
2807
- "review",
2808
- "123",
2809
- "--approve",
2810
- "--body",
2811
- "## Review Summary\n\n**Looks good!**\n\n- Clean code\n- Tests pass"
2812
- ],
2796
+ command: "echo 'content' > /tmp/test.txt && cat /tmp/test.txt",
2813
2797
  timeout: 3e4
2814
2798
  },
2815
- output: "status=0\n\nApproving pull request #123",
2816
- comment: "Multiline body: --body flag and content must be SEPARATE array elements"
2799
+ output: "status=0\n\ncontent",
2800
+ comment: "File redirection and chaining with &&"
2817
2801
  }
2818
2802
  ],
2819
- execute: async ({ argv, cwd, timeout }) => {
2803
+ execute: async ({ command, cwd, timeout }) => {
2820
2804
  const workingDir = cwd ?? process.cwd();
2821
- if (argv.length === 0) {
2822
- return "status=1\n\nerror: argv array cannot be empty";
2805
+ if (!command) {
2806
+ return "status=1\n\nerror: command cannot be empty";
2823
2807
  }
2824
2808
  let timeoutId;
2825
2809
  try {
2826
- const proc = spawn2(argv, {
2810
+ const proc = spawn2(["sh", "-c", command], {
2827
2811
  cwd: workingDir,
2828
2812
  stdout: "pipe",
2829
2813
  stderr: "pipe"