Skip to content

feat: add --format json option to odoo-addons-path CLI#14

Open
trisdoan wants to merge 1 commit into
mainfrom
feat/format-json-option
Open

feat: add --format json option to odoo-addons-path CLI#14
trisdoan wants to merge 1 commit into
mainfrom
feat/format-json-option

Conversation

@trisdoan
Copy link
Copy Markdown
Collaborator

@trisdoan trisdoan commented May 18, 2026

Summary

  • Add --format json option to the odoo-addons-path CLI so agents and tooling can request structured layout detection instead of the plain comma-joined addons_path string
  • JSON output includes layout, odoo_dir, version, and addons_path fields
  • _detect_layout_named() wrapper surfaces the detector name without touching the public detect_codebase_layout() signature

Behaviour

$ odoo-addons-path . --format json
{"layout": "Trobz", "odoo_dir": ["/abs/odoo/addons", "/abs/odoo/odoo/addons"], "version": "18.0", "addons_path": "/abs/a,/abs/b"}

@trisdoan trisdoan marked this pull request as ready for review May 20, 2026 09:09
@trisdoan trisdoan marked this pull request as draft May 20, 2026 09:17
Emit a machine-readable JSON object (layout, odoo_dir, version,
addons_path) instead of the plain comma-joined addons_path string.
Useful for agents and tooling that need structured layout detection.

- Add OutputFormat enum (text/json) and --format option to main command
- Add _detect_layout_named() wrapper to surface detector name without
  changing the public detect_codebase_layout() signature
- JSON branch catches no-layout directories and exits 0 with
  layout=null instead of the hard exit-1 kept for --format text
- --check-versions warnings continue to go to stderr only
@trisdoan trisdoan force-pushed the feat/format-json-option branch from 26fdb1e to 69deba2 Compare May 20, 2026 09:40
@trisdoan trisdoan marked this pull request as ready for review May 20, 2026 09:40
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.

1 participant