From 63207bfb51478e46cefd53d6b3e06a7d0f01125b Mon Sep 17 00:00:00 2001 From: Ali HD <85040609+alihd-tech@users.noreply.github.com> Date: Tue, 22 Sep 2026 00:23:40 +0330 Subject: [PATCH 1/4] Remove configurator scheduling and generate runnable CLI commands --- lib/privacy-config.ts | 38 +++++++------------------------------- 1 file changed, 7 insertions(+), 31 deletions(-) diff --git a/lib/privacy-config.ts b/lib/privacy-config.ts index 1a81ea4..9bcaeab 100644 --- a/lib/privacy-config.ts +++ b/lib/privacy-config.ts @@ -1,7 +1,6 @@ export type ReportFormat = "svg" | "json" | "markdown" export type ReportTheme = "dark" | "light" export type CardStyle = "detailed" | "compact" -export type SchedulePreset = "manual" | "daily" | "weekly" | "monthly" | "custom" export interface PrivacyConfig { username: string @@ -12,8 +11,6 @@ export interface PrivacyConfig { cardStyle: CardStyle formats: ReportFormat[] outputDir: string - schedule: SchedulePreset - customCron: string commit: boolean includePrivate: boolean } @@ -27,37 +24,22 @@ export const defaultPrivacyConfig: PrivacyConfig = { cardStyle: "detailed", formats: ["svg", "json", "markdown"], outputDir: "code-life-balance", - schedule: "weekly", - customCron: "17 3 * * 1", commit: true, includePrivate: false, } +const CLI_RELEASE_PACKAGE = + "https://github.com/alihd-tech/CodeLifeBalance/releases/download/v1.2.0/code-life-balance-1.2.0.tgz" + function quoted(value: string) { return JSON.stringify(value) } -function cronFor(config: PrivacyConfig) { - switch (config.schedule) { - case "daily": - return "17 3 * * *" - case "weekly": - return "17 3 * * 1" - case "monthly": - return "17 3 1 * *" - case "custom": - return config.customCron.trim() || "17 3 * * 1" - default: - return null - } -} - function workflowExpression(value: string) { return "$" + "{{ " + value + " }}" } export function generateWorkflow(config: PrivacyConfig) { - const cron = cronFor(config) const permissions = config.commit ? "write" : "read" const token = config.includePrivate ? workflowExpression("secrets.CODE_LIFE_TOKEN") @@ -65,14 +47,6 @@ export function generateWorkflow(config: PrivacyConfig) { const username = config.username.trim() || workflowExpression("github.repository_owner") const formats = config.formats.length ? config.formats.join(",") : "svg" - const triggers = cron - ? `on: - workflow_dispatch: - schedule: - - cron: ${quoted(cron)}` - : `on: - workflow_dispatch:` - const upload = config.commit ? "" : ` @@ -85,7 +59,8 @@ export function generateWorkflow(config: PrivacyConfig) { return `name: Code Life Balance -${triggers} +on: + workflow_dispatch: permissions: contents: ${permissions} @@ -117,7 +92,8 @@ jobs: export function generateCliCommand(config: PrivacyConfig) { const args = [ - "pnpm cli --", + "npx --yes", + CLI_RELEASE_PACKAGE, config.username.trim() ? `--username ${shellQuote(config.username.trim())}` : "", `--timezone ${shellQuote(config.timeZone)}`, `--workday-start ${config.workdayStartHour}`, From 96a115f70e60a6c9139278cdcd406b9857b98a66 Mon Sep 17 00:00:00 2001 From: Ali HD <85040609+alihd-tech@users.noreply.github.com> Date: Tue, 22 Sep 2026 00:23:42 +0330 Subject: [PATCH 2/4] Remove automation controls and clarify CLI credentials --- components/privacy-configurator.tsx | 63 +++++++---------------------- 1 file changed, 15 insertions(+), 48 deletions(-) diff --git a/components/privacy-configurator.tsx b/components/privacy-configurator.tsx index 32e8020..766d174 100644 --- a/components/privacy-configurator.tsx +++ b/components/privacy-configurator.tsx @@ -7,7 +7,6 @@ import { type ReactNode, } from "react" import { - CalendarClock, Check, Clock3, Code2, @@ -95,10 +94,6 @@ export function PrivacyConfigurator() { const currentPreview = previewMode === "workflow" ? workflow : cli const privateMode = config.includePrivate - const scheduleLabel = - config.schedule === "manual" - ? "Manual" - : config.schedule.charAt(0).toUpperCase() + config.schedule.slice(1) return (
@@ -281,40 +276,6 @@ export function PrivacyConfigurator() {
- - - update("schedule", value as PrivacyConfig["schedule"]) - } - wrap - /> - - {config.schedule === "custom" && ( -
- - update("customCron", event.target.value)} - placeholder="17 3 * * 1" - className={fieldClass} - /> - -
- )} -
@@ -358,17 +319,12 @@ export function PrivacyConfigurator() { -
+
- - Private mode expects a fine-grained GitHub token stored as{" "} - CODE_LIFE_TOKEN. + {previewMode === "workflow" ? ( + <> + Private mode expects a fine-grained GitHub token stored as{" "} + CODE_LIFE_TOKEN. + + ) : ( + <> + Private CLI mode uses{" "} + GITHUB_TOKEN or your + existing gh auth login{" "} + session. + + )}
@@ -413,7 +380,7 @@ export function PrivacyConfigurator() { From 163e0519d74eaa5be391876cdaf36276db7de12e Mon Sep 17 00:00:00 2001 From: Ali HD <85040609+alihd-tech@users.noreply.github.com> Date: Tue, 22 Sep 2026 00:23:45 +0330 Subject: [PATCH 3/4] Document manual configurator workflows and release CLI --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cc6613b..697ba4a 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ Once the npm package is published, run without installing: npx code-life-balance --username octocat --timezone Europe/Helsinki ``` -For repository development, or before the npm package is published, use `pnpm cli --`. +Until the npm registry package is published, the web configurator uses the dependency-free CLI tarball attached to the stable GitHub release so its generated local command can run without cloning this repository. Repository contributors can still use `pnpm cli --`. Authenticate with GitHub CLI: @@ -96,7 +96,7 @@ The CLI prefers `GITHUB_TOKEN`, then `gh auth token`. Public analysis can run wi ### Web configurator -Open `/configure` in the web app to choose timezone, work hours, theme, card style, output formats, schedule, and private/public mode. The page only generates configuration and does not request a GitHub token. +Open `/configure` in the web app to choose timezone, work hours, theme, card style, output formats, and private/public mode. The generated GitHub Actions workflow is manual (`workflow_dispatch`) and the page does not request a GitHub token. ## Architecture From ae14fb6a341d422c18c24706dddc26dd1d42a27d Mon Sep 17 00:00:00 2001 From: Ali HD <85040609+alihd-tech@users.noreply.github.com> Date: Tue, 22 Sep 2026 00:24:06 +0330 Subject: [PATCH 4/4] Use stable release CLI in user-facing docs --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 697ba4a..2de744c 100644 --- a/README.md +++ b/README.md @@ -80,16 +80,16 @@ Authenticate with GitHub CLI: gh auth login ``` -Then run: +Then run the current stable CLI release directly: ```bash -pnpm cli -- --username octocat --timezone Europe/Helsinki +npx --yes https://github.com/alihd-tech/CodeLifeBalance/releases/download/v1.2.0/code-life-balance-1.2.0.tgz --username octocat --timezone Europe/Helsinki ``` Private mode stays on the local machine: ```bash -pnpm cli -- --include-private --timezone Europe/Helsinki +npx --yes https://github.com/alihd-tech/CodeLifeBalance/releases/download/v1.2.0/code-life-balance-1.2.0.tgz --include-private --timezone Europe/Helsinki ``` The CLI prefers `GITHUB_TOKEN`, then `gh auth token`. Public analysis can run without credentials when a username is supplied.