Added documentation for the node tool shell#749
Added documentation for the node tool shell#749AditM99 wants to merge 1 commit intorocketride-org:developfrom
Conversation
📝 WalkthroughWalkthroughDocumentation is added for the Shell tool node, describing its purpose of executing host shell commands, the ChangesShell Tool Documentation
Estimated Code Review Effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
|
No description provided. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@nodes/src/nodes/tool_shell/README.md`:
- Around line 23-44: The README's shell.execute section needs a concrete
request/response example and allowlist patterns to show safe usage: add a
minimal JSON request payload (fields: command, working_dir, env, timeout) and
the example response shape (stdout, stderr, exit_code) under the "shell.execute
parameters" section, and add sample allowlist regexes (e.g.
^npm\\s+(ci|test)(\\s+.*)?$, ^python\\s+scripts/[-\\w./]+$ and a note about
using .* for substring matches) to the "Command allowlist" description so
readers can copy/paste a working example; update references to shell.execute and
the Command allowlist text accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 87da70dd-9161-4d36-8a54-d8c60c9e30e7
📒 Files selected for processing (1)
nodes/src/nodes/tool_shell/README.md
| **`shell.execute` parameters:** | ||
|
|
||
| | Parameter | Required | Description | | ||
| | ------------- | -------- | ----------------------------------------------------------- | | ||
| | `command` | yes | Shell command to execute (interpreted by the host shell) | | ||
| | `working_dir` | no | Working directory for this call. Overrides the node default | | ||
| | `env` | no | Object of environment variables to inject for this call | | ||
| | `timeout` | no | Per-call timeout in seconds (capped by node configuration) | | ||
|
|
||
| `exit_code` is the process return code. `-1` indicates a timeout kill; `127` indicates the host shell could not be launched. | ||
|
|
||
| ## Configuration | ||
|
|
||
| | Field | Default | Description | | ||
| | ----------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------- | | ||
| | Default working directory | host CWD | Working directory used when the agent does not provide one | | ||
| | Execution timeout (seconds) | `30` | Max seconds a command may run (max 1800). On timeout the entire process tree is killed | | ||
| | Max output size (bytes) | `1048576` | Per-stream cap on stdout and stderr; output beyond this is streamed and discarded so memory stays bounded | | ||
| | Allow agent-supplied env vars | off | Whether the agent may inject env vars per call. Off by default — `LD_PRELOAD`/`PATH`/`NODE_OPTIONS` can redirect execution | | ||
| | Environment variables | — | Variables injected into every command. Override agent-supplied vars of the same name | | ||
| | Command allowlist | — | Regex patterns. If non-empty, the full command must match at least one (`re.fullmatch`). Use `.*` for substring matches | | ||
|
|
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial | ⚡ Quick win
Add one concrete request/response + allowlist example.
A minimal example for shell.execute payload and allowlist patterns would make this safer and faster to adopt.
✍️ Suggested doc addition
## As a tool
@@
`exit_code` is the process return code. `-1` indicates a timeout kill; `127` indicates the host shell could not be launched.
+
+**Example call:**
+
+```json
+{
+ "command": "npm ci && npm test",
+ "working_dir": "/workspace/app",
+ "env": { "NODE_ENV": "test" },
+ "timeout": 120
+}
+```
+
+**Example response shape:**
+
+```json
+{
+ "stdout": "...",
+ "stderr": "",
+ "exit_code": 0
+}
+```
@@
| Command allowlist | — | Regex patterns. If non-empty, the full command must match at least one (`re.fullmatch`). Use `.*` for substring matches |
+
+Examples:
+- `^npm\\s+(ci|test)(\\s+.*)?$` allows npm ci/test commands
+- `^python\\s+scripts/[-\\w./]+$` allows script execution under `scripts/`🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@nodes/src/nodes/tool_shell/README.md` around lines 23 - 44, The README's
shell.execute section needs a concrete request/response example and allowlist
patterns to show safe usage: add a minimal JSON request payload (fields:
command, working_dir, env, timeout) and the example response shape (stdout,
stderr, exit_code) under the "shell.execute parameters" section, and add sample
allowlist regexes (e.g. ^npm\\s+(ci|test)(\\s+.*)?$,
^python\\s+scripts/[-\\w./]+$ and a note about using .* for substring matches)
to the "Command allowlist" description so readers can copy/paste a working
example; update references to shell.execute and the Command allowlist text
accordingly.
|
Thank you. |
Summary
Added documentation for the node tool shell
Type
Documentation
Testing
No testing only documentation update
Checklist
Linked Issue
Fixes #653
Summary by CodeRabbit