UiGraph CLI
uigraph-cli is a repository-driven sync tool for keeping UiGraph aligned with the artifacts already stored in source control.
The CLI is intentionally small:
- one command:
uigraph sync - one config file:
.uigraph.yaml - one required secret:
UIGRAPH_TOKEN
What the CLI syncs
From one config file, the CLI can sync:
- Service metadata (
project,service) - API specs (
apis) - Mermaid architecture diagrams (
architectureDiagrams) - Test packs and test cases (
testPacks) - Database schemas (
databases)
Installation
Install the CLI with Go:
go install github.com/uigraph-app/uigraph-cli@latest
Command surface
Main command:
uigraph sync
Supported flags in the current implementation:
--config(default:.uigraph.yaml)--dry-run(prints payloads without sending)
Required environment variable:
UIGRAPH_TOKEN
Quick start
- Create
.uigraph.yamlin your repository root. - Add referenced files such as OpenAPI specs, Mermaid diagrams, or schema files.
- Set
UIGRAPH_TOKENin your shell or CI secret store. - Run a validation pass with dry run.
- Run real sync in CI on your main branch.
Example:
export UIGRAPH_TOKEN=your-token
uigraph sync --dry-run
uigraph sync
Minimal .uigraph.yaml
version: 1
project:
name: my-product
service:
name: Booking Service
category: Backend
description: Handles booking lifecycle and availability
repository:
provider: github
url: https://github.com/company/booking-service
Supported config sections
Top-level sections currently supported by the CLI:
versionprojectserviceapisarchitectureDiagramstestPacksdatabases
Example full config
version: 1
project:
name: my-product
environment: production
service:
name: Booking Service
category: Backend
description: Handles booking lifecycle and availability
repository:
provider: github
url: https://github.com/company/booking-service
ownership:
team: platform
email: platform@company.com
labels:
- core
integrations:
slack:
url: https://example.slack.com/archives/C123
jira:
url: https://example.atlassian.net/browse/PROJ
apis:
- name: public-api
type: openapi
path: ./openapi.yaml
architectureDiagrams:
- name: System Context
path: ./diagram.mmd
contextPath: ./context.json
testPacks:
- name: checkout-smoke
type: smoke
testCases:
- type: api
title: create-order returns 201
order: 1
apiGroupName: public-api
operationId: createOrder
expectedStatusCode: 201
requestTemplate: '{"amount": 100}'
isCritical: true
databases:
- name: Core PostgreSQL Database
dbType: PostgreSQL
dialect: postgres
schemaPath: ./schema.sql
What happens during sync
When you run uigraph sync, the CLI currently performs this sequence:
- Load and validate
.uigraph.yaml - Capture best-effort git metadata
- Sync the service record
- Sync API groups
- Sync architecture diagrams
- Sync test packs and then test cases
- Sync databases
Dry run behavior
Use --dry-run when you want to validate config and inspect what the CLI would send without writing anything to UiGraph.
Dry run is especially useful for:
- pull requests
- onboarding a new repository
- validating file paths in CI
- checking test pack and database config before rollout
Notes for platform teams
- The CLI validates referenced files for APIs, architecture diagrams, and databases before sync.
- Git metadata is captured when available, but sync can continue without it.
- The CLI does not currently expose multiple subcommands;
syncis the public surface area. - For API-linked test cases,
apiGroupNameandoperationIdshould point to synced API content that UiGraph can resolve.