From 0dc89badfb3ec8c859ef08c16d5b9b2070bec569 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Tue, 27 Jan 2026 03:14:15 +0000 Subject: [PATCH] feat: add cnc-execution-engine skill for GraphQL API execution Adds skill documentation for the cnc CLI execution engine: - Context management (create, list, use, current, delete) - Authentication (set-token, status, logout) - Query execution (--query, --file, --variables) Similar to kubectl contexts - manages endpoint + credentials configurations. --- skills/cnc-execution-engine.zip | Bin 0 -> 2676 bytes skills/cnc-execution-engine/SKILL.md | 301 +++++++++++++++++++++++++++ 2 files changed, 301 insertions(+) create mode 100644 skills/cnc-execution-engine.zip create mode 100644 skills/cnc-execution-engine/SKILL.md diff --git a/skills/cnc-execution-engine.zip b/skills/cnc-execution-engine.zip new file mode 100644 index 0000000000000000000000000000000000000000..975b0e552e4e23e3c6b9ab444648264118704b57 GIT binary patch literal 2676 zcmaKuX*d*W8^;HcH6=8b#x}?lBl{pbW00M!AzQ*&#$?}@n36r?V9-f1wurH2X^=G} zjAg7tB{8xU%3GatUGInY>b;-q{y+Eg<##_Hf2M|XrLrhg!|&nW-~#XiT#>Gl z?ji23=pZjYq@+92(+lYiwX$Ra(A|{`@%q*15EcNxr8^pyx&CJRJT?#VUS@?7u z(CwGKNf!~Qjms)8V$OV1J3^1R23uDu9c6;KNO>P|QOAe!2`)glE2|>Ob(bgys`%`_ z7wMiX8QX$uG7w!&LlLEkR{khS+uGw0hK?I;oDQ`1(isSPaoCTJN?}nXtnG*NBU40% zq=qCc;9k~?0D)@oy;jkYn0`J`{6NVK>#wEFRbkMQ*RxZjnG|MxT!>b-CuZTYU60fI zTV^?jGL#^qtevrKFSkdkXF$e%BZR|l}gubog})l|zRoF2cv`_ZO$DF6~^= z<*i2y`8mZ|{V)y`b#9V>qW zY3d%m7k)y$mKO-f^o?KarZK_ui?mp;tuM0*#rC>39dhnFw@@ylFiPEmGT85)qwsGG z3?RDTyVB$Od#p&mgTkx5Ihj1WrNHBh1aVY^@P*;?g!Jf#sLE6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nw=u$cHSpV&TzONsKq=4=E#H*T%-6H_!P61RUgB#k zS`1fTIVttPzH`x>jsZ%SAt{T;%aK$kQ$reB5Z#{)4fwCCodtZ>{5Af;*XaN8wf}Lo nU+6#C+CONTpV0bPlRu&V>u!HqLC^5(U$j3@`_H?W>DTK&w databases.json +``` + +## CLI Reference + +### cnc context + +| Command | Description | +|---------|-------------| +| `cnc context create ` | Create a new context | +| `cnc context list` | List all contexts | +| `cnc context use ` | Switch to a context | +| `cnc context current` | Show current context details | +| `cnc context delete ` | Delete a context | + +**Create Options:** +- `--endpoint ` - GraphQL endpoint URL + +### cnc auth + +| Command | Description | +|---------|-------------| +| `cnc auth set-token [token]` | Set API token (masked input if no token provided) | +| `cnc auth status` | Show authentication status for all contexts | +| `cnc auth logout` | Remove credentials for current context | + +**Options:** +- `--context ` - Target a specific context +- `--expires ` - Token expiration date (ISO format) + +### cnc execute + +| Option | Description | +|--------|-------------| +| `--query ` | GraphQL query/mutation string | +| `--file ` | Path to file containing GraphQL query | +| `--variables ` | Variables as JSON string | +| `--context ` | Context to use (defaults to current) | + +## File Locations + +| Path | Purpose | +|------|---------| +| `~/.cnc/config/contexts/` | Context configuration files | +| `~/.cnc/config/settings.json` | Global settings (current context) | +| `~/.cnc/config/credentials.json` | API tokens (mode 0o600) | + +## Troubleshooting + +| Issue | Solution | +|-------|----------| +| "No active context" | Run `cnc context create` or `cnc context use` | +| "No valid credentials" | Run `cnc auth set-token` | +| "Context not found" | Check `cnc context list` for available contexts | +| Token expired | Run `cnc auth set-token` to set a new token | +| Connection refused | Verify endpoint URL with `cnc context current` | + +## Environment Variables + +The CLI respects standard environment variables but stored context/credentials take precedence: + +| Variable | Description | +|----------|-------------| +| `CNC_ENDPOINT` | Override endpoint URL | +| `CNC_TOKEN` | Override API token | + +## References + +- CLI source: `packages/cli/` in constructive-io/constructive +- Config management uses `appstash` for directory resolution +- Related skill: `constructive-graphql-codegen` for generating typed hooks/ORM