AI-powered GraphQL query generator and executor. Write GraphQL queries in plain English—gql-ai generates, validates, and executes them.
bun install
bun run index.ts --help# Add a GraphQL endpoint
bun run index.ts config add myapi https://api.example.com/graphql
# Fetch and cache schema
bun run index.ts schema fetch myapi
# Generate a query from English
bun run index.ts plan "get all users with their posts"
# Generate, validate, and execute
bun run index.ts run "fetch user 123 and their comments" -e myapi --show-plan- Schema Management – Introspect and cache GraphQL schemas
- AI Query Generation – Converts natural language to GraphQL queries using LLMs
- Query Validation – Validates generated queries against schema before execution
- Multi-Endpoint Support – Manage multiple GraphQL endpoints with profiles
- Flexible Output – Pretty JSON and table formatting
- Plan Inspection – Review AI plans with
--show-planand--show-queryflags
config– Manage endpoints (add, remove, list, set-default)schema– Fetch, cache, and inspect GraphQL schemasplan– Generate query plan from natural languagerun– Generate, validate, and execute queries
Uses Bun, TypeScript (strict mode), Commander.js, Vercel AI SDK, and OpenAI.
No tests yet (Phase 6 planned). See AGENTS.md for architecture and PLAN.md for roadmap.