feat: add --json output flag to all commands#47
Open
sungdark wants to merge 3 commits intoApexOpsStudio:mainfrom
Open
feat: add --json output flag to all commands#47sungdark wants to merge 3 commits intoApexOpsStudio:mainfrom
sungdark wants to merge 3 commits intoApexOpsStudio:mainfrom
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add --json output format
Fixes issue #1 - adds --json flag to all commands for scripting and automation support.
Changes
task.py: Added--jsonargument toadd,list, anddonesubparserscommands/add.py:add_task()acceptsjson_outputparam{success: true, task: {id, description, done}}commands/list.py:list_tasks()acceptsjson_outputparam{tasks: [...], count: N}commands/done.py:mark_done()acceptsjson_outputparam{success: true, task: {...}}on success{success: false, error: "..."}on errorAcceptance Criteria Met
Closes #1