[Phase 3] Add --format=json and --limit to queue list #238

Closed
opened 2026-04-08 06:30:32 +02:00 by shoko · 0 comments
Owner

Problem

No pending tasks in queue. only outputs text format and returns up to 10 items with no way to see more or get machine-readable output.

Solution

  1. Add flag to output all queue item fields in JSON format
  2. Add flag (default 10) to control how many items to return
  3. Sort by ascending

JSON Output Format

Status

READY - No dependencies

Files

  • kugetsu - OpenCode Session Manager (Issue-Driven)

Usage:
kugetsu init [--force] Initialize base + pm-agent sessions (requires TTY)
kugetsu start [--debug] Start task for issue (forks base session)
kugetsu continue [message] [--debug] Continue existing task for issue
kugetsu delegate Send message to PM agent (fire-and-forget)
kugetsu logs [n] Show recent delegation logs (default: 10)
kugetsu status Check kugetsu initialization status
kugetsu doctor [--fix] Diagnose and fix kugetsu issues
kugetsu notify [list|clear] Show or clear notifications
kugetsu list List all tracked sessions
kugetsu prune [--force] Remove orphaned sessions (keeps base + pm-agent)
kugetsu destroy [-y] Delete session for issue
kugetsu destroy --pm-agent [-y] Delete pm-agent session (not recommended)
kugetsu destroy --base [-y] Delete base session
kugetsu set-pr Set PR URL for session (for PR tracking)
kugetsu context Show context for issue
kugetsu queue [list|stats|clear] Show queue status or statistics
kugetsu queue enqueue Enqueue a task (normally via delegate)
kugetsu queue-daemon [start|stop|restart|status|logs] Manage queue daemon
kugetsu env [get|set|list] Manage agent environment variables
kugetsu server [list|add|remove|default|get] Manage git server configurations
kugetsu help Show this help

Issue Ref Format:
instance/user/repo#number
Example: github.com/shoko/kugetsu#14

Commands:
init Create base + pm-agent sessions via TUI. Requires terminal access.
Use --force to reinitialize if sessions exist.
start Fork new session from base for specific issue.
Requires pm-agent to be running (created by init).
continue Continue work on existing issue session.
delegate Send message to PM agent for task coordination.
Fire-and-forget: returns immediately, runs in background.
Use 'kugetsu logs' to check output.
logs Show recent delegation logs.
Default: 10 most recent. Use 'kugetsu logs 20' for more.
status Check if kugetsu is initialized and PM agent is active.
doctor Diagnose kugetsu issues. Use --fix to attempt repairs.
notify Show or clear notifications from PM agent.
Use 'kugetsu notify list' to see unread notifications.
list Show all sessions (base + pm-agent + forked issues).
prune Remove sessions not in index (orphaned from opencode).
Use --force to skip confirmation.
destroy Delete specific issue, pm-agent, or base session.

Options:
--debug Show real-time debug output and capture to debug.log

PM Context:
kugetsu reads ~/.kugetsu/pm-agent.md (if exists) and injects it
into the PM agent session at init time. This allows customizing PM
behavior without recreating the session.

Notifications:
PM Agent writes task completion notifications to ~/.kugetsu/notifications.json
Use 'kugetsu notify list' to see unread notifications.

Examples:
kugetsu init
kugetsu status
kugetsu delegate "work on issue #5"
kugetsu logs
kugetsu logs 20
kugetsu doctor
kugetsu doctor --fix
kugetsu notify list
kugetsu notify clear
kugetsu start github.com/shoko/kugetsu#14 "fix bug"
kugetsu continue github.com/shoko/kugetsu#14 "add tests"
kugetsu list (get_pending_tasks, cmd_queue)

Parent: #235

## Problem No pending tasks in queue. only outputs text format and returns up to 10 items with no way to see more or get machine-readable output. ## Solution 1. Add flag to output all queue item fields in JSON format 2. Add flag (default 10) to control how many items to return 3. Sort by ascending ## JSON Output Format ## Status **READY** - No dependencies ## Files - kugetsu - OpenCode Session Manager (Issue-Driven) Usage: kugetsu init [--force] Initialize base + pm-agent sessions (requires TTY) kugetsu start <issue-ref> <message> [--debug] Start task for issue (forks base session) kugetsu continue <issue-ref> [message] [--debug] Continue existing task for issue kugetsu delegate <message> Send message to PM agent (fire-and-forget) kugetsu logs [n] Show recent delegation logs (default: 10) kugetsu status Check kugetsu initialization status kugetsu doctor [--fix] Diagnose and fix kugetsu issues kugetsu notify [list|clear] Show or clear notifications kugetsu list List all tracked sessions kugetsu prune [--force] Remove orphaned sessions (keeps base + pm-agent) kugetsu destroy <issue-ref> [-y] Delete session for issue kugetsu destroy --pm-agent [-y] Delete pm-agent session (not recommended) kugetsu destroy --base [-y] Delete base session kugetsu set-pr <issue-ref> <pr-url> Set PR URL for session (for PR tracking) kugetsu context <issue-ref> Show context for issue kugetsu queue [list|stats|clear] Show queue status or statistics kugetsu queue enqueue <issue-ref> <message> Enqueue a task (normally via delegate) kugetsu queue-daemon [start|stop|restart|status|logs] Manage queue daemon kugetsu env [get|set|list] Manage agent environment variables kugetsu server [list|add|remove|default|get] Manage git server configurations kugetsu help Show this help Issue Ref Format: instance/user/repo#number Example: github.com/shoko/kugetsu#14 Commands: init Create base + pm-agent sessions via TUI. Requires terminal access. Use --force to reinitialize if sessions exist. start Fork new session from base for specific issue. Requires pm-agent to be running (created by init). continue Continue work on existing issue session. delegate Send message to PM agent for task coordination. Fire-and-forget: returns immediately, runs in background. Use 'kugetsu logs' to check output. logs Show recent delegation logs. Default: 10 most recent. Use 'kugetsu logs 20' for more. status Check if kugetsu is initialized and PM agent is active. doctor Diagnose kugetsu issues. Use --fix to attempt repairs. notify Show or clear notifications from PM agent. Use 'kugetsu notify list' to see unread notifications. list Show all sessions (base + pm-agent + forked issues). prune Remove sessions not in index (orphaned from opencode). Use --force to skip confirmation. destroy Delete specific issue, pm-agent, or base session. Options: --debug Show real-time debug output and capture to debug.log PM Context: kugetsu reads ~/.kugetsu/pm-agent.md (if exists) and injects it into the PM agent session at init time. This allows customizing PM behavior without recreating the session. Notifications: PM Agent writes task completion notifications to ~/.kugetsu/notifications.json Use 'kugetsu notify list' to see unread notifications. Examples: kugetsu init kugetsu status kugetsu delegate "work on issue #5" kugetsu logs kugetsu logs 20 kugetsu doctor kugetsu doctor --fix kugetsu notify list kugetsu notify clear kugetsu start github.com/shoko/kugetsu#14 "fix bug" kugetsu continue github.com/shoko/kugetsu#14 "add tests" kugetsu list (get_pending_tasks, cmd_queue) ## Related Issue Parent: #235
shoko closed this issue 2026-04-08 06:33:46 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shoko/kugetsu#238