UIGraph CLI

Examples

This page only references example files that currently exist in the uigraph-cli repository.

Repository example files

Full config example

  • examples/configs/.uigraph.yaml
  • examples/configs/.uigraph/openapi/storefront-sample.yaml
  • examples/configs/.uigraph/diagrams/login-flow/*
  • examples/configs/.uigraph/diagrams/system-overview/*
  • examples/configs/.uigraph/db/*
  • examples/configs/.uigraph/queries/*
  • examples/configs/.uigraph/tests/*

CI/CD examples

  • examples/ci-cd/github-actions.yml — sync on branch pushes, uigraph-cli release on tags
  • examples/ci-cd/github-actions-advanced.yml
  • examples/ci-cd/gitlab-ci.yml

API specification examples

  • examples/specs/openapi/booking-service.yaml
  • examples/specs/openapi/payment-api.yaml
  • examples/specs/openapi/web-app-api.yaml
  • examples/specs/openapi/mobile-api.yaml
  • examples/specs/graphql/schema.graphql
  • examples/specs/grpc/analytics.proto

1) Minimal service

version: 1

service:
  name: Mobile API
  category: Mobile
  description: Backend API for mobile applications
  repository:
    provider: bitbucket
    url: https://bitbucket.org/company/mobile-api

2) Service with APIs

version: 1

service:
  name: Analytics Service
  category: Data
  description: Real-time analytics processing and aggregation
  repository:
    provider: gitlab
    url: https://gitlab.com/company/analytics-service

apis:
  - name: analytics-graphql
    type: graphql
    path: ./specs/schema.graphql
  - name: analytics-grpc
    type: grpc
    path: ./specs/analytics.proto

3) Service with Mermaid context

architectureDiagrams:
  - name: Checkout Context Diagram
    path: ./diagram-checkout.mmd
    contextPath: ./context-checkout.json

4) Service with test packs

testPacks:
  - name: checkout-regression
    type: regression
    testCases:
      - type: api
        title: apply-coupon returns 200
        order: 1
        apiGroupName: checkout-api
        operationId: applyCoupon
        expectedStatusCode: 200
        requestTemplate: '{"code":"SAVE20"}'
        isCritical: false

5) Service with multiple databases

databases:
  - name: Core PostgreSQL Database
    dbType: PostgreSQL
    dialect: postgres
    schemaPath: ./postgresql-core.sql

  - name: Event MongoDB Database
    dbType: MongoDB
    dialect: mongodb
    schemaPath: ./mongodb-events.json

6) Service with saved queries

Inline queries and external queryFiles are merged. Each query links to a databases[].name.

databases:
  - name: ecommerce
    dbType: MySQL
    dialect: mysql
    schemaPath: ./ecommerce-schema.sql

queries:
  - name: orphaned-orders
    database: ecommerce
    queryText: "SELECT * FROM orders WHERE customer_id IS NULL"
    tags: [data-quality]

queryFiles:
  - ./.uigraph/queries/reporting.yaml

7) Test pack with an external test case file

Inline testCases and an external testCasesPath are merged into the same pack.

testPacks:
  - name: Adapter Smoke
    type: smoke
    testCases:
      - title: Register user returns 201
        type: api
        order: 1
        apiGroupName: checkout-api
        operationId: registerUser
        expectedStatusCode: 201
    testCasesPath: ./.uigraph/tests/adapter-smoke.yaml

8) Combined all-options example

version: 1

service:
  name: One Service All Options
  category: Backend
  description: Single fixture combining APIs, diagrams, tests, and databases.
  repository:
    provider: github
    url: https://github.com/example/one-service-all-options.git

apis:
  - name: public-api
    type: openapi
    path: ./openapi-public.yaml

architectureDiagrams:
  - name: Shape Context Diagram
    path: ./diagram-shape.mmd
    contextPath: ./context-shape.json

testPacks:
  - name: smoke-pack
    type: smoke
    testCases:
      - type: manual
        title: smoke checkout path
        order: 1
        stepsList:
          - action: Complete checkout with valid inputs
            expectedResult: Checkout succeeds
        expectedOutcome: Order is confirmed
        requiresEvidence: true
        isCritical: true

databases:
  - name: Core MySQL Database
    dbType: MySQL
    dialect: mysql
    schemaPath: ./mysql-core.sql

9) Service dependencies

direction is required on every entry: downstream means this service calls the target, upstream means the target calls this service.

dependencies:
  - name: payments-charges
    service: Payments Provider
    direction: downstream
    type: http
    criticality: hard
    description: Charges customer cards through the payments provider.
    apiGroupName: payments-api
    apiEndpointNames:
      - createCharge

  - name: mobile-order-feed
    service: Mobile App
    direction: upstream
    criticality: soft
    description: The mobile app reads the order feed from this service.

10) Cost tags

Present means the config owns the full set — unlisted rules are deleted on the next sync.

costTags:
  - key: team
    value: checkout
  - key: Service
    value: booking-api

11) Timeline sources

timeline:
  decisions:
    paths:
      - docs/adr/*.md
      - docs/decisions/*.md
  incidents:
    paths:
      - docs/postmortems/*.md
  releases:
    # Omit this if the pipeline runs `uigraph-cli release` — both write the same
    # release event and would overwrite each other.
    changelogPath: CHANGELOG.md

12) Test case with reference screenshots

testPacks:
  - name: checkout-smoke
    type: smoke
    testCases:
      - type: manual
        title: checkout success path
        order: 1
        stepsList:
          - action: Open checkout and submit a valid card
            expectedResult: Payment is accepted
        screenshots:
          - ./.uigraph/tests/screenshots/checkout-confirmation.png

13) ML projects from MLflow

ml:
  - name: Recommendations
    type: model
    source:
      type: mlflow
      urlEnv: MLFLOW_URL
      tokenEnv: MLFLOW_TOKEN
    models:
      - name: feed-ranker
        problemType: ranking

Tips

  • Start from examples/configs/.uigraph.yaml if you want one realistic end-to-end sample.
  • Add OpenAPI operationId values when your test cases need to target specific endpoints.
  • Keep example file paths repository-relative so dry-run and CI behave the same way.

On this page