diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 32794c2..991b944 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 @@ -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 @@ -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" diff --git a/README.md b/README.md index 2be2eed..3b1c0f5 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 @@ -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 diff --git a/cmd/root.go b/cmd/root.go index 72d7744..1b899b4 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -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.`, diff --git a/examples/README.md b/examples/README.md index 897df1d..9a8e4ee 100644 --- a/examples/README.md +++ b/examples/README.md @@ -22,7 +22,7 @@ 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 @@ -30,7 +30,7 @@ uigraph sync --config backend-service.yaml 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 @@ -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) @@ -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 @@ -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 @@ -199,10 +199,10 @@ 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 @@ -210,7 +210,7 @@ Always preview changes before syncing: 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 @@ -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 diff --git a/examples/ci-cd/github-actions-advanced.yml b/examples/ci-cd/github-actions-advanced.yml index f556e0d..bfc5b50 100644 --- a/examples/ci-cd/github-actions-advanced.yml +++ b/examples/ci-cd/github-actions-advanced.yml @@ -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. @@ -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 @@ -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 diff --git a/examples/ci-cd/github-actions.yml b/examples/ci-cd/github-actions.yml index 30e6eb3..e5cc75e 100644 --- a/examples/ci-cd/github-actions.yml +++ b/examples/ci-cd/github-actions.yml @@ -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 @@ -51,4 +51,4 @@ jobs: env: UIGRAPH_TOKEN: ${{ secrets.UIGRAPH_TOKEN }} run: | - uigraph release + uigraph-cli release diff --git a/examples/ci-cd/gitlab-ci.yml b/examples/ci-cd/gitlab-ci.yml index 81ec33c..6a3aed9 100644 --- a/examples/ci-cd/gitlab-ci.yml +++ b/examples/ci-cd/gitlab-ci.yml @@ -18,7 +18,7 @@ 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 @@ -26,7 +26,7 @@ uigraph-release: 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: diff --git a/examples/configs/.uigraph.yaml b/examples/configs/.uigraph.yaml index 02685a4..9ac79f0 100644 --- a/examples/configs/.uigraph.yaml +++ b/examples/configs/.uigraph.yaml @@ -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: @@ -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 diff --git a/install.sh b/install.sh index 16dead3..7bd4c3a 100644 --- a/install.sh +++ b/install.sh @@ -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)" @@ -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" diff --git a/pkg/timeline/timeline.go b/pkg/timeline/timeline.go index 24c0743..39fa639 100644 --- a/pkg/timeline/timeline.go +++ b/pkg/timeline/timeline.go @@ -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) {