- Home
- Skills
- DevOps & Cloud
- Command Output Size Limiter — Bounded CLI Output
Command Output Size Limiter — Bounded CLI Output
Bound a trusted local CLI command by display bytes, preview leading and trailing lines, optionally archive its full output, and preserve the command return code.
$12
Works with the AI Agents you already use
Command Output Size Limiter — Bounded CLI Output
Example session with this skill installed
Run examples/sample_command.py through the output limiter with a 200-byte display limit and show me what it prints.
- Read your context and instructions
- Compiled the command output size
Command
python3 scripts/command_output_size_limiter.py --limit 200 -- python3 examples/sample_command.py
Output (actual, from examples/actual-output.txt)
build started
compiled 14 modules
build finished
The sample output is under the 200-byte limit, so it is shown in full and no archive is written. The limiter returns the child command's exit code (0 here).
For larger output
Add a preview window and an archive folder:
python3 scripts/command_output_size_limiter.py --limit 4000 --head-lines 8 --tail-lines 4 --archive-dir ./output-archive -- python3 your_script.py
When the output exceeds the limit, the preview shows the leading and trailing lines plus the full output path and SHA-256 digest. Add --json for machine-readable metadata (byte count, digest, archive path).
Next steps
- Choose a byte budget that fits your terminal or log viewer.
- Point
--archive-dirat a folder with enough storage and appropriate access controls, because archives contain the complete output.
Connects securely to your tools. The creator never sees your data.
About this skill
Command Output Size Limiter keeps noisy local command results readable. Set a byte budget, select head and tail lines, and optionally archive the complete output when the preview is truncated. The helper reports the original output size and SHA-256 digest and preserves the command's exit code.
Controls
| Control | Example | Result |
|---|---|---|
| Byte budget | --limit 4000 | Keep displayed output under the selected byte count |
| Preview window | --head-lines 8 --tail-lines 4 | Select leading and trailing lines |
| Full output archive | --archive-dir ./logs | Save full bytes only when truncation occurs |
| Execution time | --timeout 15 | Stop waiting after the time budget |
| Working directory | --cwd ./project | Run the command from a chosen folder |
| JSON metadata | --json | Include byte count, digest, and archive path |
| Exit status | return code | Return the child's code; timeout is 124, missing command 127 |
How it runs
Commands are passed as individual arguments to Python's subprocess API with shell parsing disabled; shell operators are not interpreted. Archive files are written atomically. Helper functions limit_file, verify_archive and format_summary are included for output already saved to disk.
Known limitations
- Run only commands you trust; the wrapper does not judge whether a command is safe.
- Output is captured in memory before truncation, so the limit controls displayed output, not peak process memory.
- Timeout stops the direct child process; it does not promise to stop grandchildren.
- The display limit must be 1 byte through 64 MiB.
Python 3.10+, standard library only. No network access. Includes 27 unit tests (python3 -m unittest discover -s tests -v).
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for DevOps & Cloud.
Does not bound child process memory usage. Timeout only applies to direct child processes, not background workers. Requires Python 3.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 1 day ago
- Software
Python 3.10+