Creator · glebis
Last updated · Sep 5, 2026
Add agent-friendly --json NDJSON output to Python CLI scripts, or scaffold a complete cli_utils package for a project. Use this skill when the user wants to make scripts machine-readable for AI agents, add --json flags, convert print statements to structured JSON, build a CLI hel
Do not auto-install
Install targets
Codex install prompt
Install the "agent-cli" agent skill from https://github.com/glebis/claude-skills/tree/main/agent-cli. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: Add agent-friendly --json NDJSON output to Python CLI scripts, or scaffold a complete cli_utils package for a project. Use this skill when the user wants to make scripts machine-readable for AI agents, add --json flags, convert print statements to structured JSON, build a CLI helper library, create an open-source CLI-for-agents package, add structured logging, or make CLI output machine-readable. Also use when the user mentions NDJSON, structured CLI output, agent-friendly CLI, non-interactive scripts, or JSON I/O for automation. After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"glebis-agent-cli","task":"Install agent-cli","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Deep research, source comparison, literature review, RAG, knowledge search, and reports.
Scenario
Research agents
I need my agent to research a topic, compare sources, and produce a concise report.
Agent fit
Claude Code + CLI + Codex
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add glebis/claude-skills --skill agent-cli
Maintenance
fresh
6d since push
Risk
Needs review
Dependency or permission surface needs review
GitHub quality
370
73/100 Quality · 65/100 Trust
Coverage tags
Review notes
Dependency or permission surface needs review · Permission surface may require sandboxing
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
StrongSolid option that is likely worth shortlisting for production workflows.
Trust
Do not auto-installTrust Score v5 found insufficient evidence for agent installation. Treat this as discovery material, not an executable recommendation.
Audit
Needs reviewA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Choose a stronger alternative or inspect the source manually before any install attempt.
Stars
370 GitHub stars
Repo activity
370 stars, 55 forks
Maintenance
6d since push
License
MIT
Install
npx skills add glebis/claude-skills --skill agent-cli
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add glebis/claude-skills --skill agent-cliDo not use when
Alternative
1.9K Stars
npx skills add yanliudesign/mono-color-skill --skill mono-color
Alternative
61.0K Stars
npx skills add mvanhorn/last30days-skill -g
Alternative
38.4K Stars
npx skills add Imbad0202/academic-research-skills
Alternative
256.3K Stars
npx skills add mattpocock/skills --skill grill-me
Agent safety v2
This skill should not be selected by an agent without explicit human security review.
Do not auto-install. Inspect the source, dependencies, and permission surface first.
high
Skill metadata references terminal, CLI, shell, subprocess, or command execution workflows.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
medium
Skill may read or write project files, documents, generated artifacts, or local workspace state.
high
Skill metadata references credentials, tokens, environment variables, or secret-bearing workflows.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20agent-cli%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20agent-cli%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/glebis-agent-cli/install
Agent should check
Copy prompt
Task: Use agent-cli in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20agent-cli%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/glebis-agent-cli/install
Install command: npx skills add glebis/claude-skills --skill agent-cli
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/glebis-agent-cli/install
LLM text format
/api/skills/glebis-agent-cli/install?format=text
Find alternatives
/api/skills/search?q=agent-cli&limit=3
Agent prompt
Use agent-cli for this task. Review https://www.openagentskill.com/api/skills/glebis-agent-cli/install, then install with: npx skills add glebis/claude-skills --skill agent-cliRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/glebis-agent-cli
LLM text
/api/registry/manifest/glebis-agent-cli?format=text
Install alias
/api/registry/install/glebis-agent-cli
Recommend
/api/registry/recommend?task=Use%20agent-cli%20in%20an%20agent%20workflow&limit=3
Agent fit
Browser automation
Use-case tags
Platforms
Claude Code
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Shortlist this skill and compare it with close alternatives before production adoption.
Role in stack
Companion skill
Primary fit
Browser automation
Trust label
Strong shortlist
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Trust Score v5 found insufficient evidence for agent installation. Treat this as discovery material, not an executable recommendation.
GitHub adoption
INFO370 GitHub stars
Stars/forks activity
INFO370 stars, 55 forks; issue activity unavailable in current metadata
Recent maintenance
PASS6d since push
License clarity
PASSMIT
Good signals
Review before install
Recommended action
Choose a stronger alternative or inspect the source manually before any install attempt.
Quality profile
Solid option that is likely worth shortlisting for production workflows.
Workflow fit
Operate web apps
I need my agent to control a browser, fill forms, and verify web app workflows.
Manage repositories
I need my agent to triage GitHub issues, review pull requests, and summarize repository changes.
Build and ship code
I need a coding agent that can understand a repository, edit code, and review pull requests.
Workflow fit
Operate and verify web apps
A workflow for agents that navigate products, fill forms, take screenshots, and verify real user flows across web applications.
Inspect, patch, and verify code
A workflow for software agents that inspect repositories, review pull requests, generate tests, and turn findings into shippable patches.
Find, compare, and synthesize
A workflow for agents that gather sources, compare claims, summarize long material, and draft useful research briefs.
Alternative shortlist
Similar skills that may fit this task.
Generate original one-ink or controlled two-ink editorial images from any theme, sentence, article idea, object, or reference photo. Always use this skill when the user asks for 单色海报、双色印刷、单色调视觉、蓝色/绿色孔版印刷、risograph、网点照片、复古或当代编辑排版、zine poster, monochrome editorial poster, duotone print, or asks to use the mono-color style. It uses an adaptive white, gray, or pale-beige substrate, no more than two printing inks, active negative space, terse human language, and strong serif/grotesk/mono typography without making retro styling the default or copying a source composition, wording, logo, or artwork. Produce both the final generation prompt and the generated raster image unless the user explicitly asks for prompt only.
Research the last 30 days across Reddit, X, YouTube, Hacker News, Polymarket, GitHub, and the web, then synthesize a grounded brief for an AI agent.
Academic Research Skills for Claude Code: research → write → review → revise → finalize
A relentless interview to sharpen a plan or design.
--- name: agent-cli description: Add agent-friendly --json NDJSON output to Python CLI scripts, or scaffold a complete cli_utils package for a project. Use this skill when the user wants to make scripts machine-readable for AI agents, add --json flags, convert print statements to structured JSON, build a CLI helper library, create an open-source CLI-for-agents package, add structured logging, or make CLI output machine-readable. Also use when the user mentions NDJSON, structured CLI output, agent-friendly CLI, non-interactive scripts, or JSON I/O for automation. ---
# Agent-Friendly CLI Builder
Convert Python CLI scripts from human-only output to agent-consumable NDJSON, or scaffold a complete `cli_utils` package ready for open-source distribution.
## Two Modes
### Mode A: Convert an existing script
When the user points at a script and says "make this agent-friendly" or "add --json":
1. **Scan** the script for output points 2. **Generate** `cli_utils.py` if the project doesn't have one 3. **Replace** all output with structured helpers 4. **Verify** no raw output leaks in JSON mode
### Mode B: Scaffold a complete package
When the user says "create a cli_utils package" or wants an open-source library:
1. **Scaffold** a full Python package with pyproject.toml, tests, license, README 2. **Include** all helpers: `json_log`, `json_error`, `die`, `log`, `add_json_flag`, `enable_json`, `is_json` 3. **Add** pytest test suite with full coverage 4. **Add** MIT license (or ask user preference)
## Core Architecture
The fundamental pattern: every script gets a `--json` flag. When active, **all stdout becomes newline-delimited JSON** (NDJSON). Each line is a self-contained JSON object with a standard envelope.
### The NDJSON Event Envelope
Every JSON line has at minimum:
```json {"event": "ready", "ts": "2026-04-30T14:00:00+00:00", "pid": 1234, "port": 8765} ```
- `event` — what happened (snake_case string) - `ts` — ISO 8601 UTC timestamp - Additional fields are event-specific kwargs
### Why This Design
- **NDJSON over JSON arrays**: processable line-by-line, one bad line doesn't break the stream, works with grep/jq, low memory for long-running processes - **`--json` opt-in over default**: preserves human DX, doesn't break existing scripts or habits - **Global mode flag over per-call checks**: set once at startup, every helper respects it automatically - **`die()` over repeated if/else**: the pattern `if is_json(): json_error(); sys.exit(1) else: print(); sys.exit()` appears constantly — `die()` collapses it to one line
## The cli_utils.py Reference Implementation
When generating `cli_utils.py`, produce exactly this (adapt only if the project has specific needs):
```python """Shared helpers for JSON CLI output.""" import json import os import sys from datetime import datetime, timezone
_json_mode = False
def enable_json(): global _json_mode _json_mode = True
def is_json(): return _json_mode
def json_log(event: str, **kwargs): """Emit one NDJSON line to stdout.""" obj = {"event": event, "ts": datetime.now(timezone.utc).isoformat(), **kwargs} print(json.dumps(obj, default=str), flush=True)
def json_error(message: str, **kwargs): """Emit a structured error event.""" json_log("error", message=message, **kwargs)
def die(message: str, code: int = 1, **kwargs): """Print error and exit — JSON or human depending on mode.""" if _json_mode: json_error(message, **kwargs) else: print(message, file=sys.stderr) sys.exit(code)
def add_json_flag(parser): """Add --json flag to an argparse parser.""" parser.add_argument("--json", action="store_true", help="NDJSON output for agent consumption")
def log(message: str, **json_kwargs): """Print human message normally, or emit JSON event if --json is active.""" if _json_mode: json_log(json_kwargs.pop("event", "info"), message=message, **json_kwargs) else: print(message)
def json_ready(**kwargs): """Emit the readiness signal — only in JSON mode. Call early in daemon startup.""" if _json_mode: json_log("ready", pid=os.getpid(), **kwargs) ```
## Converting a Script — Step by Step
### Step 1: Scan for output points
Search the target script for all places that produce output or exit:
```bash grep -n 'print(\|sys\.exit\|exit(\|input(\|os\.system.*say' TARGET.py ```
Categorize each hit: - **Informational print** → replace with `log(message, event="descriptive_name")` - **Error + exit** → replace with `die(message)` - **Status line with \r** → replace with `if is_json(): json_log("status", ...) else: print("\r...", end="", flush=True)` - **Interactive input()** → guard with `if not is_json():` or add `--no-interactive` flag - **Side effects (say, osascript, notifications)** → guard with `if not is_json():` - **Import-time errors** (before argparse runs) → use `sys.exit("message")` (writes to stderr)
### Step 2: Add the import and flag
At the top of the script, after existing imports: ```python from cli_utils import add_json_flag, enable_json, is_json, json_log, log, die ```
In the `if __name__ == "__main__"` block, add to argparse: ```python add_json_flag(parser) args = parser.parse_args() if args.json: enable_json() ```
### Step 3: Replace each output point
Apply the categorization from Step 1. Key patterns:
**Simple informational:** ```python # Before print(f"Connected to {device}")
# After log(f"Connected to {device}", event="connected", device=device) ```
**Error + exit:** ```python # Before print("Device not found") sys.exit(1)
# After die("Device not found") ```
**Daemon readiness (first output after initialization):** ```python # Before print(f"Server running on port {port}")
# After — json_ready() only emits in JSON mode, so always call it + human fallback json_ready(port=port) log(f"Server running on port {port}", event="ready", port=port) ```
**Status lines (\r overwrite):** ```python # Before print(f"\r HR {hr} RMSSD {rmssd:.1f}", end="", flush=True)
# After if is_json(): json_log("status", hr=hr, rmssd=rmssd) else: print(f"\r HR {hr} RMSSD {rmssd:.1f}", end="", flush=True) ```
**Human-only output (banners, usage examples):** ```python if not is_json(): print("Usage: send {\"type\": \"join\", \"name\": \"Alice\"}") ```
### Step 4: Verify
1. Run `python script.py --help` — confirm `--json` flag appears 2. Run `python script.py --json` — confirm first line is valid JSON 3. Grep for remaining raw `print(` calls — ensure each is guarded or intentional
## Event Name Conventions
Use snake_case, be descriptive, keep them grep-friendly:
| Category | Events | |----------|--------| | Lifecycle | `ready`, `shutdown`, `connected`, `disconnected` | | Data | `hr`, `status`, `metric`, `heartbeat` | | Errors | `error`, `retry` | | Actions | `recording_started`, `recording_stopped`, `preset_change` | | Progress | `scanning`, `connecting`, `downloading`, `importing` |
## Scaffolding an Open-Source Package
When the user wants a distributable package, scaffold this structure:
``` cli-utils-agent/ ├── pyproject.toml ├── LICENSE # MIT by default, ask user ├── README.md ├── src/ │ └── cli_utils_agent/ │ ├── __init__.py # re-exports all public API │ └── core.py # the implementation ├── tests/ │ ├── __init__.py │ ├── test_json_log.py │ ├── test_die.py │ ├── test_log.py │ └── test_add_json_flag.py └── .github/ └── workflows/ └── test.yml # CI with pytest ```
### `__init__.py` — re-export public API
```python # src/cli_utils_agent/__init__.py from .core import ( enable_json, is_json, json_log, json_error, die, add_json_flag, log, json_ready, )
__all__ = [ "enable_json", "is_json", "json_log", "json_error", "die", "add_json_flag", "log", "json_ready", ] ```
### README.md template
Generate a README with: project name, one-line description, install instructions (`pip install cli-utils-agent`), quick usage example showing `add_json_flag` + `enable_json` + `log()`, API reference table listing all exports with one-line descriptions, and a link to the research background.
### pyproject.toml template
```toml [build-system] requires = ["hatchling"] build-backend = "hatchling.build"
[project] name = "cli-utils-agent" version = "0.1.0" description = "Add agent-friendly --json NDJSON output to any Python CLI" readme = "README.md" license = "MIT" requires-python = ">=3.10" classifiers = [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries", ]
[project.urls] Homepage = "https://github.com/USER/cli-utils-agent"
[tool.hatch.build.targets.wheel] packages = ["src/cli_utils_agent"] ```
### Test suite
Use `capsys` for stdout capture, `pytest.raises(SystemExit)` for die(). Example:
```python # tests/test_json_log.py import json from cli_utils_agent import json_log, enable_json, is_json
def test_json_log_writes_ndjson(capsys): json_log("ready", port=8765, pid=42) line = capsys.readouterr().out.strip() obj = json.loads(line) assert obj["event"] == "ready" assert obj["port"] == 8765 assert "ts" in obj
# tests/test_die.py import json import pytest from cli_utils_agent import die, enable_json from cli_utils_agent import core as _core
def test_die_human_mode(capsys): _core._json_mode = False with pytest.raises(SystemExit) as exc: die("something broke") assert exc.value.code == 1 assert "something broke" in capsys.readouterr().err
def test_die_json_mode(capsys): _core._json_mode = True try: with pytest.raises(SystemExit): die("something broke", code=10) obj = json.loads(capsys.readouterr().out.strip()) assert obj["event"] == "error" assert obj["message"] == "something broke" finally: _core._json_mode = False ```
Cover: `json_log`, `json_error`, `die`, `log`, `add_json_flag`, `enable_json`/`is_json`, `json_ready`.
### GitHub Actions CI
```yaml # .github/workflows/test.yml name: Tests on: [push, pull_request] jobs: test: runs-on: ubuntu-latest strategy: matrix: python-version: ["3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - run: pip install -e ".[dev]" - run: pytest -v ```
Add dev dependencies to pyproject.toml: ```toml [project.optional-dependencies] dev = ["pytest>=8.0"] ```
## Checklist — Run Before Declaring Done
After converting a script or creating a package:
- [ ] `--help` shows `--json` flag - [ ] Running with `--json` produces valid NDJSON (every line is parseable JSON) - [ ] First JSON line from daemons has `"event": "ready"` - [ ] Error paths emit `"event": "error"` with non-zero exit code - [ ] No raw `print()` can fire when `--json` is active - [ ] Import-time errors (missing deps) use `sys.exit("message")` not `print()` - [ ] Interactive prompts are guarded - [ ] Side effects (voice, notifications) are guarded - [ ] Human output is preserved when `--json` is NOT passed - [ ] Unhandled exceptions don't leak tracebacks to stdout in JSON mode (wrap main in try/except, emit json_error) - [ ] Tests pass (if package mode) - [ ] Package builds cleanly: `python -m build` (if package mode) - [ ] Install in clean venv and import works (if package mode)
## Further Reading
Read `references/best-practices.md` when you need: - Heartbeat patterns for liveness detection (section 2.4) - Exit code conventions and string error codes (section 2.3) - Schema introspection with `--schema` (section 2.5) - CLI vs MCP decision matrix (section 2.7) - Token efficiency tips for agent consumption (section 5)
Source provenance
Decision snapshot
recent repository activity
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for agent-cli, ready for a manual X post.
A practical pick for source-backed research: agent-cli: Add agent-friendly --json NDJSON output to Python CLI scripts, or scaffold a complete cli_utils package for a project. Use... 370 stars https://www.openagentskill.com/skills/glebis-agent-cli?ref=x
Listing + install path for agent-cli: https://www.openagentskill.com/skills/glebis-agent-cli?ref=x Install: npx skills add glebis/claude-skills --skill agent-cli
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to glebis but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/glebis-agent-cli?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/glebis-agent-cli?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/glebis-agent-cli/audit)
[](https://www.openagentskill.com/skills/glebis-agent-cli?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)glebis
@glebis
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Do not auto-install
mono-color
Generate original one-ink or controlled two-ink editorial images from any theme, sentence, article idea, object, or reference photo. Always use this skill when the user asks for 单色海报、双色印刷、单色调视觉、蓝色/绿色孔版印刷、risograph、网点照片、复古或当代编辑排版、zine poster, monochrome editorial poster, duotone print, or asks to use the mono-color style. It uses an adaptive white, gray, or pale-beige substrate, no more than two printing inks, active negative space, terse human language, and strong serif/grotesk/mono typography without making retro styling the default or copying a source composition, wording, logo, or artwork. Produce both the final generation prompt and the generated raster image unless the user explicitly asks for prompt only.
1.9K StarsLast30days Skill
Research the last 30 days across Reddit, X, YouTube, Hacker News, Polymarket, GitHub, and the web, then synthesize a grounded brief for an AI agent.
61.0K StarsAcademic Research Skills
Academic Research Skills for Claude Code: research → write → review → revise → finalize
38.4K Starsgrill-me
A relentless interview to sharpen a plan or design.
256.3K StarsPermission surface
secrets or environment access, shell or command execution
Agent outcomes
No agent outcome data yet
Docs
Strong README/SKILL.md context
Risk summary
Install readiness