1- # Homebrew formula for wwk CLI
1+ # Homebrew formula for WellWhaddyaKnow — CLI, agent, and GUI
22# To install: brew tap Daylily-Informatics/tap && brew install wwk
33
44class Wwk < Formula
5- desc "CLI for WellWhaddyaKnow time tracker "
5+ desc "macOS time tracker — CLI, background agent, and menu bar app "
66 homepage "https://github.com/Daylily-Informatics/well-whaddya-know"
7- url "https://github.com/Daylily-Informatics/well-whaddya-know/archive/refs/tags/0.5.1 .tar.gz"
8- sha256 "27ac14bceb343ecbd97b3d1a48011097aac7685a52a0c801d0b48ab3a419d1cb "
7+ url "https://github.com/Daylily-Informatics/well-whaddya-know/archive/refs/tags/0.6.0 .tar.gz"
8+ sha256 "5b7acd96ce23f31a8f13f11b4f8a6077669c55be36363985df065784e834bfe5 "
99 license "MIT"
1010 head "https://github.com/Daylily-Informatics/well-whaddya-know.git" , branch : "main"
1111
@@ -23,40 +23,81 @@ def install
2323 }
2424 SWIFT
2525
26+ # Build all products (wwk, wwkd, WellWhaddyaKnow)
2627 system "swift" , "build" ,
2728 "--configuration" , "release" ,
2829 "--disable-sandbox" ,
2930 "-Xswiftc" , "-cross-module-optimization"
31+
32+ # Install CLI and agent binaries
3033 bin . install ".build/release/wwk"
3134 bin . install ".build/release/wwkd"
35+
36+ # Construct WellWhaddyaKnow.app bundle
37+ app_bundle = prefix /"WellWhaddyaKnow.app"
38+ contents = app_bundle /"Contents"
39+ macos_dir = contents /"MacOS"
40+ resources = contents /"Resources"
41+ la_dir = contents /"Library/LaunchAgents"
42+
43+ macos_dir . mkpath
44+ resources . mkpath
45+ la_dir . mkpath
46+
47+ cp ".build/release/WellWhaddyaKnow" , macos_dir /"WellWhaddyaKnow"
48+ cp ".build/release/wwkd" , macos_dir /"wwkd"
49+
50+ # Embed launchd plist (required for SMAppService)
51+ cp "Sources/WellWhaddyaKnowApp/LaunchAgents/com.daylily.wellwhaddyaknow.agent.plist" ,
52+ la_dir /"com.daylily.wellwhaddyaknow.agent.plist"
53+
54+ # Process Info.plist — substitute Xcode variables
55+ info_plist = ( buildpath /"Sources/WellWhaddyaKnowApp/Info.plist" ) . read
56+ info_plist . gsub! ( "$(EXECUTABLE_NAME)" , "WellWhaddyaKnow" )
57+ info_plist . gsub! ( "$(PRODUCT_BUNDLE_IDENTIFIER)" , "com.daylily.wellwhaddyaknow" )
58+ ( contents /"Info.plist" ) . write ( info_plist )
59+
60+ cp "Sources/WellWhaddyaKnowApp/PrivacyInfo.xcprivacy" , resources /"PrivacyInfo.xcprivacy"
61+ ( contents /"PkgInfo" ) . write ( "APPL????" )
62+
63+ # Ad-hoc codesign (inner → outer)
64+ system "codesign" , "--force" , "--sign" , "-" ,
65+ "-i" , "com.daylily.wellwhaddyaknow.agent" ,
66+ macos_dir /"wwkd"
67+ system "codesign" , "--force" , "--sign" , "-" ,
68+ macos_dir /"WellWhaddyaKnow"
69+ system "codesign" , "--force" , "--sign" , "-" ,
70+ app_bundle . to_s
3271 end
3372
3473 def caveats
3574 <<~EOS
36- wwk is the CLI and wwkd is the background agent for WellWhaddyaKnow .
75+ WellWhaddyaKnow — macOS time tracker (CLI + agent + GUI) .
3776
38- Install agent as login item (starts automatically at login):
39- wwk agent install
77+ Quick start:
78+ wwk agent install # Register agent as login item
79+ wwk gui # Launch the menu bar app
80+ wwk status # Show current tracking status
4081
4182 Agent management:
42- wwk agent status # Show agent status
43- wwk agent start # Start agent
44- wwk agent stop # Stop agent
45- wwk agent uninstall # Remove login item
46-
47- Usage:
48- wwk status # Show current status
49- wwk today # Today's summary
50- wwk week # This week's summary
51- wwk --help # Full command reference
52-
53- For the menu bar GUI app:
54- brew install --cask daylily-informatics/tap/wellwhaddyaknow
83+ wwk agent status # Check agent status
84+ wwk agent start # Start the agent
85+ wwk agent stop # Stop the agent
86+ wwk agent uninstall # Remove login item
87+
88+ Reporting:
89+ wwk today # Today's summary
90+ wwk week # This week's summary
91+ wwk --help # Full command reference
92+
93+ GUI app location:
94+ #{ opt_prefix } /WellWhaddyaKnow.app
5595 EOS
5696 end
5797
5898 test do
59- # Test that the CLI runs and shows help
6099 assert_match "USAGE: wwk" , shell_output ( "#{ bin } /wwk --help" )
100+ assert_match "gui" , shell_output ( "#{ bin } /wwk --help" )
61101 end
62102end
103+
0 commit comments