Skip to content

Commit ab41a3f

Browse files
authored
Merge pull request #69 from openclaw/codex/releasecheck-notice
feat: add release update checks
2 parents 3225fd3 + 2d0cc9c commit ab41a3f

10 files changed

Lines changed: 115 additions & 18 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
### Changes
66

7+
- Add cached release checks with `discrawl check-update` and passive terminal
8+
notices when a newer OpenClaw release is available.
9+
710
### Fixes
811

912
## 0.9.0 - 2026-05-17

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,21 @@ then copy the database/share/cache/log paths you want to move.
123123
Homebrew (recommended):
124124

125125
```bash
126-
brew install steipete/tap/discrawl # auto-taps steipete/tap
126+
brew install openclaw/tap/discrawl
127127
discrawl --version
128128
```
129129

130+
Check for newer releases manually with:
131+
132+
```bash
133+
discrawl check-update
134+
```
135+
136+
Interactive terminal runs also perform a cached daily release check and print a
137+
stderr notice when a newer OpenClaw release is available. Set
138+
`DISCRAWL_NO_UPDATE_CHECK=1` or `CRAWLKIT_NO_UPDATE_CHECK=1` to disable that
139+
passive notice.
140+
130141
Build from source:
131142

132143
```bash

docs/RELEASING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ Useful commands:
8585
curl -L -o /tmp/discrawl-darwin-arm64.tgz https://github.com/openclaw/discrawl/releases/download/vX.Y.Z/discrawl_X.Y.Z_darwin_arm64.tar.gz
8686
shasum -a 256 /tmp/discrawl-darwin-arm64.tgz
8787
brew uninstall discrawl || true
88-
brew install steipete/tap/discrawl
88+
brew install openclaw/tap/discrawl
8989
discrawl --version
90-
brew info steipete/tap/discrawl
90+
brew info openclaw/tap/discrawl
9191
```
9292

9393
## Notes

docs/install.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,23 @@ Discrawl is a single Go binary. Install via Homebrew or build from source.
55
## Homebrew
66

77
```bash
8-
brew install steipete/tap/discrawl
8+
brew install openclaw/tap/discrawl
99
discrawl --version
1010
```
1111

12-
The tap auto-installs from `steipete/tap`.
12+
The tap auto-installs from `openclaw/tap`.
13+
14+
## Check for updates
15+
16+
```bash
17+
discrawl check-update
18+
discrawl check-update --json
19+
```
20+
21+
Interactive terminal runs perform a cached daily release check and print a
22+
stderr notice when a newer OpenClaw release is available. Scripted, JSON, CI,
23+
and non-TTY runs skip the passive notice. Set `DISCRAWL_NO_UPDATE_CHECK=1` or
24+
`CRAWLKIT_NO_UPDATE_CHECK=1` to disable it.
1325

1426
## From source
1527

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ require (
1818
github.com/clipperhouse/displaywidth v0.11.0 // indirect
1919
github.com/clipperhouse/uax29/v2 v2.7.0 // indirect
2020
github.com/pelletier/go-toml/v2 v2.3.1 // indirect
21-
modernc.org/sqlite v1.50.0 // indirect
21+
modernc.org/sqlite v1.50.1 // indirect
2222
)
2323

2424
require (
@@ -45,15 +45,15 @@ require (
4545
github.com/muesli/cancelreader v0.2.2 // indirect
4646
github.com/muesli/termenv v0.16.0 // indirect
4747
github.com/ncruces/go-strftime v1.0.0 // indirect
48-
github.com/openclaw/crawlkit v0.5.2
48+
github.com/openclaw/crawlkit v0.6.0
4949
github.com/pmezard/go-difflib v1.0.0 // indirect
5050
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
5151
github.com/rivo/uniseg v0.4.7 // indirect
5252
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
5353
golang.org/x/crypto v0.50.0 // indirect
5454
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
5555
gopkg.in/yaml.v3 v3.0.1 // indirect
56-
modernc.org/libc v1.72.1 // indirect
56+
modernc.org/libc v1.72.3 // indirect
5757
modernc.org/mathutil v1.7.1 // indirect
5858
modernc.org/memory v1.11.0 // indirect
5959
)

go.sum

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ github.com/muesli/termenv v0.16.0 h1:S5AlUN9dENB57rsbnkPyfdGuWIlkmzJjbFf0Tf5FWUc
7373
github.com/muesli/termenv v0.16.0/go.mod h1:ZRfOIKPFDYQoDFF4Olj7/QJbW60Ol/kL1pU3VfY/Cnk=
7474
github.com/ncruces/go-strftime v1.0.0 h1:HMFp8mLCTPp341M/ZnA4qaf7ZlsbTc+miZjCLOFAw7w=
7575
github.com/ncruces/go-strftime v1.0.0/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=
76-
github.com/openclaw/crawlkit v0.5.2 h1:qUUGYvCdbMXjCpxc3m0+OBvsRWd7QGZvPTI+jVfVFyc=
77-
github.com/openclaw/crawlkit v0.5.2/go.mod h1:2Ugac1hP4I5UPaN+Xw5mbOprg5jvgktBPf2hvGx0kqA=
76+
github.com/openclaw/crawlkit v0.6.0 h1:7ef1UDl6qrV3KJu74mw2WJn1+G5zEMhzTFaktn0CMZ4=
77+
github.com/openclaw/crawlkit v0.6.0/go.mod h1:+2kUqiyecwK/vWySHqZnu968wmdWGBebJ22uUhQEalM=
7878
github.com/pelletier/go-toml/v2 v2.3.1 h1:MYEvvGnQjeNkRF1qUuGolNtNExTDwct51yp7olPtrEc=
7979
github.com/pelletier/go-toml/v2 v2.3.1/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=
8080
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
@@ -120,10 +120,10 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN
120120
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
121121
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
122122
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
123-
modernc.org/cc/v4 v4.28.1 h1:XpLbkYVQ24E8tX5u8+yWGvaxerxkR/S4zqxI8ZoSBuc=
124-
modernc.org/cc/v4 v4.28.1/go.mod h1:OnovgIhbbMXMu1aISnJ0wvVD1KnW+cAUJkIrAWh+kVI=
125-
modernc.org/ccgo/v4 v4.33.0 h1:dspBCm75jsj8Y/ufwAMVfe375L2iYdMyQ2QG/v3hL54=
126-
modernc.org/ccgo/v4 v4.33.0/go.mod h1:+RhXBoRYzRwaH21mV/aj6XvQRDtfjcZfAlPMsQo8CR0=
123+
modernc.org/cc/v4 v4.28.2 h1:3tQ0lf2ADtoby2EtSP+J7IE2SHwEJdP8ioR59wx7XpY=
124+
modernc.org/cc/v4 v4.28.2/go.mod h1:OnovgIhbbMXMu1aISnJ0wvVD1KnW+cAUJkIrAWh+kVI=
125+
modernc.org/ccgo/v4 v4.34.0 h1:yRLPFZieg532OT4rp4JFNIVcquwalMX26G95WQDqwCQ=
126+
modernc.org/ccgo/v4 v4.34.0/go.mod h1:AS5WYMyBakQ+fhsHhtP8mWB82KTGPkNNJDGfGQCe0/A=
127127
modernc.org/fileutil v1.4.0 h1:j6ZzNTftVS054gi281TyLjHPp6CPHr2KCxEXjEbD6SM=
128128
modernc.org/fileutil v1.4.0/go.mod h1:EqdKFDxiByqxLk8ozOxObDSfcVOv/54xDs/DUHdvCUU=
129129
modernc.org/gc/v2 v2.6.5 h1:nyqdV8q46KvTpZlsw66kWqwXRHdjIlJOhG6kxiV/9xI=
@@ -132,8 +132,8 @@ modernc.org/gc/v3 v3.1.2 h1:ZtDCnhonXSZexk/AYsegNRV1lJGgaNZJuKjJSWKyEqo=
132132
modernc.org/gc/v3 v3.1.2/go.mod h1:HFK/6AGESC7Ex+EZJhJ2Gni6cTaYpSMmU/cT9RmlfYY=
133133
modernc.org/goabi0 v0.2.0 h1:HvEowk7LxcPd0eq6mVOAEMai46V+i7Jrj13t4AzuNks=
134134
modernc.org/goabi0 v0.2.0/go.mod h1:CEFRnnJhKvWT1c1JTI3Avm+tgOWbkOu5oPA8eH8LnMI=
135-
modernc.org/libc v1.72.1 h1:db1xwJ6u1kE3KHTFTTbe2GCrczHPKzlURP0aDC4NGD0=
136-
modernc.org/libc v1.72.1/go.mod h1:HRMiC/PhPGLIPM7GzAFCbI+oSgE3dhZ8FWftmRrHVlY=
135+
modernc.org/libc v1.72.3 h1:ZnDF4tXn4NBXFutMMQC4vtbTFSXhhKzR73fv0beZEAU=
136+
modernc.org/libc v1.72.3/go.mod h1:dn0dZNnnn1clLyvRxLxYExxiKRZIRENOfqQ8XEeg4Qs=
137137
modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU=
138138
modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg=
139139
modernc.org/memory v1.11.0 h1:o4QC8aMQzmcwCK3t3Ux/ZHmwFPzE6hf2Y5LbkRs+hbI=
@@ -142,8 +142,8 @@ modernc.org/opt v0.2.0 h1:tGyef5ApycA7FSEOMraay9SaTk5zmbx7Tu+cJs4QKZg=
142142
modernc.org/opt v0.2.0/go.mod h1:03fq9lsNfvkYSfxrfUhZCWPk1lm4cq4N+Bh//bEtgns=
143143
modernc.org/sortutil v1.2.1 h1:+xyoGf15mM3NMlPDnFqrteY07klSFxLElE2PVuWIJ7w=
144144
modernc.org/sortutil v1.2.1/go.mod h1:7ZI3a3REbai7gzCLcotuw9AC4VZVpYMjDzETGsSMqJE=
145-
modernc.org/sqlite v1.50.0 h1:eMowQSWLK0MeiQTdmz3lqoF5dqclujdlIKeJA11+7oM=
146-
modernc.org/sqlite v1.50.0/go.mod h1:m0w8xhwYUVY3H6pSDwc3gkJ/irZT/0YEXwBlhaxQEew=
145+
modernc.org/sqlite v1.50.1 h1:l+cQvn0sd0zJJtfygGHuQJ5AjlrwXmWPw4KP3ZMwr9w=
146+
modernc.org/sqlite v1.50.1/go.mod h1:tcNzv5p84E0skkmJn038y+hWJbLQXQqEnQfeh5r2JLM=
147147
modernc.org/strutil v1.2.1 h1:UneZBkQA+DX2Rp35KcM69cSsNES9ly8mQWD71HKlOA0=
148148
modernc.org/strutil v1.2.1/go.mod h1:EHkiggD70koQxjVdSBM3JKM7k6L0FbGE5eymy9i3B9A=
149149
modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y=

internal/cli/cli.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ func Run(ctx context.Context, args []string, stdout, stderr io.Writer) error {
8888
plain: global.Plain,
8989
logger: slog.New(slog.NewTextHandler(stderr, &slog.HandlerOptions{Level: level})),
9090
}
91+
runtime.maybeNotifyRelease(rest)
9192
return runtime.dispatch(rest)
9293
}
9394

@@ -196,6 +197,8 @@ func (r *runtime) dispatch(rest []string) error {
196197
switch rest[0] {
197198
case "metadata":
198199
return r.runMetadata(rest[1:])
200+
case "check-update":
201+
return r.runCheckUpdate(rest[1:])
199202
case "init":
200203
return r.runInit(rest[1:])
201204
case "sync":

internal/cli/control_commands.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ func (r *runtime) runMetadata(args []string) error {
4242
manifest.Privacy = control.Privacy{ContainsPrivateMessages: true, ExportsSecrets: false, LocalOnlyScopes: []string{"discord", "desktop-cache", "sqlite", "git-share"}}
4343
manifest.Commands = map[string]control.Command{
4444
"status": {Title: "Status", Argv: []string{"discrawl", "status", "--json"}, JSON: true},
45+
"check-update": {Title: "Check for updates", Argv: []string{"discrawl", "check-update", "--json"}, JSON: true},
4546
"doctor": {Title: "Doctor", Argv: []string{"discrawl", "doctor", "--json"}, JSON: true},
4647
"sync": {Title: "Sync", Argv: []string{"discrawl", "--json", "sync"}, JSON: true, Mutates: true},
4748
"tap": {Title: "Import desktop cache", Argv: []string{"discrawl", "--json", "tap"}, JSON: true, Mutates: true},

internal/cli/output.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ Usage:
102102
103103
Commands:
104104
metadata
105+
check-update
105106
version
106107
init
107108
sync
@@ -140,6 +141,11 @@ func printCommandUsage(w io.Writer, args []string) error {
140141
}
141142

142143
var commandUsage = map[string]string{
144+
"check-update": `Usage:
145+
discrawl check-update [--json] [--force]
146+
147+
Checks GitHub Releases for a newer discrawl build.
148+
`,
143149
"search": `Usage:
144150
discrawl search [flags] <query>
145151

internal/cli/releasecheck.go

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
package cli
2+
3+
import (
4+
"errors"
5+
"flag"
6+
"fmt"
7+
"io"
8+
9+
"github.com/openclaw/crawlkit/releasecheck"
10+
"github.com/openclaw/discrawl/internal/config"
11+
)
12+
13+
const discrawlUpgradeHint = "brew upgrade openclaw/tap/discrawl"
14+
15+
func discrawlReleaseCheckOptions(force bool) releasecheck.Options {
16+
cfg := config.Default()
17+
return releasecheck.Options{
18+
AppName: "discrawl",
19+
Owner: "openclaw",
20+
Repo: "discrawl",
21+
CurrentVersion: version,
22+
CacheDir: cfg.CacheDir,
23+
Force: force,
24+
}
25+
}
26+
27+
func (r *runtime) maybeNotifyRelease(args []string) {
28+
_, _ = releasecheck.Notify(r.ctx, releasecheck.NotifyOptions{
29+
Options: discrawlReleaseCheckOptions(false),
30+
Stderr: r.stderr,
31+
InstallHint: discrawlUpgradeHint,
32+
Args: args,
33+
JSONOutput: r.json,
34+
IsTerminal: releasecheck.StderrIsTerminal(),
35+
})
36+
}
37+
38+
func (r *runtime) runCheckUpdate(args []string) error {
39+
fs := flag.NewFlagSet("check-update", flag.ContinueOnError)
40+
fs.SetOutput(io.Discard)
41+
jsonOut := fs.Bool("json", false, "")
42+
force := fs.Bool("force", false, "")
43+
if err := fs.Parse(args); err != nil {
44+
return usageErr(err)
45+
}
46+
if fs.NArg() != 0 {
47+
return usageErr(errors.New("check-update takes flags only"))
48+
}
49+
if *jsonOut {
50+
r.json = true
51+
}
52+
result, err := releasecheck.Check(r.ctx, discrawlReleaseCheckOptions(*force))
53+
if err != nil && !errors.Is(err, releasecheck.ErrSkipped) {
54+
return err
55+
}
56+
if r.json {
57+
return r.print(result)
58+
}
59+
_, err = fmt.Fprint(r.stdout, releasecheck.StatusText("discrawl", discrawlUpgradeHint, result))
60+
return err
61+
}

0 commit comments

Comments
 (0)