Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ make test

```bash
cd examples
UIGRAPH_TOKEN=test-token ../bin/uigraph sync --dry-run
UIGRAPH_TOKEN=test-token ../bin/uigraph-cli sync --dry-run
```

## Project Structure
Expand Down Expand Up @@ -198,7 +198,7 @@ Then create a pull request on GitHub.

### Good Bug Reports Include

- uigraph-cli version (`uigraph --version`)
- uigraph-cli version (`uigraph-cli --version`)
- Go version
- Operating system
- Complete error message
Expand All @@ -211,13 +211,13 @@ Then create a pull request on GitHub.
```markdown
## Bug: CLI fails with valid YAML config

**Version:** uigraph v1.0.0
**Version:** uigraph-cli v1.0.0
**OS:** Ubuntu 22.04
**Go:** 1.23

**Steps:**
1. Create .uigraph.yaml with valid content
2. Run `uigraph sync`
2. Run `uigraph-cli sync`

**Expected:** Service syncs successfully
**Actual:** Error: ".uigraph.yaml is not valid YAML"
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ make build
3. Run:

```bash
uigraph sync --enterprise
uigraph-cli sync --enterprise
```

`--enterprise` points the CLI at the UiGraph gateway (`--enterprise=DEV` for the dev
Expand Down Expand Up @@ -81,20 +81,20 @@ apis:
## Common Usage

```bash
uigraph sync
uigraph sync --config ./config/.uigraph.yaml
uigraph sync --dry-run
uigraph sync --enterprise
uigraph sync --enterprise=DEV --dry-run
uigraph-cli sync
uigraph-cli sync --config ./config/.uigraph.yaml
uigraph-cli sync --dry-run
uigraph-cli sync --enterprise
uigraph-cli sync --enterprise=DEV --dry-run
```

Record a release from a tag-triggered pipeline job. The version, notes and
commit range are resolved from git at the moment the tag is cut:

```bash
uigraph release
uigraph release --version v1.2.3 --notes-file ./RELEASE_NOTES.md
uigraph release --dry-run
uigraph-cli release
uigraph-cli release --version v1.2.3 --notes-file ./RELEASE_NOTES.md
uigraph-cli release --dry-run
```

## What It Supports
Expand All @@ -104,7 +104,7 @@ uigraph release --dry-run
- Syncing cost category tags that decide which cloud resources roll up into a service's costs
- Syncing test packs and test cases, including reference screenshots
- Scanning the repo for timeline events — ADRs, postmortems, and CHANGELOG releases
- Recording a release on the timeline from a CI/CD tag job via `uigraph release`
- Recording a release on the timeline from a CI/CD tag job via `uigraph-cli release`
- Running cleanly in CI/CD pipelines
- Capturing git metadata during sync

Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const (
)

var rootCmd = &cobra.Command{
Use: "uigraph",
Use: "uigraph-cli",
Short: "UiGraph CLI - Sync services and APIs to UiGraph Gateway",
Long: `UiGraph CLI is a stateless, non-interactive tool designed for CI/CD environments.
It syncs service metadata and API specifications to the UiGraph Gateway backend.`,
Expand Down
20 changes: 10 additions & 10 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ examples/
```bash
cd examples/configs
export UIGRAPH_TOKEN=your-token
uigraph sync --config backend-service.yaml
uigraph-cli sync --config backend-service.yaml
```

### 2. Dry Run

Preview what will be synced without actually sending data:

```bash
uigraph sync --config backend-service.yaml --dry-run
uigraph-cli sync --config backend-service.yaml --dry-run
```

## Configuration Examples
Expand Down Expand Up @@ -71,7 +71,7 @@ See [`ci-cd/github-actions.yml`](ci-cd/github-actions.yml)
- name: Sync to UiGraph
env:
UIGRAPH_TOKEN: ${{ secrets.UIGRAPH_TOKEN }}
run: uigraph sync
run: uigraph-cli sync
```

#### Advanced (with PR dry-run)
Expand All @@ -87,7 +87,7 @@ See [`ci-cd/gitlab-ci.yml`](ci-cd/gitlab-ci.yml)
uigraph-sync:
script:
- curl -sSL https://cli.uigraph.app/install.sh | sh
- uigraph sync
- uigraph-cli sync
```

### Bitbucket Pipelines
Expand Down Expand Up @@ -184,10 +184,10 @@ export UIGRAPH_TOKEN=your-test-token

```bash
# Dry run (safe, no data sent)
./bin/uigraph sync --config examples/configs/backend-service.yaml --dry-run
./bin/uigraph-cli sync --config examples/configs/backend-service.yaml --dry-run

# Actual sync (sends data to gateway)
./bin/uigraph sync --config examples/configs/backend-service.yaml
./bin/uigraph-cli sync --config examples/configs/backend-service.yaml
```

## Tips & Best Practices
Expand All @@ -199,18 +199,18 @@ Always preview changes before syncing:
```yaml
# In your CI/CD
- name: Preview changes
run: uigraph sync --dry-run
run: uigraph-cli sync --dry-run

- name: Sync if approved
run: uigraph sync
run: uigraph-cli sync
```

### 2. Validate Config Locally

Use dry-run to catch configuration errors early:

```bash
uigraph sync --config .uigraph.yaml --dry-run
uigraph-cli sync --config .uigraph.yaml --dry-run
```

### 3. Organize API Specs
Expand Down Expand Up @@ -252,7 +252,7 @@ git commit -m "Update API spec"

```bash
# Check config syntax
uigraph sync --config .uigraph.yaml --dry-run
uigraph-cli sync --config .uigraph.yaml --dry-run
```

### Missing API Spec File
Expand Down
10 changes: 5 additions & 5 deletions examples/ci-cd/github-actions-advanced.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ jobs:
env:
UIGRAPH_TOKEN: ${{ secrets.UIGRAPH_TOKEN }}
run: |
uigraph sync --dry-run
uigraph-cli sync --dry-run

- name: Sync to UiGraph on push
if: github.event_name == 'push'
env:
UIGRAPH_TOKEN: ${{ secrets.UIGRAPH_TOKEN }}
run: |
uigraph sync
uigraph-cli sync

# Records the release on the service timeline at the moment the tag is cut,
# which is when the notes and commit range are freshest.
Expand All @@ -45,7 +45,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
# `uigraph release` reads the previous tag and the commit range, so it
# `uigraph-cli release` reads the previous tag and the commit range, so it
# needs the full history, not the default shallow clone.
fetch-depth: 0

Expand All @@ -62,10 +62,10 @@ jobs:
env:
UIGRAPH_TOKEN: ${{ secrets.UIGRAPH_TOKEN }}
run: |
uigraph release --dry-run
uigraph-cli release --dry-run

- name: Record release on UiGraph timeline
env:
UIGRAPH_TOKEN: ${{ secrets.UIGRAPH_TOKEN }}
run: |
uigraph release
uigraph-cli release
4 changes: 2 additions & 2 deletions examples/ci-cd/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
# `uigraph release` reads the previous tag and the commit range, so it
# `uigraph-cli release` reads the previous tag and the commit range, so it
# needs the full history, not the default shallow clone.
fetch-depth: 0

Expand All @@ -51,4 +51,4 @@ jobs:
env:
UIGRAPH_TOKEN: ${{ secrets.UIGRAPH_TOKEN }}
run: |
uigraph release
uigraph-cli release
4 changes: 2 additions & 2 deletions examples/ci-cd/gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ uigraph-sync:
uigraph-release:
stage: deploy
image: golang:1.23
# `uigraph release` reads the previous tag and the commit range, so it needs
# `uigraph-cli release` reads the previous tag and the commit range, so it needs
# the full history, not GitLab's default shallow clone.
variables:
GIT_DEPTH: 0
UIGRAPH_TOKEN: $UIGRAPH_TOKEN
script:
- go install github.com/uigraph-oss/uigraph-cli@latest
- export PATH="$PATH:$(go env GOPATH)/bin"
- uigraph release
- uigraph-cli release
rules:
- if: $CI_COMMIT_TAG
tags:
Expand Down
4 changes: 2 additions & 2 deletions examples/configs/.uigraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ costTags:
- key: Service
value: uigraph-cli

# Timeline sources scanned on every `uigraph sync`. Each entry is upserted by
# Timeline sources scanned on every `uigraph-cli sync`. Each entry is upserted by
# its file path (or version), so editing or retitling a file updates the
# existing event instead of creating a duplicate.
timeline:
Expand All @@ -117,7 +117,7 @@ timeline:
- docs/postmortems/*.md
releases:
# Fallback only, for repos that do not cut releases through CI. Omit this if
# your pipeline runs `uigraph release`, or the two sources will compete for
# your pipeline runs `uigraph-cli release`, or the two sources will compete for
# the same release event.
changelogPath: CHANGELOG.md

Expand Down
4 changes: 2 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -e
# Configuration
REPO="uigraph/uigraph-cli"
INSTALL_DIR="${INSTALL_DIR:-/usr/local/bin}"
BINARY_NAME="uigraph"
BINARY_NAME="uigraph-cli"

# Detect OS and architecture
OS="$(uname -s)"
Expand Down Expand Up @@ -71,7 +71,7 @@ fi
echo "✓ UiGraph CLI installed successfully!"
echo ""
echo "Usage:"
echo " uigraph sync"
echo " uigraph-cli sync"
echo ""
echo "Documentation:"
echo " https://docs.uigraph.app/cli"
2 changes: 1 addition & 1 deletion pkg/timeline/timeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ var (
)

// Scan walks the configured decision, incident and changelog sources and turns
// each one into an upsertable event. It is called on every `uigraph sync`, so
// each one into an upsertable event. It is called on every `uigraph-cli sync`, so
// every sourceRef is derived from the file path or version rather than the
// title — renaming a heading updates the event instead of duplicating it.
func Scan(cfg *config.Config) ([]Event, error) {
Expand Down
Loading