मुख्य सामग्री पर जाएँ
Skillpedia
सामान्य कोडिंग11k · #11814

hive.terminal-tools-job-control

यह क्या करती है

यह स्किल AI को लंबे काम, जैसे build या deploy, चैट को रोके बिना चलाने का तरीका दिखाती है। यह उन लोगों के लिए है जिनके काम सेकंड की बजाय मिनटों में पूरे होते हैं।

कब इस्तेमाल करें

  • ✓जब कोई build, deploy या लंबा टेस्ट एक मिनट से ज़्यादा लेगा।
  • ✓जब आप दूसरे काम करते हुए लॉग फ़ाइल या dev server देखना चाहते हैं।
  • ✓जब कोई कमांड बैकग्राउंड में चला गया हो और उसने job ID लौटाया हो।

Skill का लिंक

https://github.com/aden-hive/hive/blob/main/core/framework/skills/_preset_skills/terminal-tools-job-control/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/aden-hive/hive/blob/main/core/framework/skills/_preset_skills/terminal-tools-job-control/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“पूरा टेस्ट सूट बैकग्राउंड में शुरू कीजिए, और खत्म होने पर मुझे बताइए।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

AI कमांड को बैकग्राउंड जॉब के रूप में शुरू करता है, उसके लॉग टुकड़ों में पढ़ता है, और उसके बंद होने तक इंतज़ार करता है। वह ID से जॉब की सूची देख या रोक भी सकता है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Background job control

Background jobs are how you do things that take time without blocking your conversation. Three tools cover the surface: terminal_job_start, terminal_job_logs, terminal_job_manage.

When to use a job

  • Builds, deploys, long tests
  • Processes you want to monitor (streaming a log file, a dev server)
  • Anything that auto-backgrounded from terminal_exec (you have a job_id; pivot to this skill's idioms)

For one-shot work expected to finish quickly, terminal_exec is simpler. The auto-promotion mechanic in terminal_exec is your safety net — start with terminal_exec, take over with this skill if needed.

Lifecycle

terminal_job_start(command, ...)
  → { job_id, pid, started_at }

terminal_job_logs(job_id, since_offset=0, max_bytes=64000)
  → { data, offset, next_offset, status: "running"|"exited", exit_code, ... }

# Repeat with since_offset = previous next_offset until status == "exited"
# Or block once with wait_until_exit=True:
terminal_job_logs(job_id, since_offset=N, wait_until_exit=True, wait_timeout_sec=30)
  → blocks server-side until exit or timeout

After exit, the job is retained for inspection (terminal_job_manage(action="list")) until evicted by FIFO (50 most recent exits kept).

Offset bookkeeping — the only rule that matters

The job's output lives in a 4 MB ring buffer per stream. Each call to terminal_job_logs returns:

  • data — bytes between since_offset and next_offset
  • next_offset — pass this as since_offset on your next call
  • truncated_bytes_dropped — non-zero when your since_offset was older than the ring's floor (you fell behind)

Always carry next_offset forward. Don't replay from 0 — that's an offset reset, you'll see the same data twice and miss the part that fell off.

When truncated_bytes_dropped > 0, the buffer evicted N bytes between your last call and now. Treat it as a signal that the job is producing output faster than you're consuming. Either poll more often or accept the gap and read from next_offset going forward.

merge_stderr — interleaved or separate

merge_stderr=False  → two streams, request "stdout" or "stderr" by name
merge_stderr=True   → one stream ("merged"), order preserved

Pick merge_stderr=True when:

  • The job's logs are designed to be read together (most servers, build tools)
  • You don't need to distinguish "this was stderr"

Pick merge_stderr=False when:

  • stderr is genuinely error-only and stdout is data
  • You'll process them differently

Signal escalation

First query the actions implemented on the server's platform:

terminal_job_manage(action="capabilities")
# Returns platform, supported_actions, signals (action → semantics), note.

On POSIX, request signal_int, wait and inspect the job, then use signal_term if needed. signal_term gives the process group up to 2 seconds before forced cleanup; signal_kill forces termination immediately. Cleanup in response to SIGINT/SIGTERM depends on the application.

On Windows, signal_term and signal_kill both forcefully terminate the job process tree. Neither invokes application cleanup handlers. signal_int / Ctrl-C and the other POSIX signals are unsupported and return unsupported_action with the supported actions. If a program has a documented shutdown command on stdin, that can be used before forced termination.

After signaling, check exit with terminal_job_logs(job_id, wait_until_exit=True, wait_timeout_sec=2).

Stdin

terminal_job_manage(action="stdin", job_id=..., data="some input\n")
terminal_job_manage(action="close_stdin", job_id=...)

For tools that read stdin to EOF, close_stdin after writing flushes them. For interactive tools that read line-by-line, just write each line.

Take-over: when terminal_exec auto-backgrounds

When terminal_exec returned auto_backgrounded: true, job_id: <X>, the process is already in the JobManager with its output flowing into the ring buffer. Your transition is seamless:

# Already saw the start of output in terminal_exec's stdout/stderr.
# Pick up reading where the env left off — use the byte count of the
# initial stdout as your since_offset, OR just request tail output:
terminal_job_logs(job_id="job_xxx", tail=True, max_bytes=64000)

Or block until exit and grab everything:

terminal_job_logs(job_id="job_xxx", since_offset=0, wait_until_exit=True, wait_timeout_sec=30)

Hard rules

  • **Jobs die when the server restart
अक्सर पूछे जाने वाले सवाल

AI लॉग की लाइनें छूटने से कैसे बचता है?

वह हर पढ़ने के बाद एक offset रखता है और उसी बिंदु से सिर्फ़ नया आउटपुट माँगता है।

क्या चलते हुए जॉब को रोका जा सकता है?

हाँ। एक जॉब प्रबंधन टूल बैकग्राउंड जॉब की सूची दिखा सकता है और उन्हें रोक सकता है।

खत्म हुए जॉब कब तक रखे जाते हैं?

हाल के 50 खत्म हुए जॉब जाँच के लिए रखे जाते हैं, और पुराने हटा दिए जाते हैं।

जानकारी

लेखक का मूल विवरण

Use when launching anything that runs longer than a minute, anything that streams logs, anything you want to keep running while doing other work — or when terminal_exec auto-backgrounded on you and returned a job_id. Teaches the start→poll→wait pattern with terminal_job_logs offset bookkeeping, bounded blocking polls, platform-specific process control via terminal_job_manage capabilities, and the hard rule that jobs die when the terminal-tools server restarts. Read before calling terminal_job_start, or right after terminal_exec auto-backgrounded.

repo: aden-hive/hive

लोकप्रियता

GitHub स्टार
11k
रैंकिंग में स्थान
#11814
लाइसेंस
Apache-2.0
अपडेट की गई
2/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

browser-edge-cases

11k

यह आपके एजेंट को LinkedIn, X या भारी स्क्रिप्ट वाले पेजों जैसी जटिल साइटों पर विफल होने वाले ब्राउज़र ऑटोमेशन को ठीक करने में मदद करती है।

कोडिंगटेस्टिंग

hive.browser-automation

11k

यह आपके एजेंट को hive-browser टूल से और स्क्रीनशॉट व क्लिक के ज़रिए आपके अपने Chrome ब्राउज़र को नियंत्रित करना सिखाती है।

AI और एजेंटएजेंट

hive.colony-progress-tracker

11k

यह आपके एजेंट को कार्य लेने और साझा डेटाबेस में अपने चरण व जाँच दर्ज करने में मदद करती है, ताकि काम चलते-चलते ट्रैक हो।

AI और एजेंटएजेंट

hive.context-preservation

11k

यह आपके एजेंट को लंबे टूल नतीजों से ज़रूरी बातें नोट्स में सहेजने में मदद करती है, इससे पहले कि पुराने विवरण उसकी मेमोरी से हटें।

AI और एजेंटएजेंट

मिलती-जुलती skills