diff --git a/packages/cli/README.md b/packages/cli/README.md index 540044920..cadf4f23b 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -58,55 +58,26 @@ cnc explorer --origin http://localhost:3000 ### `cnc codegen` -Generate TypeScript types, operations, and SDK from a GraphQL schema. +Generate TypeScript types, operations, and SDK from a GraphQL schema or endpoint. ```bash -# From SDL file -cnc codegen --schema ./schema.graphql --out ./codegen +# From endpoint +cnc codegen --endpoint http://localhost:5555/graphql --out ./codegen -# From endpoint with Host override -cnc codegen --endpoint http://localhost:3000/graphql --headerHost meta8.localhost --out ./codegen +# From database +cnc codegen --database constructive_db --out ./codegen --verbose ``` **Options:** -- `--schema ` - Schema SDL file path -- `--endpoint ` - GraphQL endpoint to fetch schema via introspection -- `--headerHost ` - Optional Host header for endpoint requests -- `--auth ` - Optional Authorization header value -- `--header "Name: Value"` - Optional HTTP header (repeatable) -- `--out ` - Output root directory (default: graphql/codegen/dist) -- `--format ` - Document format (default: gql) -- `--convention