Skip to content

feat: CLI with generate/publish/init, GitHub Releases, integration tests#3

Merged
hermanngeorge15 merged 12 commits into
mainfrom
feat/cli-release
Apr 1, 2026
Merged

feat: CLI with generate/publish/init, GitHub Releases, integration tests#3
hermanngeorge15 merged 12 commits into
mainfrom
feat/cli-release

Conversation

@hermanngeorge15
Copy link
Copy Markdown
Contributor

Summary

  • Task 9: GitHub Releases integration (src/github.ts) with mock-based tests (3 tests)
  • Task 10: Full CLI replacing stub entry point — generate, publish, init commands with GSD fallback to commit type grouping, --output prepend behavior, and --to version label detection
  • Task 11: CLI integration tests (7 tests via execa) and full README with problem statement, installation, usage examples, output format samples, configuration, and exit codes

Key decisions implemented

  • GitHub auth: GITHUB_TOKEN env var only, no gh CLI fallback
  • Output prepend: --output prepends new version on top of existing file content
  • GSD fallback: If no .planning/ dir exists, warn and group by commit type
  • Version label: Uses --to value as version when it's not "HEAD"

Test plan

  • 3 GitHub Releases tests (mock-based, covers success, empty token, invalid repo)
  • 7 CLI integration tests (help, version, generate, technical format, file output, init, version label)
  • All 58 tests pass (48 existing + 10 new)
  • npm run format — clean
  • npm run lint — clean
  • npm run build — clean
  • Smoke test: node dist/index.js generate --to HEAD works
  • Smoke test: node dist/index.js generate --to HEAD --format technical works
  • Smoke test: node dist/index.js --help shows all commands

🤖 Generated with Claude Code

hermanngeorge15 and others added 12 commits April 1, 2026 14:54
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Implements the changelog generator (Task 7) with product and technical
Handlebars templates. Templates are inlined as string constants to avoid
__dirname/fileURLToPath issues in tsup bundles. Registers eq, hasItems,
and filterByType Handlebars helpers. Supports custom template paths via
config. Also fixes pre-existing simpleGit import issue in git.ts and
adds .prettierignore for .hbs files.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Implements config loader (Task 8) with loadConfig() and initConfig().
loadConfig() reads ai-changelog.config.json from a given directory and
merges with defaults. initConfig() creates the config file with default
values, creating parent directories as needed. Uses rmSync (not
deprecated rmdirSync) for test cleanup.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
TDD implementation of createGithubRelease() using @octokit/rest.
GITHUB_TOKEN env var only, no gh CLI fallback.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Full CLI replacing stub entry point. Includes:
- generate: changelog from git history with GSD fallback to commit type grouping
- publish: push changelog to GitHub Releases
- init: create config file
- --output prepends new version on top of existing file
- --to value used as version label when not HEAD

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
7 CLI integration tests covering help, version, generate, technical format,
file output, init, and version label from --to flag. README updated with
problem statement, installation, usage, output format examples, GSD
integration, configuration, and exit codes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@hermanngeorge15 hermanngeorge15 merged commit 279ce3b into main Apr 1, 2026
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant