From 4d0f00afdc01e1e19324f9493d13eca61ac458b4 Mon Sep 17 00:00:00 2001 From: "Joakim L. Engeset" Date: Fri, 30 Jan 2026 16:21:38 +0100 Subject: [PATCH 1/2] chore: remove test-targets from makefile --- Makefile | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/Makefile b/Makefile index c20030ad..2b8d4a04 100644 --- a/Makefile +++ b/Makefile @@ -54,16 +54,3 @@ clean-all: clean .PHONY: upgrade-deps upgrade-deps: npm run upgrade-deps - -# Manual test targets (requires CALS_GITHUB_TOKEN env var) -.PHONY: test-repos -test-repos: - CALS_GITHUB_TOKEN=$(CALS_GITHUB_TOKEN) node lib/cals-cli.mjs repos --org capralifecycle --compact - -.PHONY: test-clone -test-clone: - CALS_GITHUB_TOKEN=$(CALS_GITHUB_TOKEN) node lib/cals-cli.mjs clone --org capralifecycle --all | head -5 - -.PHONY: test-help -test-help: - node lib/cals-cli.mjs --help From 947c7d02fbe7ccce33027e36856301f5207cf63e Mon Sep 17 00:00:00 2001 From: "Joakim L. Engeset" Date: Fri, 30 Jan 2026 16:23:06 +0100 Subject: [PATCH 2/2] feat: use GITHUB_TOKEN env var instead of CALS_GITHUB_TOKEN --- src/cli/index.ts | 5 +++-- src/cli/util.ts | 2 +- src/github/token.ts | 8 +++----- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/cli/index.ts b/src/cli/index.ts index 36b943e8..4ff5491c 100644 --- a/src/cli/index.ts +++ b/src/cli/index.ts @@ -56,9 +56,10 @@ Before using, authenticate with: cals auth`) .command(topics) .version(version) .demandCommand() - .option("no-cache", { - describe: "Bypass cache and fetch fresh data", + .option("cache", { + describe: "Use cached data", type: "boolean", + default: true, }) .example("cals auth", "Set GitHub token") .example("cals repos", "List repositories") diff --git a/src/cli/util.ts b/src/cli/util.ts index ef09d26d..ee725307 100644 --- a/src/cli/util.ts +++ b/src/cli/util.ts @@ -12,7 +12,7 @@ export function createCacheProvider( ): CacheProvider { const cache = new CacheProvider(config) - if (argv.noCache === true) { + if (argv.cache === false) { cache.mustValidate = true } diff --git a/src/github/token.ts b/src/github/token.ts index b6140cc3..4f925013 100644 --- a/src/github/token.ts +++ b/src/github/token.ts @@ -11,8 +11,8 @@ export class GitHubTokenCliProvider implements GitHubTokenProvider { private keyringAccount = "github-token" async getToken(): Promise { - if (process.env.CALS_GITHUB_TOKEN) { - return process.env.CALS_GITHUB_TOKEN + if (process.env.GITHUB_TOKEN) { + return process.env.GITHUB_TOKEN } const result = await keytar.getPassword( @@ -20,9 +20,7 @@ export class GitHubTokenCliProvider implements GitHubTokenProvider { this.keyringAccount, ) if (result == null) { - process.stderr.write( - "No token found. Register using `cals github set-token`\n", - ) + process.stderr.write("No token found. Register using `cals auth`\n") return undefined }