control-cli
Build or adapt a local harness to drive, inspect, and profile an interactive CLI or TUI without external services.
Skill by MachineLearning-Nerd
Chalk Labs
Need help deploying control-cli?
Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/machinelearning-nerd-control-cli
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: design, agent-building
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions: not checked yet.
What's inside
- Skill name
control-cli- Description
- Build or adapt a local harness to drive, inspect, and profile an interactive CLI or TUI without external services. Use for CLI UX checks, startup regressions, memory leaks, hangs, prompt flows, or terminal demos.
- License
- MIT
- Instructions
- 115 lines in SKILL.md · view on GitHub
Files (2)
- LICENSE
- SKILL.md
SKILL.md (first lines)
## Host compatibility
Read [pstack-harness](../pstack-harness/SKILL.md) before using this workflow.
Its native-tool, role-config, scope, and permission contract takes precedence over
backend-specific examples below. Every delegate inherits the current chat's model;
never pass a model override, including when an imported example requests one.
Read only the references needed for this task.
# Control CLI
Use a repeatable local harness to exercise an interactive CLI instead of poking at it manually. First reuse the repo's own test/demo harness if it exists; otherwise assemble a temporary harness from standard local tools.
## What It Is Used For
- Reproducing CLI/TUI bugs with deterministic input.
- Verifying keyboard flows, prompts, interrupts, resize behavior, and terminal layout.
- Capturing before/after transcripts for bug fixes.
- Profiling startup time, slow operations, hangs, or memory growth.
- Recording a short terminal demo when output is easier to show than explain.
## Harness Loop
1. Identify the command under test and the smallest reproducible workspace.
2. Discover existing local harnesses: package scripts, e2e tests, demo recorders, expect scripts, or PTY helpers.
3. If no harness exists, launch the CLI in an isolated terminal session with deterministic env vars.
4. Capture the current screen before interacting.
5. Send one action at a time: text, Enter, arrows, Escape, Ctrl-C, resize.
6. Wait for a concrete screen pattern or prompt before the next action.
7. Save the transcript and any profile artifacts.
8. Kill the session cleanly.
## Harness Options
- Repo-native harness: prefer checked-in scripts because they know the app's startup, env, and prompts.
- `tmux`: managed sessions, `capture-pane`, `send-keys`, attach/detach.
- PTY probe: use a short Python, Node, or Expect script when tmux is unavailable.
- Runtime inspector: use Node or Bun inspector for CPU profiles, heap snapshots, and live evaluation.
- Terminal recorder: use repo-local demo tools or asciinema-compatible tools when the user asks for a demo.
## Minimal tmux Harness
```bash
SESSION="cli-harness-$(date +%s)"
tmux new-session -d -s "$SESSION" -- <command-under-test>
tmux capture-pane -pt "$SESSION"
tmux send-keys -t "$SESSION" "help" Enter
tmux capture-pane -pt "$SESSION"
tmux kill-session -t "$SESSION"
```
For Node CLIs:
```bash
NODE_OPTIONS="--inspect=127.0.0.1:0" tmux new-session -d -s "$SESSION" -- <node-cli-command>
```
Read the terminal output to find the inspector URL, then use Chrome DevTools-compatible tooling if profiling is needed.
## Minimal PTY Harness
Use a PTY script when you need deterministic waits in a repo that does not have tmux or a demo harness. Keep it temporary unless the user asks to add a reusable test.
```python
import os
import pty
import select
import subprocess
import time
master_fd, slave_fd = pty.openpty()
proc = subprocess.Popen(
["<command>", "<arg>"],
stdin=slave_fd,
stdout=slave_fd,
stderr=slave_fd,
close_fds=True,
)
os.close(slave_fd)
deadline = time.time() + 30
buffer = b""
while time.time() < deadline:
ready, _, _ = select.select([master_fd], [], [], 0.25)
if not ready:
continue
chunk = os.read(master_fd, 4096)
buffer += chunk
if b"<ready text>" in buffer:
os.write(master_fd, b"help\n")
break
print(buffer.decode(errors="replace"))
proc.terminate()
os.close(master_fd)
```
If the CLI needs richer terminal control, use `pty.fork()` or an existing PTY library.
## Profiling Recipes
- Startup regression: capture baseline and treatment startup timings under the same machine, env, and command.
- Slow operation: start a CPU profile, perform the operation, stop the profile, and compare top self-time functions.
- Memory leak: force GC if available, take a heap snapshot, perform the operation repeatedly, force GC again, and take another snapshot.
- Hang: capture the screen, active handles/resources, and a stack/CPU sample before interrupting.
## Guardrails
- Prefer deterministic waits over sleeps. If you must sleep, explain why.
- Do not send credentials or destructive commands into a controlled session.
- Keep the harness in `/tmp` unless the repo already has a testing/demo harness.
- Do not hard-code paths from another repository. Adapt commands to the current repo's scripts and runtime.
- Clean up tmux sessions, temp dirs, inspector processes, and demo artifacts unless the user asks to keep them.From MachineLearning-Nerd/pstack-dual, MIT.
More from MachineLearning-Nerd/pstack-dual
- 0.567score
pstack-harness
MachineLearning-Nerd
Adapt pstack delegation, role configuration, skill paths, verification, and session handling to Claude Code or Codex.
SkillAFreshness: AClaude Code +9 - 0.561score
interrogate
MachineLearning-Nerd
Challenge a code change with independent adversarial reviewers and consolidate evidence-backed findings.
SkillAFreshness: AClaude Code +9 - 0.561score
poteto-help
MachineLearning-Nerd
Explain how to install, configure, or choose a pstack workflow in Claude Code and Codex.
SkillAFreshness: AClaude Code +9 - 0.561score
setup-pstack
MachineLearning-Nerd
Check pstack installation and configure role effort and panel size for Codex and Claude Code.
SkillAFreshness: AClaude Code +9 - 0.561score
how
MachineLearning-Nerd
Explain a subsystem's behavior from source, callers, data structures, and runtime evidence.
SkillAFreshness: AClaude Code +9 - 0.556score
pstack-review
MachineLearning-Nerd
Review a branch, working diff, or named files for reachable defects and missing behavioral coverage.
SkillAFreshness: AClaude Code +9 - 0.556score
create-skill
MachineLearning-Nerd
Author or update a portable pstack skill with precise triggers, self-contained resources, and realistic behavioral verification.
SkillAFreshness: AClaude Code +9 - 0.541score
architect
MachineLearning-Nerd
Sketch types, signatures, and module structure before code, then stay in the loop while implementation fills in.
SkillAFreshness: AClaude Code +9 - 0.539score
benchmark-checklist
MachineLearning-Nerd
Vet a perf measurement (limiter, tuning, limits, errors, repeatability, relevance, and whether the work happened) before you report or act on it.
SkillAFreshness: AClaude Code +9 - 0.539score
correct
MachineLearning-Nerd
Find the mistakes agents keep repeating in this repo and make each one impossible.
SkillAFreshness: AClaude Code +9 - 0.536score
automate-me
MachineLearning-Nerd
Use for "automate me", "create/update/refresh my -mode skill", "turn/capture my preferences or working style into a skill", or wanting agents to follow how…
SkillAFreshness: AClaude Code +9 - 0.536score
arena
MachineLearning-Nerd
Spawn N parallel candidates at the same task, pick a base, graft the strongest parts of the losers into it.
SkillAFreshness: AClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Oct 11, 2026 (22 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
- 0.513score
control-cli
sediman-agent
Build or adapt a local harness to drive, inspect, and profile an interactive CLI or TUI without external services.
SkillCFreshness: C★ 394Claude Code +9 - 0.357score
control-cli
pstack-ports
Build or adapt a local harness to drive, inspect, and profile an interactive CLI or TUI without external services.
SkillAFreshness: A★ 2Claude Code +9 - 0.350score
control-cli
v1truv1us
Build or adapt a local harness to drive, inspect, and profile an interactive CLI or TUI without external services.
SkillBFreshness: B★ 8Claude Code +9 - 0.347score
control-cli
beremaran
Build or adapt a local harness to drive, inspect, and profile an interactive CLI or TUI without external services.
SkillAFreshness: A★ 1Claude Code +9 - 0.345score
control-cli
Velclaw
Build or adapt a local harness to drive, inspect, and profile an interactive CLI or TUI without external services.
SkillAFreshness: A★ 1Claude Code +9 - 0.337score
control-cli
hasegama
Build or adapt a local harness to drive, inspect, and profile an interactive CLI or TUI without external services.
SkillAFreshness: AClaude Code +9 - 0.337score
control-cli
davafons
Build or adapt a local harness to drive, inspect, and profile an interactive CLI or TUI without external services.
SkillAFreshness: AClaude Code +9 - 0.337score
control-cli
zskbot
Build or adapt a local harness to drive, inspect, and profile an interactive CLI or TUI without external services.
SkillAFreshness: AClaude Code +9 - 0.334score
control-cli
265866
Build or adapt a local harness to drive, inspect, and profile an interactive CLI or TUI without external services.
SkillAFreshness: AClaude Code +9 - 0.334score
control-cli
jaki95
Build or adapt a local harness to drive, inspect, and profile an interactive CLI or TUI without external services.
SkillAFreshness: AClaude Code +9 - 0.334score
control-cli
paramcodes
Build or adapt a local harness to drive, inspect, and profile an interactive CLI or TUI without external services.
SkillAFreshness: AClaude Code +9 - 0.331score
control-cli
Velclaw
Build or adapt a local harness to drive, inspect, and profile an interactive CLI or TUI without external services.
SkillAFreshness: AClaude Code +9
More from MachineLearning-Nerd
- 0.567score
pstack-harness
MachineLearning-Nerd
Adapt pstack delegation, role configuration, skill paths, verification, and session handling to Claude Code or Codex.
SkillAFreshness: AClaude Code +9 - 0.561score
how
MachineLearning-Nerd
Explain a subsystem's behavior from source, callers, data structures, and runtime evidence.
SkillAFreshness: AClaude Code +9 - 0.561score
setup-pstack
MachineLearning-Nerd
Check pstack installation and configure role effort and panel size for Codex and Claude Code.
SkillAFreshness: AClaude Code +9 - 0.561score
poteto-help
MachineLearning-Nerd
Explain how to install, configure, or choose a pstack workflow in Claude Code and Codex.
SkillAFreshness: AClaude Code +9 - 0.561score
interrogate
MachineLearning-Nerd
Challenge a code change with independent adversarial reviewers and consolidate evidence-backed findings.
SkillAFreshness: AClaude Code +9 - 0.556score
create-skill
MachineLearning-Nerd
Author or update a portable pstack skill with precise triggers, self-contained resources, and realistic behavioral verification.
SkillAFreshness: AClaude Code +9
Done for you
Rather not set it up yourself?
Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.
See how we build AI agents →Read the case studies
Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.
- launches shipped
- 50+
- launches shipped
- media placements
- 500+
- media placements
- founders on every account
- 2
- founders on every account
Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block
Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.
Get control-cli running in your business
Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.
Cite this page
control-cli skill. Agent Mart. https://agentmart.dev/skills/machinelearning-nerd-control-cli (last updated 2026-10-24)