feat(cli): add execution engine with project, auth, and execute commands #657
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.
feat(cli): add execution engine with project, auth, and execute commands
Summary
This PR adds an execution engine to the
cncCLI that enables agents and users to make GraphQL requests against Constructive APIs. The implementation includes:Config Management (
src/config/):appstashfor standardized config storage at~/.cnc/New Commands:
cnc project init|list|use|info|delete- Manage project configurationscnc auth set-token|status|logout- Manage API tokens per projectcnc execute- Execute JSON protocol operations with auto-routing to correct APILightweight SDK Client (
src/sdk/):database→ public,membership→ admin,user→ auth)Updates since last revision
cnc auth set-tokencommand now usestype: 'password'instead oftype: 'text', so tokens are masked with asterisks while typing. This requires the new password input type from inquirerer (see dev-utils PR #58).Review & Testing Checklist for Human
src/sdk/executor.ts- TheMODEL_API_MAPmakes assumptions about which models belong to which API. Confirm these mappings match the actual Constructive API structure.src/config/types.ts- ThegenerateEndpoints()function assumes URL patterns likehttps://public-{subdomain}.{domain}/graphql. Confirm this matches production.~/.cnc/config/credentials.jsonis created with mode 0o600 (owner read/write only).cnc project init my-app --domain constructive.io cnc auth set-token # Should now mask input with asterisks cnc execute --model database --action findMany --first 5Recommended Test Plan:
cnc project initto create a projectcnc auth set-tokenand verify input is maskedcnc executeagainst a real Constructive API to verify the GraphQL client works~/.cnc/config/to verify file structure and permissionsNotes
cnc auth set-tokenLink to Devin run: https://app.devin.ai/sessions/041b1d6074a549febda2c95195f1e758
Requested by: Dan Lynch (@pyramation)