Files
SenMeshNet/skills/netcatty-tool-cli/references/exec.md
zhaolei 2f9f8da48e
Some checks failed
AI automation / Route event (push) Has been cancelled
AI automation / Hand reopened issue to maintainers (push) Has been cancelled
AI automation / Clean source issue state (push) Has been cancelled
AI automation / Reconcile handoffs (push) Has been cancelled
AI automation / Classify issue (push) Has been cancelled
AI automation / Claude Code smoke (push) Has been cancelled
AI automation / Review issue follow-up (push) Has been cancelled
AI automation / Publish issue follow-up (push) Has been cancelled
AI automation / Implement with Claude Code (push) Has been cancelled
AI automation / Publish implement PR (push) Has been cancelled
AI automation / Continue queued issue comments (push) Has been cancelled
AI automation / Codex review loop (push) Has been cancelled
AI automation / Publish Codex fix (push) Has been cancelled
AI automation / Clear Codex dispatch marker (push) Has been cancelled
AI automation / Own PR re-request Codex (push) Has been cancelled
AI automation / External PR re-request Codex (push) Has been cancelled
AI automation / Poll Codex reaction / retry (push) Has been cancelled
Initial commit: NetMesh smart ops platform with 3D topology, inspection reports, RCA and AI ops assistant
2026-10-15 13:53:04 +08:00

2.3 KiB

Exec Reference

Use this reference for remote command execution tasks.

Shortest Path

exec calls are internal agent transport calls. Always include both --session <session-id> and --chat-session <chat-session-id>. After --, pass exactly one shell-ready command string. Preserve any quoting inside that one argument instead of splitting it into multiple tokens.

  1. If the host prompt already gives a connected default target session, prefer it directly:
    • <netcatty-cli-prefix> session --session <default-session-id> --json --chat-session <chat-session-id>
    • <netcatty-cli-prefix> exec --session <default-session-id> --json --chat-session <chat-session-id> -- <command>
  2. Otherwise:
    • <netcatty-cli-prefix> env --json --chat-session <chat-session-id>
    • Choose a connected session.
    • <netcatty-cli-prefix> session --session <session-id> --json --chat-session <chat-session-id>
    • <netcatty-cli-prefix> exec --session <session-id> --json --chat-session <chat-session-id> -- <command>

Rules

  • Use exec only for command-style tasks expected to finish within about 60 seconds, such as hostname, IP address, CPU info, memory info, disk usage, pwd, whoami, uname, or process checks.
  • Use long-running jobs for builds, scans, migrations, watch mode, tail -f, ping, log-following, or anything likely to exceed that budget or stream output for an extended period.
  • Long-running flow:
    • <netcatty-cli-prefix> job-start --session <session-id> --chat-session <chat-session-id> --json -- <command>
    • wait before polling unless the output clearly justifies checking sooner
    • <netcatty-cli-prefix> job-poll --job <job-id> --chat-session <chat-session-id> --offset <offset> --json
    • if the user asks to stop it: <netcatty-cli-prefix> job-stop --job <job-id> --chat-session <chat-session-id> --json
  • Prefer one straightforward command over temporary scripts or multi-step shell orchestration.
  • Avoid shell command substitution such as $() and backticks, because Netcatty safety policy may block them.
  • Avoid wrapping simple commands in sh -c, bash -c, or similar shell launchers unless truly necessary.
  • Only write a script when the task genuinely needs branching, loops, or structured parsing that cannot fit cleanly in one direct command.