-
Notifications
You must be signed in to change notification settings - Fork 5
feat(cli): add execution engine with context, auth, and execute commands #657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
pyramation
wants to merge
8
commits into
main
Choose a base branch
from
devin/1769265674-cnc-execution-engine
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3,643
−7,006
Conversation
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
Contributor
- Add appstash dependency for config storage (~/.cnc/) - Add project management commands (init, list, use, info, delete) - Add auth commands (set-token, status, logout) - Add execute command for JSON protocol operations - Add lightweight GraphQL client with auto-routing to correct API - Support multi-API architecture (public, admin, auth, private, app) - Model-to-API routing maps models to appropriate endpoints - Secure credential storage with 0o600 permissions
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
- Change token input from type 'text' to type 'password' - Input is now masked with asterisks while typing - Requires inquirerer password type feature (dev-utils PR #58)
- Replace custom GraphQL client with graphql-codegen execute function - Rewrite operations.ts to use gql-ast for AST-based document building - Remove manual string concatenation in favor of proper AST builders - Add gql-ast and @0no-co/graphql.web as dependencies - Add graphql as devDependency for type definitions
- Remove operations.ts (gql-ast query builders) - Simplify client.ts to use plain fetch instead of graphql-codegen - Simplify executor.ts to just execute raw GraphQL strings - Remove hardcoded endpoint generation (generateEndpoints) - Remove MODEL_API_MAP auto-routing - Simplify ProjectConfig to store endpoint URL directly - Remove gql-ast and @0no-co/graphql.web dependencies - Keep: project management, auth/token management, simple execute with raw query string
- Rename ProjectConfig -> ContextConfig, ProjectCredentials -> ContextCredentials - Rename all config-manager functions (createProject -> createContext, etc.) - Rename project.ts command to context.ts with updated subcommands: - init -> create - info -> current - Update auth command to use --context flag instead of --project - Update execute command to use --context flag - Update executor to use context terminology - Store configs in ~/.cnc/config/contexts/ instead of projects/ This aligns the CLI with kubectl's context model where a context bundles endpoint + credentials together.
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.
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→currentReview & Testing Checklist for Human
~/.cnc/config/credentials.jsonis created with mode 0o600 (owner read/write only).cnc context useandcnc context currentwork correctly.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/)Notes
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)