@Command(name="status",description="Show status of all jobs")publicclassStatusCommandextendsBaseCommand{@Option(names={"--tag","-t"},description="Filter by tag")privateStringtag;@Option(names={"--state","-s"},description="Filter by state")privateJobStatestate;@Option(names={"--limit","-n"},description="Limit number of results")privateIntegerlimit;@OverridepublicIntegercall(){// 1. Query jobs via IPC (or directly if --offline)// 2. Apply filters// 3. Output job list}}
2. Usage Examples
# Show all jobs
barn status
# Filter by tag
barn status --tag=download
# Filter by state
barn status --state=running
# Limit results
barn status --limit=10# JSON output
barn status --output=json
3. Human-Readable Output
Table format with columns:
ID STATE TAG CREATED EXIT PID
job-9f83c running transcode 2026-01-21 18:40:01 - 12345
job-a7b2d succeeded download 2026-01-21 18:35:00 0 -
job-c4e1f failed upload 2026-01-21 18:30:00 1 -
job-d8e2g queued - 2026-01-21 18:45:00 - -
Total: 4 jobs (1 running, 1 queued, 1 succeeded, 1 failed)
<!-- github-import:comment:3778186955 -->
_**@daniel-samson** commented on 2026-01-21 13:38:46 UTC:_
✅ Ticket #10 completed: Implemented 'barn status' command.
**StatusCommand** (src/main/java/com/samsonmedia/barn/cli/StatusCommand.java):
- Extends BaseCommand for global options and output formatting
- Options: --tag/-t, --state/-s, --limit/-n
- Offline mode: Reads jobs directly from filesystem
- Service mode: Shows message to start service
**Features**:
- Lists all jobs with ID, state, tag, created time, exit code, PID
- Filtering by tag (--tag=name)
- Filtering by state (--state=QUEUED/RUNNING/SUCCEEDED/FAILED/CANCELED)
- Limit results (--limit=N)
- Sorted by creation time (newest first)
- Summary showing total jobs and counts by state
**Output formats**:
- HUMAN: Aligned table with headers, summary line
- JSON: {jobs: [...], summary: {total, queued, running, ...}}
- XML: Same structure as JSON
**Tests** (StatusCommandTest.java):
- NoJobs: 1 test - empty message
- WithJobs: 3 tests - show jobs, IDs, states
- Filtering: 3 tests - tag, state, limit filters
- OutputFormats: 3 tests - JSON, XML, human formats
- Summary: 1 test - summary display
- ServiceMode: 1 test - service not running message
All 496 tests passing. mvn verify successful.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Imported from GitHub samson-media/barn#10 — opened by @daniel-samson on 2026-01-21 12:38:28 UTC
Overview
Implement the
barn statuscommand that shows the status of all jobs.Context
README.md(barn status examples)Requirements
1. Status Command
com.samsonmedia.barn.cli.StatusCommand.java:2. Usage Examples
3. Human-Readable Output
Table format with columns:
4. JSON Output
5. Sorting
Default sort: by created_at descending (newest first)
6. Tests Required
StatusCommandTest.java: Test output formatting, filteringAcceptance Criteria
barn statusshows all jobs--tagfilters by tag--statefilters by state--limitlimits resultsmvn verifypassesImplementation Notes
For the human-readable table, calculate column widths dynamically:
State colors (if TTY):
Definition of Done
@daniel-samson commented on 2026-01-21 13:38:46 UTC:
✅ Ticket #10 completed: Implemented 'barn status' command.
StatusCommand (src/main/java/com/samsonmedia/barn/cli/StatusCommand.java):
Features:
Output formats:
Tests (StatusCommandTest.java):
All 496 tests passing. mvn verify successful.