प्रलेखन

ctx_shell - Tool Reference

Run shell command (compressed output, 95+ patterns). Use raw=true to skip compression. cwd sets working directory (persists across calls via cd tracking). Outpu

ctx_shell Core Tools

Run shell command (compressed output, 95+ patterns). Use raw=true to skip compression. cwd sets working directory (persists across calls via cd tracking). Output redaction is on by default for non-admin roles (admin can disable).

Parameters
3
Required
1
Token Impact
60-95% output compression for common tools (git, npm, cargo, docker, etc.)

When to Use

Running any shell command with automatic output compression. Replaces native terminal tools.

When Not to Use

For long-running processes (dev servers) - those should be run natively. Also skip for simple file reads (use ctx_read).

Parameters

Parameter Type Required Description
command string Yes Shell command to execute
cwd string No Working directory for the command. If omitted, uses last cd target or project root.
raw boolean No Skip compression, return full uncompressed output. Redaction still applies by default for non-admin roles.

Examples

Git status with compression

ctx_shell command="git status"

Output is automatically compressed by the git pattern module.

Raw output (skip compression)

ctx_shell command="cat package.json" raw=true

Returns uncompressed output. Use when you need exact formatting.

CLI Equivalent

This tool is also available via the CLI:

lean-ctx -c <command>

Related Tools

Schema MD5: ffeb1f06fdeb7c9a59cfede26a0593ef ← Back to all tools