Skip to content

Commit 1f0769f

Browse files
bugrasklclaude
andcommitted
Initial release of sweepkit
sweepkit shows which files are safe to delete, explains what deleting them costs, and deletes nothing until the user confirms. - Engine with a guard that seals personal folders and protects system folders, never follows links or junctions, and deletes through os.Root so a folder swapped for a link after the scan cannot redirect deletion. - Targets for Windows and Linux, with browser and developer caches opt-in and their costs stated. - Command-line tool (list, scan, clean) with no networking code linked. - Wails desktop app in English and Turkish. - CI on Windows and Linux, and a release workflow that builds, packages (zip, tar.gz, deb, rpm, pacman), checksums and attests every file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0 parents  commit 1f0769f

61 files changed

Lines changed: 5415 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitattributes‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* text=auto eol=lf
2+
*.png binary
3+
*.ico binary

‎.github/workflows/ci.yml‎

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
test:
13+
name: Test (${{ matrix.os }})
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
os: [ubuntu-latest, windows-latest]
18+
runs-on: ${{ matrix.os }}
19+
steps:
20+
- uses: actions/checkout@v7
21+
- uses: actions/setup-go@v7
22+
with:
23+
go-version: stable
24+
- name: Check formatting
25+
if: runner.os == 'Linux'
26+
run: |
27+
unformatted="$(gofmt -l .)"
28+
if [ -n "$unformatted" ]; then echo "::error::run gofmt on: $unformatted"; exit 1; fi
29+
- run: go vet ./internal/... ./cmd/...
30+
- run: go test ./internal/... ./cmd/...
31+
- name: Race detector
32+
if: runner.os == 'Linux'
33+
run: go test -race ./internal/... ./cmd/...
34+
35+
offline:
36+
name: CLI links no network code
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v7
40+
- uses: actions/setup-go@v7
41+
with:
42+
go-version: stable
43+
- name: Check dependencies
44+
run: |
45+
for goos in linux windows; do
46+
found="$(GOOS=$goos go list -deps ./cmd/sweepkit | grep -Ex 'net|net/http|crypto/tls' || true)"
47+
if [ -n "$found" ]; then
48+
echo "::error::the $goos CLI depends on network packages: $found"
49+
exit 1
50+
fi
51+
done
52+
echo "The CLI does not link any networking package."
53+
54+
gui:
55+
name: Desktop app (${{ matrix.os }})
56+
strategy:
57+
fail-fast: false
58+
matrix:
59+
include:
60+
- os: windows-latest
61+
tags: ""
62+
- os: ubuntu-22.04
63+
tags: webkit2_41
64+
runs-on: ${{ matrix.os }}
65+
steps:
66+
- uses: actions/checkout@v7
67+
- uses: actions/setup-go@v7
68+
with:
69+
go-version: stable
70+
- name: Install GTK and WebKit
71+
if: runner.os == 'Linux'
72+
run: sudo apt-get update && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev
73+
- run: go install github.com/wailsapp/wails/v2/cmd/wails@v2.16.0
74+
- name: Build
75+
shell: bash
76+
run: wails build -skipbindings ${{ matrix.tags && format('-tags {0}', matrix.tags) || '' }}

‎.github/workflows/release.yml‎

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags: ["v*"]
6+
7+
permissions:
8+
contents: read
9+
10+
env:
11+
GO_VERSION: "1.27.x"
12+
WAILS_VERSION: v2.16.0
13+
VERSION_FLAG: -X github.com/bugraskl/sweepkit/internal/version.Version=${{ github.ref_name }}
14+
15+
jobs:
16+
cli:
17+
name: Command-line tool
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v7
21+
- uses: actions/setup-go@v7
22+
with:
23+
go-version: ${{ env.GO_VERSION }}
24+
- run: go test ./internal/... ./cmd/...
25+
- name: Build
26+
run: |
27+
for target in windows/amd64 windows/arm64 linux/amd64 linux/arm64; do
28+
os="${target%/*}"; arch="${target#*/}"; ext=""
29+
[ "$os" = windows ] && ext=".exe"
30+
CGO_ENABLED=0 GOOS="$os" GOARCH="$arch" go build -trimpath -ldflags "-s -w $VERSION_FLAG" \
31+
-o "out/${os}_${arch}/sweepkit${ext}" ./cmd/sweepkit
32+
done
33+
- uses: actions/upload-artifact@v7
34+
with:
35+
name: cli
36+
path: out/
37+
38+
gui-windows:
39+
name: Desktop app (Windows)
40+
runs-on: windows-latest
41+
steps:
42+
- uses: actions/checkout@v7
43+
- uses: actions/setup-go@v7
44+
with:
45+
go-version: ${{ env.GO_VERSION }}
46+
- run: go install github.com/wailsapp/wails/v2/cmd/wails@${{ env.WAILS_VERSION }}
47+
- name: Build
48+
shell: bash
49+
run: |
50+
jq --arg v "${GITHUB_REF_NAME#v}" '.info.productVersion = $v' wails.json > wails.tmp && mv wails.tmp wails.json
51+
for arch in amd64 arm64; do
52+
wails build -clean -trimpath -skipbindings -platform "windows/$arch" -ldflags "-s -w $VERSION_FLAG" -o sweepkit-gui.exe
53+
mkdir -p "out/windows_$arch"
54+
mv build/bin/sweepkit-gui.exe "out/windows_$arch/"
55+
done
56+
- uses: actions/upload-artifact@v7
57+
with:
58+
name: gui-windows
59+
path: out/
60+
61+
gui-linux:
62+
name: Desktop app (Linux ${{ matrix.arch }})
63+
strategy:
64+
matrix:
65+
include:
66+
- arch: amd64
67+
runner: ubuntu-22.04
68+
- arch: arm64
69+
runner: ubuntu-22.04-arm
70+
runs-on: ${{ matrix.runner }}
71+
steps:
72+
- uses: actions/checkout@v7
73+
- uses: actions/setup-go@v7
74+
with:
75+
go-version: ${{ env.GO_VERSION }}
76+
- run: sudo apt-get update && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev
77+
- run: go install github.com/wailsapp/wails/v2/cmd/wails@${{ env.WAILS_VERSION }}
78+
- name: Build
79+
run: |
80+
wails build -clean -trimpath -skipbindings -tags webkit2_41 -ldflags "-s -w $VERSION_FLAG" -o sweepkit-gui
81+
mkdir -p "out/linux_${{ matrix.arch }}"
82+
mv build/bin/sweepkit-gui "out/linux_${{ matrix.arch }}/"
83+
- uses: actions/upload-artifact@v7
84+
with:
85+
name: gui-linux-${{ matrix.arch }}
86+
path: out/
87+
88+
publish:
89+
name: Publish release
90+
needs: [cli, gui-windows, gui-linux]
91+
runs-on: ubuntu-latest
92+
permissions:
93+
contents: write
94+
id-token: write
95+
attestations: write
96+
steps:
97+
- uses: actions/checkout@v7
98+
- uses: actions/download-artifact@v8
99+
with:
100+
path: out/
101+
merge-multiple: true
102+
- uses: actions/setup-go@v7
103+
with:
104+
go-version: ${{ env.GO_VERSION }}
105+
- run: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v2.47.0
106+
- run: bash scripts/package.sh "$GITHUB_REF_NAME"
107+
- uses: actions/attest-build-provenance@v4
108+
with:
109+
subject-path: dist/*
110+
- name: Create GitHub release
111+
env:
112+
GH_TOKEN: ${{ github.token }}
113+
run: |
114+
gh release create "$GITHUB_REF_NAME" dist/* \
115+
--title "sweepkit $GITHUB_REF_NAME" \
116+
--notes-file stage/NOTES.md \
117+
--verify-tag

‎.gitignore‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/build/bin/
2+
/dist/
3+
/frontend/wailsjs/
4+
/.claude/
5+
*.test
6+
*.exe

‎CHANGELOG.md‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Changelog
2+
3+
All notable changes to sweepkit are documented here. The format follows
4+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses
5+
[Semantic Versioning](https://semver.org/).
6+
7+
## [0.1.0] - 2026-09-29
8+
9+
First public release.
10+
11+
### Added
12+
13+
- Command-line tool `sweepkit` with `list`, `scan`, `clean` and `version`.
14+
`scan` never changes anything; `clean` asks before deleting and supports
15+
`--yes` and `--json` for scripts.
16+
- Desktop app `sweepkit-gui` in English and Turkish, following the system's
17+
light or dark theme.
18+
- Windows targets: temporary files, system temporary files, Windows Update
19+
downloads, crash dumps, error reports and GPU shader caches.
20+
- Linux targets: thumbnail cache, APT, DNF and pacman package caches, archived
21+
systemd journals and core dumps.
22+
- Browser caches (Chrome, Chromium, Edge, Brave, Vivaldi, Opera, Firefox) and
23+
developer caches (npm, pip, Go, Yarn, NuGet) as opt-in targets.
24+
- Safety model: age thresholds, sealed personal folders, protected system
25+
folders, no link or junction following, traversal-resistant deletion,
26+
in-use files left alone, browsers must be closed first.
27+
- Release builds for Windows and Linux (amd64 and arm64) with SHA-256
28+
checksums and build provenance attestations.
29+
30+
[0.1.0]: https://github.com/bugraskl/sweepkit/releases/tag/v0.1.0

‎CONTRIBUTING.md‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Contributing
2+
3+
Thanks for helping. sweepkit's value comes from being boring and trustworthy,
4+
so the bar for new cleaning targets is high.
5+
6+
## Adding a target
7+
8+
A new target needs all of these:
9+
10+
1. **A real, measurable benefit.** It must free disk space that stays freed
11+
long enough to matter. "Speeds up your PC" is not a benefit unless it can
12+
be measured and reproduced.
13+
2. **A documented or well-established location.** Link to the vendor's
14+
documentation or the tool's own clean command in the pull request.
15+
3. **Safe defaults.** Pick a `MinAge` that leaves files in active use alone.
16+
Anything that costs speed (browser, shader and developer caches) must be
17+
opt-in (`Default: false`) and explain the cost in `Caveat`.
18+
4. **Both languages.** Every `Name`, `Description` and `Caveat` needs English
19+
and Turkish text.
20+
5. **Tests** when the target has any logic of its own (`Match`, `Select`).
21+
22+
If a tool has its own clean command, prefer running it (`Command`) over
23+
deleting its files yourself.
24+
25+
## Development
26+
27+
You need Go 1.26 or newer. The desktop app also needs
28+
[Wails v2](https://wails.io/docs/gettingstarted/installation) and, on Linux,
29+
`libgtk-3-dev` and `libwebkit2gtk-4.1-dev`.
30+
31+
```sh
32+
go test ./internal/... ./cmd/... # tests
33+
go run ./cmd/sweepkit scan --all # try the CLI; scan changes nothing
34+
wails dev # desktop app with live reload
35+
wails build -tags webkit2_41 # desktop app build on Linux
36+
```
37+
38+
The front end is plain HTML, CSS and JavaScript in `frontend/dist`; there is
39+
no build step. The icon is drawn by `go run scripts/genicon/main.go`.
40+
41+
## Releasing
42+
43+
1. Update `CHANGELOG.md`.
44+
2. Tag and push: `git tag v0.2.0 && git push origin v0.2.0`.
45+
46+
The release workflow builds everything, attests it and publishes the release.

‎LICENSE‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Buğra Şıkel
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)