feat(cli): add execution engine with context, 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 context, auth, and execute commands
Summary
This PR adds a minimal execution engine to the
cncCLI that enables agents and users to make GraphQL requests against Constructive APIs. The implementation is intentionally simple to allow incremental feature additions later.Config Management (
src/config/):appstashfor standardized config storage at~/.cnc/New Commands:
cnc context create|list|use|current|delete- Manage context configurationscnc auth set-token|status|logout- Manage API tokens per context (with password masking)cnc execute- Execute raw GraphQL queries/mutationsSDK Client (
src/sdk/):fetch- no external dependenciesQueryResult<T>with ok/data/errorsUpdates since last revision
cnc project→cnc context--projectflag →--contextflagProjectConfig→ContextConfig,ProjectCredentials→ContextCredentials~/.cnc/config/projects/to~/.cnc/config/contexts/init→create,info→currentdisplay.ts- removed old--model/--actionexamples that no longer exist, updated to show simplified--querysyntaxReview & Testing Checklist for Human
~/.cnc/config/credentials.jsonis created with mode 0o600 (owner read/write only).cnc context useandcnc context currentwork correctly.cnc --helpoutput - Confirm the usage text shows the correct simplified examples (no--model/--actionflags).Recommended Test Plan:
cnc context createwith a real endpoint URLcnc auth set-tokenand verify input is maskedcnc execute --query '...'against a real GraphQL API~/.cnc/config/to verify file structure (contexts/directory, notprojects/)cnc --helpand verify examples are correctNotes
cnc auth set-tokenLink to Devin run: https://app.devin.ai/sessions/041b1d6074a549febda2c95195f1e758
Continued in: https://app.devin.ai/sessions/3db8ac553a7641ee811f8da59592f68a
Requested by: Dan Lynch (@pyramation)