Skip to content

Commit 90f1a80

Browse files
authored
Release v0.3.3: About command and release automation enhancements (#417)
* feat: add 'morphir about' command and enhance release automation for v0.3.3 This release adds several enhancements to improve user experience and release automation. Added: - 'morphir about' command with embedded changelog - Displays version, platform info, and build details - --changelog flag shows full embedded CHANGELOG.md with markdown rendering - --json flag for programmatic access - Automatic CHANGELOG.md sync during build process - Install script version parameter support - install.sh and install.ps1 now accept version argument - Example: ./install.sh v0.3.2 - Defaults to latest release if no version specified Fixed: - Release script CI wait logic - Now actively polls for CI completion (10min timeout) - Shows progress indicators - Prevents releases when CI is running or failed Changed: - Build process now automatically syncs CHANGELOG.md - Added sync-changelog just recipe - GoReleaser hooks updated - Generated file added to .gitignore Version: v0.3.3 Module versions updated to v0.3.3 Generated with [Claude Code](https://claude.com/claude-code) * docs: add Morphir Go preview documentation with installation guide Added comprehensive documentation for Morphir Go as a developer preview feature. Positions it appropriately as an insider/preview release while morphir-elm remains the stable production path. Includes: - Multiple installation methods (scripts, go install, binaries) - Quick start examples - Current status and roadmap - Troubleshooting guide - Clear warnings about preview status Generated with [Claude Code](https://claude.com/claude-code) * docs: add Morphir Go preview to sidebar navigation Added morphir-go-preview.md to the Getting Started section of the documentation sidebar, making it easily discoverable for users exploring the new Go implementation. Generated with [Claude Code](https://claude.com/claude-code) * fix: revert module versions to v0.3.2 for release PR Module versions should reference the current published version (v0.3.2) until v0.3.3 tags are created during the release process. The release script will create the v0.3.3 tags, then those modules become available. During development with go.work, local modules are used anyway. After release and tag push, users can update to v0.3.3. This fixes the CI build failure. Generated with [Claude Code](https://claude.com/claude-code) * feat: add --no-color flag and NO_COLOR env support to about command Enhanced the 'morphir about --changelog' command with color control: - Colorful markdown rendering by default using glamour - --no-color flag to disable colors - Honors NO_COLOR environment variable (https://no-color.org/) - Automatic fallback to plain text if rendering fails Usage: morphir about --changelog # Colorful (default) morphir about --changelog --no-color # Plain text NO_COLOR=1 morphir about --changelog # Plain text via env Generated with [Claude Code](https://claude.com/claude-code) * docs: update CHANGELOG with color control details for about command Added details about colorful markdown rendering by default with --no-color flag and NO_COLOR environment variable support. Generated with [Claude Code](https://claude.com/claude-code) * fix: make build recipes cross-platform for Windows PowerShell support - Replace bash shebangs with just's os() function - Detect Windows and use appropriate commands (PowerShell vs bash) - Ensures morphir.exe extension on Windows - Fixes 'cygpath executable not found' error in PowerShell * fix: make additional recipes cross-platform - Convert run, run-dev, verify, mod-tidy, install-dev to use os() function - Simplifies conditional logic for PowerShell/bash script execution - Ensures all user-facing recipes work in Windows PowerShell * fix: add sync-changelog dependency to CI-related recipes - Add sync-changelog as dependency to test, lint, verify, fmt-check recipes - Create test-external recipe for testing builds without go.work - Update CI workflow to use just test-external instead of inline commands - Fix formatting in about.go (gofmt alignment) This ensures CHANGELOG.md is synced before any Go compilation that needs the embedded file, and allows CI behavior to be tested locally.
1 parent d875ea9 commit 90f1a80

File tree

21 files changed

+566
-165
lines changed

21 files changed

+566
-165
lines changed

.beads/issues.jsonl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{"id":"morphir-1","title":"Define VEntry and virtual filesystem (VFS) core types","description":"Implement VEntry interface and core entry types (file, folder, document, node, archive) with metadata; add VFS mounts with precedence, shadowing, and RO/RW zones.","status":"tombstone","priority":1,"issue_type":"task","created_at":"2026-01-05T07:23:53.714204329-06:00","created_by":"damian","updated_at":"2026-01-05T07:24:56.26231129-06:00","deleted_at":"2026-01-05T07:24:56.26231129-06:00","deleted_by":"damian","delete_reason":"delete","original_type":"task"}
2+
{"id":"morphir-648","title":"Fix version embedding in binary - morphir --version shows 'dev' instead of release version","description":"The morphir binary built by GoReleaser doesn't have the version string embedded. Running `morphir --version` shows 'dev' instead of the actual release version (e.g., 'v0.3.2').\n\nRoot cause: .goreleaser.yaml ldflags may not be correctly injecting the version.\n\nImpact: Low priority - cosmetic issue, but affects user experience when checking installed version.\n\nFix: Update .goreleaser.yaml to properly inject version via ldflags.","status":"closed","priority":1,"issue_type":"bug","created_at":"2026-01-05T15:30:53.4044773-06:00","created_by":"Damian Reeves","updated_at":"2026-01-05T15:54:40.5287193-06:00","closed_at":"2026-01-05T15:54:40.5287193-06:00","comments":[{"id":1,"issue_id":"morphir-648","author":"MANDO\\damre","text":"Verified that version embedding works correctly in GoReleaser builds. The issue was confusion between GoReleaser binaries (which DO embed version) and go install binaries (which don't). GoReleaser binaries correctly show version.","created_at":"2026-01-05T21:54:51Z"}]}
3+
{"id":"morphir-bri","title":"Create platform-specific install scripts (no Go required)","description":"Create installation scripts that download pre-built binaries from GitHub releases without requiring Go to be installed.\n\nRequirements:\n- Support Linux, macOS, and Windows\n- Default to latest release if no version specified\n- Allow installing specific version: `install.sh v0.3.2`\n- Download appropriate binary for platform/architecture\n- Install to standard location (e.g., /usr/local/bin, ~/.local/bin)\n- Verify checksums for security\n- No Go installation required\n\nScripts needed:\n- install.sh (Linux/macOS)\n- install.ps1 (Windows PowerShell)\n\nBenefits:\n- Easier onboarding for users without Go\n- Faster installation (no compilation)\n- Consistent with other CLI tools\n- Works in restricted environments where go install is blocked","status":"closed","priority":1,"issue_type":"feature","created_at":"2026-01-05T15:31:23.5639931-06:00","created_by":"Damian Reeves","updated_at":"2026-01-05T15:55:49.5746976-06:00","closed_at":"2026-01-05T15:55:49.5746976-06:00","comments":[{"id":3,"issue_id":"morphir-bri","author":"MANDO\\damre","text":"Install scripts already exist and work well. Enhanced them to support version parameter. Usage: ./install.sh v0.3.3 or ./install.ps1 v0.3.3","created_at":"2026-01-05T21:55:49Z"}]}
4+
{"id":"morphir-c1z","title":"Improve release script CI wait logic with polling","description":"The release script checks CI status but doesn't actively wait for completion. If CI is still running, the script shows a warning but may proceed or stop depending on user input.\n\nEnhancement: Add polling loop with timeout to automatically wait for CI to complete before proceeding with release.\n\nBenefits:\n- Reduces manual intervention needed\n- Prevents releases when CI is failing\n- Provides better user experience\n\nImplementation:\n- Poll `gh run list --branch=main --limit=1` every 30 seconds\n- Timeout after 10 minutes\n- Show progress indicators","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-05T15:31:08.7186722-06:00","created_by":"Damian Reeves","updated_at":"2026-01-05T15:55:08.2111142-06:00","closed_at":"2026-01-05T15:55:08.2111142-06:00","comments":[{"id":2,"issue_id":"morphir-c1z","author":"MANDO\\damre","text":"Implemented CI wait logic with 10-minute timeout and 30-second polling interval. Shows progress indicators and prevents releases when CI is still running.","created_at":"2026-01-05T21:55:08Z"}]}
25
{"id":"morphir-go-0ij","title":"Implement type/value/pattern BDD features","description":"Create feature files and step definitions for type, value, and pattern IR","status":"closed","priority":2,"issue_type":"feature","created_at":"2026-01-02T09:53:09.644422177-06:00","created_by":"damian","updated_at":"2026-01-02T10:24:58.230594854-06:00","closed_at":"2026-01-02T10:24:58.230594854-06:00","close_reason":"Implemented type decode feature file with V1/V3 Unit, Variable, Record scenarios","dependencies":[{"issue_id":"morphir-go-0ij","depends_on_id":"morphir-go-0w4","type":"blocks","created_at":"2026-01-02T09:53:32.129434012-06:00","created_by":"damian"}]}
36
{"id":"morphir-go-0w4","title":"Implement distribution BDD features","description":"Create distribution decode/roundtrip feature files and step definitions","status":"closed","priority":1,"issue_type":"feature","created_at":"2026-01-02T09:53:09.483178948-06:00","created_by":"damian","updated_at":"2026-01-02T10:24:45.713170764-06:00","closed_at":"2026-01-02T10:24:45.713170764-06:00","close_reason":"Implemented distribution decode feature file with V1/V3 scenarios and step definitions","dependencies":[{"issue_id":"morphir-go-0w4","depends_on_id":"morphir-go-pg0","type":"blocks","created_at":"2026-01-02T09:53:31.975895759-06:00","created_by":"damian"}]}
47
{"id":"morphir-go-1e2","title":"Workspace Members Support (like Cargo/npm workspaces)","description":"Implement support for workspace members in Morphir configuration, similar to Cargo, npm, or yarn workspaces. A morphir workspace can consist of multiple member projects in subdirectories, declared via globs. Member projects should have a [project] section for project-specific details. Also support classic morphir.json format from finos/morphir-elm for compatibility.","status":"closed","priority":2,"issue_type":"epic","created_at":"2026-01-02T20:02:10.842231252-06:00","created_by":"damian","updated_at":"2026-01-02T21:00:29.335990902-06:00","closed_at":"2026-01-02T21:00:29.335990902-06:00","close_reason":"All subtasks completed. Implemented workspace member support with: morphir.json parser, glob-based discovery with doublestar, ProjectSection config, member loading/resolution, LoadedWorkspace type, and comprehensive BDD tests (18 scenarios). Supports direct paths, globs, recursive patterns, extension filtering (.toml, .json, .{toml,json}), exclude patterns, and morphir-elm compatibility."}

.github/workflows/ci.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,8 @@ jobs:
166166
go-version: '1.25.5'
167167
cache: true
168168

169+
- name: Install just
170+
uses: extractions/setup-just@v3
171+
169172
- name: Test cmd/morphir builds without go.work
170-
working-directory: cmd/morphir
171-
run: |
172-
echo "Testing external consumption (no go.work)..."
173-
echo "This verifies that module versions in go.mod are correct."
174-
go mod download
175-
go build .
176-
echo "✅ cmd/morphir builds successfully as external consumer would use it"
173+
run: just test-external

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,6 @@ website/.docusaurus/
5858

5959
# bv (beads viewer) local config and caches
6060
.bv/
61+
62+
# Generated files for embedding
63+
cmd/morphir/cmd/CHANGELOG.md

.goreleaser.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ before:
88
# Safeguard: Remove any replace directives that may have been accidentally committed
99
# This ensures go install compatibility
1010
- bash ./scripts/remove-replace-directives.sh
11+
# Sync CHANGELOG.md for embedding in about command
12+
- cp CHANGELOG.md cmd/morphir/cmd/CHANGELOG.md
1113
# Ensure all modules have their dependencies in order
1214
- go mod tidy -C cmd/morphir
1315
- go mod tidy -C pkg/models

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,34 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.3.3] - 2026-01-05
11+
12+
### Added
13+
- **`morphir about` command**: Display version, platform information, and embedded changelog
14+
- Shows version, git commit, build date, Go version, and platform details
15+
- `--changelog` flag displays full embedded CHANGELOG.md with colorful markdown rendering by default
16+
- `--no-color` flag and `NO_COLOR` environment variable support for plain text output
17+
- `--json` flag for programmatic access to version information
18+
- Embedded CHANGELOG synced automatically during build process
19+
- Glamour-powered markdown rendering with automatic dark/light theme detection
20+
- **Install script enhancements**: Support for installing specific versions
21+
- `install.sh <version>` and `install.ps1 <version>` now accept version argument
22+
- Still defaults to latest release if no version specified
23+
- Downloads pre-built binaries from GitHub releases (no Go required)
24+
25+
### Fixed
26+
- **Release script CI wait logic**: Improved automation and reliability
27+
- Now actively polls and waits for CI to complete (10 minute timeout)
28+
- Shows progress indicators during wait
29+
- Prevents releases when CI is still running or failed
30+
- Reduces manual intervention needed for releases
31+
32+
### Changed
33+
- **Build process**: CHANGELOG.md now automatically synced to cmd directory
34+
- Added `sync-changelog` just recipe with dependency tracking
35+
- GoReleaser hooks updated to include changelog sync
36+
- `.gitignore` updated to exclude generated `cmd/morphir/cmd/CHANGELOG.md`
37+
1038
## [0.3.2] - 2026-01-05
1139

1240
### Fixed

Justfile

Lines changed: 29 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -37,47 +37,25 @@ _powershell:
3737
echo ""; \
3838
fi'
3939

40+
# Sync CHANGELOG.md to cmd directory for embedding
41+
sync-changelog:
42+
@echo "Syncing CHANGELOG.md to cmd directory..."
43+
@cp CHANGELOG.md cmd/morphir/cmd/CHANGELOG.md
44+
4045
# Build the CLI application
41-
build:
42-
#!/usr/bin/env bash
43-
set -euo pipefail
44-
echo "Building morphir CLI..."
45-
# Determine binary extension based on GOOS (for cross-compilation) or current OS
46-
EXT=""
47-
if [ "${GOOS:-}" = "windows" ]; then
48-
EXT=".exe"
49-
elif [ "${GOOS:-}" = "" ]; then
50-
# GOOS not set, detect current OS
51-
OS=$(./scripts/detect-os.sh)
52-
if [ "$OS" = "windows" ]; then
53-
EXT=".exe"
54-
fi
55-
fi
56-
# Create bin directory if it doesn't exist
57-
mkdir -p bin
58-
# Build the binary
59-
go build -o "bin/morphir${EXT}" ./cmd/morphir
46+
build: sync-changelog
47+
@echo "Building morphir CLI..."
48+
{{if os() == "windows" { "powershell -c \"if (-not (Test-Path bin)) { New-Item -ItemType Directory -Path bin }\"" } else { "mkdir -p bin" } }}
49+
{{if os() == "windows" { "go build -o bin/morphir.exe ./cmd/morphir" } else { "go build -o bin/morphir ./cmd/morphir" } }}
6050

6151
# Build the development version of the CLI (morphir-dev)
62-
build-dev:
63-
#!/usr/bin/env bash
64-
set -euo pipefail
65-
echo "Building morphir-dev CLI..."
66-
# Determine binary extension based on GOOS or current OS
67-
EXT=""
68-
if [ "${GOOS:-}" = "windows" ]; then
69-
EXT=".exe"
70-
elif [ "${GOOS:-}" = "" ]; then
71-
OS=$(./scripts/detect-os.sh)
72-
if [ "$OS" = "windows" ]; then
73-
EXT=".exe"
74-
fi
75-
fi
76-
mkdir -p bin
77-
go build -o "bin/morphir-dev${EXT}" ./cmd/morphir
52+
build-dev: sync-changelog
53+
@echo "Building morphir-dev CLI..."
54+
{{if os() == "windows" { "powershell -c \"if (-not (Test-Path bin)) { New-Item -ItemType Directory -Path bin }\"" } else { "mkdir -p bin" } }}
55+
{{if os() == "windows" { "go build -o bin/morphir-dev.exe ./cmd/morphir" } else { "go build -o bin/morphir-dev ./cmd/morphir" } }}
7856

7957
# Run tests across all modules
80-
test:
58+
test: sync-changelog
8159
#!/usr/bin/env bash
8260
set -euo pipefail
8361
echo "Running tests..."
@@ -94,7 +72,7 @@ fmt:
9472
go fmt ./...
9573

9674
# Check code formatting without modifying files
97-
fmt-check:
75+
fmt-check: sync-changelog
9876
#!/usr/bin/env bash
9977
set -euo pipefail
10078
echo "Checking code formatting..."
@@ -110,7 +88,7 @@ fmt-check:
11088
fi
11189

11290
# Run linters (requires golangci-lint)
113-
lint:
91+
lint: sync-changelog
11492
#!/usr/bin/env bash
11593
set -euo pipefail
11694
echo "Running linters..."
@@ -137,19 +115,7 @@ deps:
137115

138116
# Run go mod tidy for all modules
139117
mod-tidy:
140-
#!/usr/bin/env bash
141-
set -euo pipefail
142-
OS=$(./scripts/detect-os.sh)
143-
if [ "$OS" = "windows" ]; then
144-
if command -v pwsh >/dev/null 2>&1; then
145-
PS="pwsh"
146-
else
147-
PS="powershell"
148-
fi
149-
"$PS" -ExecutionPolicy Bypass -File scripts/mod-tidy.ps1
150-
else
151-
./scripts/mod-tidy.sh
152-
fi
118+
{{if os() == "windows" { "powershell -ExecutionPolicy Bypass -File scripts/mod-tidy.ps1" } else { "./scripts/mod-tidy.sh" } }}
153119

154120
# Install the CLI using go install (installs to $GOPATH/bin or $GOBIN)
155121
install:
@@ -159,57 +125,26 @@ install:
159125

160126
# Install the development version as morphir-dev
161127
install-dev: build-dev
162-
#!/usr/bin/env bash
163-
set -euo pipefail
164-
OS=$(./scripts/detect-os.sh)
165-
if [ "$OS" = "windows" ]; then
166-
if command -v pwsh >/dev/null 2>&1; then
167-
PS="pwsh"
168-
else
169-
PS="powershell"
170-
fi
171-
"$PS" -ExecutionPolicy Bypass -File scripts/install-dev.ps1
172-
else
173-
./scripts/install-dev.sh
174-
fi
128+
{{if os() == "windows" { "powershell -ExecutionPolicy Bypass -File scripts/install-dev.ps1" } else { "./scripts/install-dev.sh" } }}
175129

176130
# Run the CLI application
177131
run: build
178-
#!/usr/bin/env bash
179-
set -euo pipefail
180-
EXT=""
181-
OS=$(./scripts/detect-os.sh)
182-
if [ "$OS" = "windows" ]; then
183-
EXT=".exe"
184-
fi
185-
"./bin/morphir${EXT}"
132+
{{if os() == "windows" { "./bin/morphir.exe" } else { "./bin/morphir" } }}
186133

187134
# Run the development version of the CLI
188135
run-dev: build-dev
189-
#!/usr/bin/env bash
190-
set -euo pipefail
191-
EXT=""
192-
OS=$(./scripts/detect-os.sh)
193-
if [ "$OS" = "windows" ]; then
194-
EXT=".exe"
195-
fi
196-
"./bin/morphir-dev${EXT}"
136+
{{if os() == "windows" { "./bin/morphir-dev.exe" } else { "./bin/morphir-dev" } }}
197137

198138
# Verify all modules build successfully
199-
verify:
200-
#!/usr/bin/env bash
201-
set -euo pipefail
202-
OS=$(./scripts/detect-os.sh)
203-
if [ "$OS" = "windows" ]; then
204-
if command -v pwsh >/dev/null 2>&1; then
205-
PS="pwsh"
206-
else
207-
PS="powershell"
208-
fi
209-
"$PS" -ExecutionPolicy Bypass -File scripts/verify.ps1
210-
else
211-
./scripts/verify.sh
212-
fi
139+
verify: sync-changelog
140+
{{if os() == "windows" { "powershell -ExecutionPolicy Bypass -File scripts/verify.ps1" } else { "./scripts/verify.sh" } }}
141+
142+
# Test external consumption (building without go.work)
143+
test-external: sync-changelog
144+
@echo "Testing external consumption (no go.work)..."
145+
@echo "This verifies that module versions in go.mod are correct."
146+
@cd cmd/morphir && go mod download && go build .
147+
@echo "✅ cmd/morphir builds successfully as external consumer would use it"
213148

214149
# Configure Go workspace for local development
215150
dev-setup:

cmd/morphir/cmd/about.go

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
package cmd
2+
3+
import (
4+
_ "embed"
5+
"encoding/json"
6+
"fmt"
7+
"os"
8+
"runtime"
9+
10+
"github.com/charmbracelet/glamour"
11+
"github.com/spf13/cobra"
12+
)
13+
14+
//go:embed CHANGELOG.md
15+
var changelog string
16+
17+
var aboutCmd = &cobra.Command{
18+
Use: "about",
19+
Short: "Display information about Morphir",
20+
Long: `Display version, platform information, and changelog for Morphir.`,
21+
RunE: runAbout,
22+
}
23+
24+
func init() {
25+
aboutCmd.Flags().BoolP("json", "j", false, "Output in JSON format")
26+
aboutCmd.Flags().Bool("changelog", false, "Show full changelog")
27+
aboutCmd.Flags().Bool("no-color", false, "Disable colored output (also honors NO_COLOR env var)")
28+
}
29+
30+
type AboutInfo struct {
31+
Version string `json:"version"`
32+
GitCommit string `json:"git_commit"`
33+
BuildDate string `json:"build_date"`
34+
GoVersion string `json:"go_version"`
35+
Platform string `json:"platform"`
36+
OS string `json:"os"`
37+
Arch string `json:"arch"`
38+
Changelog string `json:"changelog,omitempty"`
39+
}
40+
41+
func runAbout(cmd *cobra.Command, args []string) error {
42+
jsonFlag, _ := cmd.Flags().GetBool("json")
43+
showChangelog, _ := cmd.Flags().GetBool("changelog")
44+
noColor, _ := cmd.Flags().GetBool("no-color")
45+
46+
// Check NO_COLOR environment variable (standard: https://no-color.org/)
47+
if os.Getenv("NO_COLOR") != "" {
48+
noColor = true
49+
}
50+
51+
info := AboutInfo{
52+
Version: Version,
53+
GitCommit: GitCommit,
54+
BuildDate: BuildDate,
55+
GoVersion: runtime.Version(),
56+
Platform: fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH),
57+
OS: runtime.GOOS,
58+
Arch: runtime.GOARCH,
59+
}
60+
61+
if showChangelog {
62+
info.Changelog = changelog
63+
}
64+
65+
if jsonFlag {
66+
encoder := json.NewEncoder(cmd.OutOrStdout())
67+
encoder.SetIndent("", " ")
68+
return encoder.Encode(info)
69+
}
70+
71+
// Pretty output
72+
fmt.Fprintf(cmd.OutOrStdout(), "Morphir - Functional Data Modeling\n")
73+
fmt.Fprintf(cmd.OutOrStdout(), "═══════════════════════════════════\n\n")
74+
fmt.Fprintf(cmd.OutOrStdout(), "Version: %s\n", info.Version)
75+
fmt.Fprintf(cmd.OutOrStdout(), "Git Commit: %s\n", info.GitCommit)
76+
fmt.Fprintf(cmd.OutOrStdout(), "Build Date: %s\n", info.BuildDate)
77+
fmt.Fprintf(cmd.OutOrStdout(), "Go Version: %s\n", info.GoVersion)
78+
fmt.Fprintf(cmd.OutOrStdout(), "Platform: %s\n", info.Platform)
79+
fmt.Fprintf(cmd.OutOrStdout(), "\n")
80+
81+
if showChangelog {
82+
fmt.Fprintf(cmd.OutOrStdout(), "Changelog\n")
83+
fmt.Fprintf(cmd.OutOrStdout(), "─────────\n\n")
84+
85+
if noColor {
86+
// Plain text output without colors
87+
fmt.Fprintf(cmd.OutOrStdout(), "%s\n", changelog)
88+
} else {
89+
// Render markdown with glamour (colorful by default)
90+
rendererOpts := []glamour.TermRendererOption{
91+
glamour.WithAutoStyle(), // Automatically adapts to dark/light terminal
92+
glamour.WithWordWrap(100),
93+
}
94+
95+
r, err := glamour.NewTermRenderer(rendererOpts...)
96+
if err != nil {
97+
// Fallback to plain text if glamour fails
98+
fmt.Fprintf(cmd.OutOrStdout(), "%s\n", changelog)
99+
return nil
100+
}
101+
102+
rendered, err := r.Render(changelog)
103+
if err != nil {
104+
fmt.Fprintf(cmd.OutOrStdout(), "%s\n", changelog)
105+
return nil
106+
}
107+
108+
fmt.Fprint(cmd.OutOrStdout(), rendered)
109+
}
110+
} else {
111+
fmt.Fprintf(cmd.OutOrStdout(), "For more information:\n")
112+
fmt.Fprintf(cmd.OutOrStdout(), " Website: https://morphir.finos.org\n")
113+
fmt.Fprintf(cmd.OutOrStdout(), " Repository: https://github.com/finos/morphir\n")
114+
fmt.Fprintf(cmd.OutOrStdout(), " Changelog: morphir about --changelog\n")
115+
}
116+
117+
return nil
118+
}

cmd/morphir/cmd/root.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ func init() {
7373
rootCmd.AddCommand(projectCmd)
7474
rootCmd.AddCommand(validateCmd)
7575
rootCmd.AddCommand(versionCmd)
76+
rootCmd.AddCommand(aboutCmd)
7677
rootCmd.AddCommand(configCmd)
7778
// Note: Cobra automatically provides a built-in 'help' command,
7879
// so we don't need to register our custom helpCmd

cmd/morphir/go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ require (
77
github.com/charmbracelet/bubbletea v1.3.10
88
github.com/charmbracelet/glamour v0.10.0
99
github.com/charmbracelet/lipgloss v1.1.1-0.20250404203927-76690c660834
10-
github.com/finos/morphir/pkg/config v0.3.1
11-
github.com/finos/morphir/pkg/tooling v0.3.1
10+
github.com/finos/morphir/pkg/config v0.3.2
11+
github.com/finos/morphir/pkg/tooling v0.3.2
1212
github.com/spf13/cobra v1.10.2
1313
)
1414

@@ -25,7 +25,7 @@ require (
2525
github.com/charmbracelet/x/term v0.2.1 // indirect
2626
github.com/dlclark/regexp2 v1.11.0 // indirect
2727
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
28-
github.com/finos/morphir/pkg/models v0.3.1 // indirect
28+
github.com/finos/morphir/pkg/models v0.3.2 // indirect
2929
github.com/gorilla/css v1.0.1 // indirect
3030
github.com/inconshreveable/mousetrap v1.1.0 // indirect
3131
github.com/joho/godotenv v1.5.1 // indirect

0 commit comments

Comments
 (0)