Skip to main content
Reference · Information

senkani_exec

Live Replaces Bash Savings 60–90%

Shell execution with 24+ command-specific filter rules applied to output. Mutating commands pass through unchanged; read commands (git status, npm install, make, curl) get heavily compressed.

Signature

senkani_mcp.call(tool="senkani_exec", args={...})

Behavior

FilterEngine matches `(command, subcommand)` pairs to rule chains. Read-only commands route through the filter; mutating commands (`git commit`, `rm`, `docker run`, `terraform apply`, ...) bypass it so the tool never hides a destructive effect. Adaptive truncation for long outputs; background mode for long builds via `background: true`.

Inputs

Name
Type
Default
Description
cmd
string
The shell command to run. Single string, parsed by the shell.
background
boolean
false
If true, returns a job handle. Poll with `action:"poll"`; kill with `action:"kill"`.
cwd
string
workspace root
Working directory; must be within the workspace.
timeout
integer
120
Seconds before forced kill (foreground only).

Output

stdout + stderr (filtered) + exit code + a `compressed_from` byte count so the agent sees the ratio. Background mode returns a `job_id` and the starting tail.

Example

// filtered npm install
{"tool": "senkani_exec", "args": {"cmd": "npm install"}}
// raw output: 428 lines · returned: 2 lines
added 312 packages in 4.8s (0 vulnerabilities)
// savings: 99.5%

Details

Rule set covers git (status/diff/log/clone/pull), npm/yarn/pnpm install, pip, make, cargo, swift build, curl, ssh, docker pull, terraform plan, and ~14 more. Each rule is tested under `Tests/FilterTests/`. Rules are a pure function of `(cmd, stdout, stderr)` — no side effects.

Commands and their output pass through SecretDetector before the agent sees them. The `event_counters` row `command_redactions` increments on each redaction (visible via `senkani stats --security`).

See also

Source: Sources/MCPServer/Tools/ExecTool.swift + Sources/Filter/FilterEngine.swift