Skip to content

feat: add --json output flag to all commands#47

Open
sungdark wants to merge 3 commits intoApexOpsStudio:mainfrom
sungdark:feature/json-output
Open

feat: add --json output flag to all commands#47
sungdark wants to merge 3 commits intoApexOpsStudio:mainfrom
sungdark:feature/json-output

Conversation

@sungdark
Copy link
Copy Markdown

Add --json output format

Fixes issue #1 - adds --json flag to all commands for scripting and automation support.

Changes

  • task.py: Added --json argument to add, list, and done subparsers
  • commands/add.py: add_task() accepts json_output param
    • {success: true, task: {id, description, done}}
  • commands/list.py: list_tasks() accepts json_output param
    • {tasks: [...], count: N}
  • commands/done.py: mark_done() accepts json_output param
    • {success: true, task: {...}} on success
    • {success: false, error: "..."} on error

Acceptance Criteria Met

  • All commands support --json flag
  • JSON output is valid and parseable
  • Tests pass with new functionality

Closes #1

sungdark added 3 commits March 29, 2026 21:08
- load_config() now creates a default config.yaml when file is missing
- No more ugly FileNotFoundError crash
- Added tests for config creation and existing config reading
- Added .gitignore for __pycache__
- Create utils/validation.py with validate_description, validate_task_id, validate_task_file, load_tasks, save_tasks
- Create utils/paths.py with get_tasks_file
- Create utils/__init__.py exporting all shared functions
- Update commands/add.py, commands/list.py, commands/done.py to use shared utils
- No behavior changes - pure refactor
- All existing tests still pass

Closes ApexOpsStudio#3
- task.py: add --json argument to add, list, done subparsers
- commands/add.py: add_task() accepts json_output param, prints JSON on success
- commands/list.py: list_tasks() accepts json_output param, prints JSON array
- commands/done.py: mark_done() accepts json_output param, prints success/error JSON
- All existing tests still pass

Closes ApexOpsStudio#1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add --json output format

1 participant