Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .changeset/public-beta.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ewiz": patch
---

**eWiz is now labelled as a public beta.** Settings › About shows a Beta badge and a line on what that means, and the version under Updates reads "beta" too. The label goes away by itself at 1.0. Until then, **Report a Bug** in About is the most helpful thing you can do; it attaches the diagnostics for you.
61 changes: 52 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,26 @@ Charge limiting, heat-aware charging, sleep-safe enforcement, and one-tap save
modes — all from your menu bar, built for Apple Silicon.

<a href="https://ewiz.app"><b>Website</b></a> ·
<a href="https://ewiz.app/features"><b>Features</b></a> ·
<a href="https://ewiz.app/buy"><b>Buy</b></a> ·
<a href="https://github.com/stroke-app/ewiz/releases"><b>Releases</b></a> ·
<a href="https://github.com/stroke-app/ewiz/issues"><b>Feedback</b></a>
<a href="https://github.com/stroke-app/ewiz/issues"><b>Feedback</b></a> ·
<a href="https://ewiz.app/donate/checkout"><b>Donate</b></a>

![Status](https://img.shields.io/badge/status-public%20beta-orange)
![Release](https://img.shields.io/github/v/release/stroke-app/ewiz?label=release)
![Platform](https://img.shields.io/badge/macOS-14%2B-blue)
![Arch](https://img.shields.io/badge/Apple%20Silicon-arm64-black)
![Price](https://img.shields.io/badge/price-%242.99-green)
![License](https://img.shields.io/badge/license-eWiz%20License-lightgrey)

</div>

> **eWiz is in public beta.** It's stable enough to run every day and is updated
> often. Until 1.0, expect rough edges and please
> [report anything odd](https://github.com/stroke-app/ewiz/issues/new); the app's
> **Report a Bug** button attaches the diagnostics for you.

## Why eWiz exists

Lithium batteries wear out fastest when they sit at a high charge and when they
Expand All @@ -33,6 +42,10 @@ of the time.

## What it does

New to it? [ewiz.app/features](https://ewiz.app/features) walks through every setting
in plain language. In the app, Settings shows the everyday options first; switch on
**Advanced settings** at the bottom of the sidebar for the rest.

**Charging & longevity**

- **Charge limit** — cap charging anywhere from 50–100%. eWiz holds the level
Expand Down Expand Up @@ -146,6 +159,11 @@ change is never a mystery.
*Settings → Shortcuts*, defaults sit on ⌃⌥⌘, and anything disruptive (sleep, force
discharge) ships unbound. No Accessibility permission needed: eWiz claims only
the combinations you assign and never sees anything else you type.
- **AI agents (MCP)** — eWiz ships an MCP server inside the app. Connect Claude
Desktop or Cursor in one click from *Settings → Automation* (or copy the command for
Claude Code and other clients), and an agent can keep the Mac awake through a long
job and release it after, read battery status, and, only if you allow it, change the
charge limit, pause charging, save mode, Low Power Mode and sleep settings.
- **Launch at login** and **in-app auto-update**, and it'll tell you if the helper
ever falls out of date so features don't silently stop working.

Expand Down Expand Up @@ -248,15 +266,18 @@ This is a monorepo ([Bun](https://bun.sh) workspaces + [Turborepo](https://turbo
| [`apps/web`](apps/web) | [ewiz.app](https://ewiz.app): website, checkout and licensing (TanStack Start on Cloudflare) |
| `packages/` | Shared code (empty for now) |

The in-app update feed (`appcast.xml` / `appcast.json`) and the Homebrew cask still
live in [`stroke-app/ewiz-releases`](https://github.com/stroke-app/ewiz-releases):
installed copies read the feed from that URL, and the release workflow publishes to it.
The in-app update feed is `https://ewiz.app/appcast.xml`, which serves the
`appcast.xml` attached to the latest GitHub release. Copies up to 0.19.10 still read
the legacy feed in [`stroke-app/ewiz-releases`](https://github.com/stroke-app/ewiz-releases),
which the release workflow keeps updating. The Homebrew cask lives in
[`stroke-app/homebrew-ewiz`](https://github.com/stroke-app/homebrew-ewiz).

```bash
bun install
bun run dev:web # the website
bun run build # build everything (turbo)
bun run test # Swift tests
bun run secrets:restore # maintainers: the .env files, from the encrypted backup
bun run dev:web # the website (needs apps/web/.env)
bun run build # build everything (turbo)
bun run test # Swift tests
```

## Build from source
Expand Down Expand Up @@ -293,8 +314,30 @@ bun run changeset # describe your change (patch / minor / major)
```

Commit the generated `.changeset/*.md`. Merging the auto-opened "Version Packages"
PR bumps the version in `apps/macos/package.json` and [`CHANGELOG.md`](apps/macos/CHANGELOG.md); pushing that version tag triggers the
release build.
PR bumps the version in `apps/macos/package.json` and
[`CHANGELOG.md`](apps/macos/CHANGELOG.md), tags it, and starts the release build. The
release builds and signs the DMG, publishes the GitHub release, and updates the update
feeds and the Homebrew cask. Deploy the website (`bun run deploy` in `apps/web`)
separately.

### Secrets (maintainers)

GitHub Actions and Cloudflare never show a secret again once it's set, so the only
readable copies are two gitignored files: `apps/web/.env` (website) and
`apps/macos/.env` (release signing). [`scripts/secrets.sh`](scripts/secrets.sh) keeps
an AES-256 encrypted backup of both in iCloud Drive and is the only way secrets should
change:

```bash
bun run secrets:check # anything set remotely but missing locally?
bun run secrets:push:web # after editing apps/web/.env → Cloudflare + backup
bun run secrets:push:release # after editing apps/macos/.env → GitHub + backup
bun run secrets:restore # new Mac: put both files back from the backup
```

The update signing key and the license signing key are irreplaceable: lose the first
and installed copies can never update again; lose the second and every license stops
verifying.

The app and helper speak a small versioned protocol over their socket. When you
change what the daemon does, bump `ControlProtocol.version` — the app compares it to
Expand Down
15 changes: 13 additions & 2 deletions .env.example → apps/macos/.env.example
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
# eWiz release secrets — template.
# Copy to .env (gitignored), fill in, then run: ./scripts/set-github-secrets.sh
# eWiz release secrets — template for apps/macos/.env (gitignored).
# The real file is backed up, restored and pushed to GitHub with the repo-root script:
# ./scripts/secrets.sh restore # get it back from the encrypted iCloud backup
# ./scripts/secrets.sh push release # upload to GitHub Actions + back up again
#
# These feed the GitHub Actions "Release" workflow for Developer-ID signing and
# notarization. Until the Apple ones are filled, releases build UNSIGNED.

# Ed25519 seed that signs every update. Irreplaceable: installed copies only accept
# updates signed with it (UpdateSignature.publicKeyBase64 is its public half).
UPDATE_SIGNING_PRIVATE_KEY=

# The "eWiz Code Signing" self-signed identity as .p12, base64, and its password.
# Irreplaceable in practice: a new certificate makes macOS forget eWiz's permissions.
SELF_SIGNED_CERT_P12_BASE64=
SELF_SIGNED_CERT_PASSWORD=

# Ephemeral CI keychain password — any random string. (Auto-generated in .env.)
KEYCHAIN_PASSWORD=

Expand Down
10 changes: 10 additions & 0 deletions apps/macos/Sources/EWizKit/AppStage.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Foundation

/// eWiz is in beta until 1.0. Derived from the version rather than a flag, so the label
/// can't outlive the beta: shipping 1.0.0 is what takes it away.
public enum AppStage {
public static func isBeta(version: String) -> Bool {
let major = version.split(separator: ".").first.flatMap { Int($0) } ?? 0
return major < 1
}
}
30 changes: 27 additions & 3 deletions apps/macos/Sources/eWiz/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,20 @@ struct SettingsView: View {
VStack(spacing: 0) {
VStack(spacing: 8) {
AppIconView(size: 96)
Text("eWiz")
.font(.title2.weight(.semibold))
HStack(spacing: 6) {
Text("eWiz")
.font(.title2.weight(.semibold))
if updater.isBeta { BetaBadge() }
}
Text("Version \(updater.currentVersion)")
.font(.callout).foregroundStyle(.secondary)
if updater.isBeta {
Text("eWiz is in beta: it works, and it's still getting better. Spotted something odd? Report a Bug below helps most.")
.font(.caption).foregroundStyle(.secondary)
.multilineTextAlignment(.center)
.frame(maxWidth: 320)
.padding(.top, 2)
}
Text("Created by Nischal Dahal")
.font(.callout).foregroundStyle(.secondary)
}
Expand Down Expand Up @@ -1629,7 +1639,7 @@ struct SettingsView: View {
Button("Check for Updates…") { updater.checkForUpdates() }
.disabled(!updater.canCheckForUpdates)
Spacer()
Text("v\(updater.currentVersion)")
Text("v\(updater.currentVersion)\(updater.isBeta ? " beta" : "")")
.font(.callout).foregroundStyle(.secondary).monospacedDigit()
}
.padding(.horizontal, rowInset).padding(.vertical, DS.Space.s + 2)
Expand Down Expand Up @@ -2189,3 +2199,17 @@ struct BatteryStylePicker: View {
// Show a representative level so the styles are easy to tell apart even at 0%.
private var previewPct: Int { max(35, min(100, percentage)) }
}

/// The small "BETA" capsule beside the app name while eWiz is below 1.0.
struct BetaBadge: View {
var body: some View {
Text("BETA")
.font(.caption2.weight(.semibold))
.tracking(0.6)
.foregroundStyle(Color.accentColor)
.padding(.horizontal, 6)
.padding(.vertical, 2)
.background(Capsule().fill(Color.accentColor.opacity(0.15)))
.accessibilityLabel("Beta")
}
}
4 changes: 4 additions & 0 deletions apps/macos/Sources/eWiz/UpdaterManager.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Combine
import Foundation
import EWizKit
import Sparkle

/// In-app updates, through Sparkle: a check on launch and daily, or on demand; then its
Expand All @@ -23,6 +24,9 @@ final class UpdaterManager: ObservableObject {
let currentVersion: String =
(Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String) ?? "0.0.0"

/// True until 1.0; shown as "Beta" beside the version.
var isBeta: Bool { AppStage.isBeta(version: currentVersion) }

private let controller: SPUStandardUpdaterController
private let observer = UpdateObserver()

Expand Down
19 changes: 19 additions & 0 deletions apps/macos/Tests/EWizKitTests/AppStageTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import Testing
@testable import EWizKit

struct AppStageTests {
@Test func zeroMajorIsBeta() {
#expect(AppStage.isBeta(version: "0.20.1"))
#expect(AppStage.isBeta(version: "0.1.0"))
}

@Test func oneAndAboveIsNotBeta() {
#expect(!AppStage.isBeta(version: "1.0.0"))
#expect(!AppStage.isBeta(version: "2.3.4"))
}

@Test func unreadableVersionCountsAsBeta() {
#expect(AppStage.isBeta(version: ""))
#expect(AppStage.isBeta(version: "dev"))
}
}
50 changes: 3 additions & 47 deletions apps/macos/scripts/set-github-secrets.sh
Original file line number Diff line number Diff line change
@@ -1,48 +1,4 @@
#!/bin/bash
# Reads .env and uploads each non-empty value as a GitHub Actions secret via gh.
# Empty values are skipped (so you can run it now and again after filling Apple keys).
# ./scripts/set-github-secrets.sh
set -euo pipefail

REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
ENV_FILE="$REPO_DIR/.env"
REPO="${GH_REPO:-stroke-app/ewiz}"

if [[ ! -f "$ENV_FILE" ]]; then
echo "error: $ENV_FILE not found. Copy .env.example to .env and fill it." >&2
exit 1
fi

# Load .env without exporting comments/blank lines.
set -a
# shellcheck disable=SC1090
source "$ENV_FILE"
set +a

SECRETS=(
KEYCHAIN_PASSWORD
DEVELOPER_ID_CERT_P12_BASE64
DEVELOPER_ID_CERT_PASSWORD
NOTARY_KEY_ID
NOTARY_ISSUER_ID
NOTARY_KEY_P8_BASE64
RELEASES_TOKEN
)

echo "Setting secrets on $REPO …"
set_count=0
for name in "${SECRETS[@]}"; do
value="${!name:-}"
if [[ -z "$value" ]]; then
echo " - $name: empty, skipped"
continue
fi
gh secret set "$name" --repo "$REPO" --body "$value"
echo " ✓ $name set"
set_count=$((set_count + 1))
done

echo "Done. $set_count secret(s) set."
[[ $set_count -lt ${#SECRETS[@]} ]] && \
echo "Fill the remaining Apple values in .env and re-run to enable signed releases."
exit 0
# Superseded by the repo-root secrets script, which also backs the values up so they
# can't be lost (GitHub never shows a secret again once it's set).
exec "$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)/scripts/secrets.sh" push release
2 changes: 1 addition & 1 deletion apps/web/src/components/landing/landing-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ function Hero({
<BuyButton>Buy · {PRICE}</BuyButton>
</div>
<p className="mt-3 text-sm text-muted-foreground">
Free for 30 days · macOS 14+ · Apple Silicon
Public beta · Free for 30 days · macOS 14+ · Apple Silicon
</p>
</Container>

Expand Down
7 changes: 5 additions & 2 deletions apps/web/src/components/site/site-shell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,13 @@ export function SiteHeader() {
<Container className="grid h-[88px] max-w-[68rem] grid-cols-[1fr_auto_1fr] items-center">
<Link
to="/"
aria-label="eWiz home"
className="justify-self-start transition-opacity hover:opacity-80"
aria-label="eWiz home, public beta"
className="flex items-center gap-2 justify-self-start transition-opacity hover:opacity-80"
>
<AppIcon className="size-8" />
<span className="rounded-full bg-primary/15 px-2 py-0.5 text-[11px] font-semibold tracking-wide text-primary uppercase">
Beta
</span>
</Link>
<nav className="flex items-center gap-3 text-sm text-muted-foreground sm:gap-6 sm:text-[15px]">
<Link to="/features" className={NAV_LINK}>
Expand Down
12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
"name": "ewiz-monorepo",
"private": true,
"packageManager": "bun@1.2.2",
"workspaces": ["apps/*", "packages/*"],
"workspaces": [
"apps/*",
"packages/*"
],
"scripts": {
"dev": "turbo run dev",
"dev:web": "turbo run dev --filter=@ewiz/web",
Expand All @@ -14,7 +17,12 @@
"format": "turbo run format",
"changeset": "changeset",
"version": "changeset version",
"prepare": "husky"
"prepare": "husky",
"secrets:backup": "./scripts/secrets.sh backup",
"secrets:restore": "./scripts/secrets.sh restore",
"secrets:check": "./scripts/secrets.sh check",
"secrets:push:web": "./scripts/secrets.sh push web",
"secrets:push:release": "./scripts/secrets.sh push release"
},
"devDependencies": {
"@changesets/cli": "^2.27.9",
Expand Down
Loading
Loading