CLI reference
CLI reference
Commands for the YDYL Program graph CLI, including their purposes, use cases, and examples.
Initialize a workspace
ydyl-graph initPurpose
Creates a new Program graph workspace using an example template or an existing project model. It sets up the folder structure, configuration files such as graph.yaml, and starter mappings.
Use case
- Use this command when starting a new Program graph project for a portfolio or program.
- Specify a source system or schema to scaffold a workspace tailored to a specific data model.
Example
ydyl-graph init --from-schema portfolio.graphql --env sandboxGenerate types from schemas
ydyl-graph codegenPurpose
Generates strongly typed models from your graph schema and source definitions.
Use case
- Run after changing
schema.graphqlor adding/updating source definitions. - Creates type-safe classes for interacting with graph data in your resolvers or mappings.
Build your graph
ydyl-graph buildPurpose
Compiles the graph workspace to an optimized bundle, preparing it for deployment to YDYL.
Use case
- Run after completing mappings and configuration.
- Ensures the graph is ready for deployment in the format required by the YDYL runtime.
Deploy your graph
ydyl-graph deployPurpose
Deploys the compiled graph to the YDYL Program graph service.
Use case
- Run after building your graph to upload and activate it.
- Specify the deployment target (sandbox, staging, or production) and the graph name.
Example
ydyl-graph deploy <your_graph> --env production
--endpoint https://graph.ydyl.global
--deploy-key <your_api_key>Run the graph locally
ydyl-graph devPurpose
Runs a local development environment to test the graph with simulated or mirrored data.
Use case
- Use while developing and testing your graph locally.
- Simulate events and validate mappings without deploying to a live YDYL environment.
Execute unit tests
ydyl-graph testPurpose
Runs the YDYL testing harness to execute unit tests for a graph workspace.
Use case
- Write and run unit tests for mappings and resolvers to ensure your graph logic works correctly.
Add new data source
ydyl-graph add-sourcePurpose
Adds a new data source to your graph manifest (graph.yaml) and updates related files such as schema.graphql and mappings.
Use case
- Use when adding additional upstream systems or data sources to your graph.
- Automates updates to configuration and related files.
Example
ydyl-graph add-source projects --from-endpoint https://api.internal/portfolioEnsure you have the latest version of the CLI installed to avoid issues with deprecated or updated commands.