Skip to content
Open
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ Exceptions are acceptable depending on the circumstances (critical bug fixes tha

## [Unreleased]

### Added

- added automatic version check on CLI startup using `CheckForUpdates`

## [0.5.0] - 2026-04-03

### Added
Expand Down
2 changes: 2 additions & 0 deletions cmd/devforge/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ func main() {
rootCmd.AddCommand(newVersionCmd())
rootCmd.AddCommand(newSelfUpdateCmd())

selfupdate.NewCommand(repoOwner, repoName, binaryName, version).CheckForUpdates()
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CheckForUpdates() is invoked unconditionally on startup before Cobra parses/executes subcommands. This means it will run for every invocation (including dev version, which is intended to be stdout-only for script/pipe compatibility, and dev self-update, which likely already checks). Consider moving the update check into a rootCmd.PersistentPreRun{E} (so you can skip specific commands) and ensure any warning/output goes to stderr and doesn’t block command execution (e.g., run with a short timeout or in a goroutine).

Copilot uses AI. Check for mistakes.

if err := rootCmd.Execute(); err != nil {
logger.Fatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.26.1

require (
github.com/google/go-github/v66 v66.0.0
github.com/rios0rios0/cliforge v0.1.1-0.20260402173400-cd7225c728db
github.com/rios0rios0/cliforge v0.2.1-0.20260404230949-b9683f7eded2
github.com/rios0rios0/gitforge v0.9.1
github.com/rios0rios0/langforge v0.5.0
github.com/sirupsen/logrus v1.9.4
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rios0rios0/cliforge v0.1.1-0.20260402173400-cd7225c728db h1:uplUAe01ckRMX7GzquWtdmnYweYLh0yLr7UFZfjQ2nI=
github.com/rios0rios0/cliforge v0.1.1-0.20260402173400-cd7225c728db/go.mod h1:xqHRf5C15as2KOOTXdyNZQnfExtXOpSkRljkhZ4hVsQ=
github.com/rios0rios0/cliforge v0.2.1-0.20260404230949-b9683f7eded2 h1:cRuv/NTZ7B7UzTzO3JQy8VQlYxo45xC0RPhnVN6Ar7k=
github.com/rios0rios0/cliforge v0.2.1-0.20260404230949-b9683f7eded2/go.mod h1:Ma0C18zImHW305Ezt+XCsmUmtSj3BM1mcBk7G5lttv0=
github.com/rios0rios0/gitforge v0.9.1 h1:HykXcbckOwiMhOKvtJ1ICEry9pEq8/2gMIJcjqjIr6A=
github.com/rios0rios0/gitforge v0.9.1/go.mod h1:1ts/2K9iVaMYBk4b/XWPN5vfjt7A6ktWxXSgm0ox2FU=
github.com/rios0rios0/langforge v0.5.0 h1:mRXfvgna9PGc4S2iYBztmYmwTW9o8MHj0Ne1W8pAy80=
Expand Down