graphql-cli
Query GraphQL endpoints using curl or graphql-cli. Use when the user mentions GraphQL, graphql query, graphql mutation, or graphql schema.
- License 许可
- MIT
- 最近更新
- 2026-11-02
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- graphql-cli
- description
- Query GraphQL endpoints using curl or graphql-cli. Use when the user mentions GraphQL, graphql query, graphql mutation, or graphql schema.
03 SKILL.md 正文
GraphQL CLI
Query GraphQL endpoints directly via curl or npx graphqurl through the Bash tool. Replaces the GraphQL MCP server with native CLI calls.
Prerequisites
No installation required -- curl is available on all systems. For a friendlier interface:
# Check if graphqurl is available
npx graphqurl --version 2>/dev/null || echo "graphqurl not cached; will be fetched on first use via npx"
Default endpoint
If the GRAPHQL_ENDPOINT environment variable is set, use it. Otherwise default to http://localhost:4000/graphql:
ENDPOINT="${GRAPHQL_ENDPOINT:-http://localhost:4000/graphql}"
Queries with curl
Basic query
curl -s -X POST "$ENDPOINT" \
-H "Content-Type: application/json" \
-d '{"query":"{ users { id name email } }"}'
Query with variables
curl -s -X POST "$ENDPOINT" \
-H "Content-Type: application/json" \
-d '{
"query": "query GetUser($id: ID!) { user(id: $id) { id name email } }",
"variables": {"id": "123"}
}'
Query with authentication
curl -s -X POST "$ENDPOINT" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{"query":"{ me { id name } }"}'
Pretty-print response
Pipe through jq for readable output (if available) or python -m json.tool:
curl -s -X POST "$ENDPOINT" \
-H "Content-Type: application/json" \
-d '{"query":"{ users { id name } }"}' | jq .
Mutations with curl
Basic mutation
curl -s -X POST "$ENDPOINT" \
-H "Content-Type: application/json" \
-d '{
"query": "mutation CreateUser($input: CreateUserInput!) { createUser(input: $input) { id name } }",
"variables": {"input": {"name": "Alice", "email": "alice@example.com"}}
}'
Schema Introspection
Full introspection query
curl -s -X POST "$ENDPOINT" \
-H "Content-Type: application/json" \
-d '{"query":"{ __schema { types { name kind description } } }"}' | jq .
List all types
curl -s -X POST "$ENDPOINT" \
-H "Content-Type: application/json" \
-d '{"query":"{ __schema { types { name kind } } }"}' | jq '.data.__schema.types[] | select(.kind != "SCALAR" and (.name | startswith("__") | not))'
Inspect a specific type
curl -s -X POST "$ENDPOINT" \
-H "Content-Type: application/json" \
-d '{"query":"{ __type(name: \"User\") { name fields { name type { name kind ofType { name } } } } }"}' | jq .
List all queries and mutations
# Queries
curl -s -X POST "$ENDPOINT" \
-H "Content-Type: application/json" \
-d '{"query":"{ __schema { queryType { fields { name description args { name type { name } } } } } }"}' | jq .
# Mutations
curl -s -X POST "$ENDPOINT" \
-H "Content-Type: application/json" \
-d '{"query":"{ __schema { mutationType { fields { name description args { name type { name } } } } } }"}' | jq .
Using graphqurl (Alternative)
graphqurl provides a more ergonomic interface via npx:
Basic query
npx graphqurl "$ENDPOINT" -q '{ users { id name email } }'
Query with variables
npx graphqurl "$ENDPOINT" \
-q 'query GetUser($id: ID!) { user(id: $id) { id name email } }' \
-v 'id=123'
Query with headers
npx graphqurl "$ENDPOINT" \
-H "Authorization: Bearer $TOKEN" \
-q '{ me { id name } }'
Introspection
npx graphqurl "$ENDPOINT" --introspect
Tips
- Always use
-s(silent) with curl to suppress progress output. - Pipe responses through
jq .for readable formatting. - For large queries, write the query to a file and use
curl -d @query.json. - Use
jqselectors to extract specific fields:| jq '.data.users[].name'. - When debugging, add
-vto curl to see request/response headers.
Error Handling
"Connection refused"
- The GraphQL server may not be running. Check that the endpoint is correct and the server is up.
- Verify with:
curl -s -o /dev/null -w "%{http_code}" "$ENDPOINT"
"400 Bad Request" or "Syntax Error"
- Check the query syntax. GraphQL queries must be valid.
- Ensure JSON is properly escaped in the
-dpayload.
"401 Unauthorized" or "403 Forbidden"
- Include the correct authentication header.
- Verify the token is valid and has the required scopes.
"Cannot query field" errors
- Run an introspection query to check available fields on the type.
- The schema may have changed -- re-inspect with
__schema.
04 同仓库更多 Skills
clarify-requirements
Resolve genuine pre-execution ambiguity by scanning repo context, generating 1-6 grounded options, and asking 1-3 focused questions via AskUserQuestion. NOT for mid-task use (injection risk); NOT when the goal is already unambiguous; use to disambiguate vague prompts before any file edits.
openmm-md
Run FREE, open-source, Windows-native GPU molecular dynamics via the openmm-md MCP (OpenMM + CUDA on the local NVIDIA GPU). Use for protein / protein-ligand MD when you want a free stack or are on Windows without a Schrodinger license. Covers the full workflow (prepare, solvate, minimize, equilibrate, production, analyze, mmgbsa) AND an honest decision guide vs Schrodinger Desmond, including how to run Desmond legitimately on Linux or a cloud GPU with a real license. This is a deliberately LESSER free alternative and does NOT replace the schrodinger MCP tools. Do NOT use it to pick a free tool when a validated FEP+, WaterMap, IFD-MD, or Prime MM-GBSA result is actually required.
visual-review
Take screenshots of web pages and UI using Playwright for visual review and iteration
status
Diagnostic status report — shows metaswarm installation state, project setup, and potential issues
start
Use when starting work on any task, when the user mentions metaswarm, or when the user wants to begin tracked development work
setup
Interactive project setup — detects your project, configures metaswarm, writes project-local files