feat: add mxcli catalog search and show commands#218
feat: add mxcli catalog search and show commands#218dionesiusap wants to merge 10 commits intomendixlabs:mainfrom
Conversation
Implements Phase 1 of Catalog integration (mendixlabs#213): read-only search and discovery of services registered in Mendix Catalog. New command: mxcli catalog search <query> [flags] Features: - Search with query term (required positional argument) - Filter by service type (OData, REST, SOAP) - Filter by environment (production-only flag) - Filter by ownership (owned-only flag) - Pagination support (limit, offset) - Dual output formats (table or JSON) - Table output: 7 columns, ~120 chars wide - Short UUIDs (first 8 chars) in table, full UUIDs in JSON Files added: - internal/catalog/types.go - API request/response structs - internal/catalog/client.go - HTTP client for catalog.mendix.com - cmd/mxcli/cmd_catalog.go - Cobra command definitions Reuses existing internal/auth infrastructure for PAT authentication. catalog.mendix.com already whitelisted in internal/auth/scheme.go. Phase 2 (client creation from Catalog) deferred pending architecture discussion on executor network access. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Comprehensive proposal for mxcli Catalog integration covering: - Phase 1: Search and discovery (implemented in this PR) - Phase 2: Client creation from Catalog (architecture TBD) - API analysis and endpoint details - Three architectural options for executor integration - Trade-offs and design decisions References issue mendixlabs#213. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Automatic formatting changes from go fmt. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
API returns owner objects {name, email, uuid}, not strings.
Discovered during manual testing against real Catalog API.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Owner is an object, not a string. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Phase 1 now includes both search and show commands. Client creation remains in Phase 2 (architecture TBD). Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Implements 'mxcli catalog show <uuid>' for detailed endpoint inspection
and changes search output to show full UUIDs instead of shortened.
Changes:
- Show full UUID (36 chars) in search table output
- Users can copy UUID directly for use with show command
- Add catalog show command with human-readable and JSON output
- Display entities, actions, security scheme, environment
New types:
- EndpointDetails, ServiceVersion, Contract, Document
- Entity, Attribute, Association
- Action, Parameter, ReturnType
- SecurityScheme, SecurityType, Role
- EnvironmentWithApp (nested Application in endpoint response)
New client method:
- GetEndpoint(ctx, uuid) - Calls GET /endpoints/{uuid}
Updated documentation:
- Skills file reflects full UUID in table
- Proposal updated with full UUID rationale
- Table width now ~155 chars with full UUIDs
Tested against real Catalog API.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add prominent warnings in: - catalog-search.md skill: clarify this is the external service registry - browse-integrations.md skill: clarify this is MDL CATALOG for local queries - cmd_catalog.go: add disambiguation note in CLI help text - PROPOSAL_catalog_integration.md: add terminology note at top This prevents confusion between: 1. Mendix Catalog (catalog.mendix.com) - external service registry, CLI commands 2. MDL CATALOG keyword - local project metadata tables, SQL queries Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add command-level tests for catalog search and show: - Test authentication requirement (no auth errors) - Test required arguments (query for search, uuid for show) - Tests validate error messages guide users to 'mxcli auth login' Catalog client and types tests were already present in the codebase. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
AI Code ReviewWhat Looks GoodThis PR implements Strengths:
Code Quality:
RecommendationAPPROVE - This PR is ready for merging. It implements a valuable feature for discovering Mendix Catalog services programmatically while maintaining clean separation from existing MDL functionality. The implementation follows project conventions, includes thorough testing, and provides excellent documentation with clear disambiguation between the two different "catalog" concepts. No changes are needed before merging. Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
ReviewOverall: well-structured feature with clean separation, but bundled with too much noise (go fmt, 819-line proposal, merge conflict). The actual feature code is solid — httptest-based tests, proper auth reuse, good disambiguation between MDL CATALOG and Mendix Catalog. What I like
Concerns
Minor
VerdictApprove the feature code after (1) go fmt noise is removed, (3) UUID is escaped, (4) error handling uses |
Adds
mxcli catalog searchandmxcli catalog showcommands for discovering services registered in Mendix Catalog (catalog.mendix.com).Summary
Users can now search the Mendix Catalog programmatically via CLI:
Changes
mxcli catalog search <query>andmxcli catalog show <uuid>--service-type,--production-only,--owned-only,--limit,--offset--json)internal/authinfrastructure (PAT tokens)Disambiguation
Added prominent warnings to distinguish between:
SELECT ... FROM CATALOG.entities)See issue comment for details: #213 (comment)
Testing
make buildpassesmake testpasses (all unit tests)make lintpassesCloses #213