chore: maintenance pass, --version flag, AGENTS.md and 0.2.0 release prep - #12
Merged
Conversation
Add `-v` / `--version` to print the installed switcher version, read from package.json so it stays correct for global and local installs. The flag is consumed by the switcher (like `--help`); `-- --version` still forwards to Copilot CLI. Replace the raw `spawn ... ENOENT` failure with an actionable message naming the resolved executable path, the install command, and the COPILOT_BIN override. Drop a dead `platform` argument passed to buildCopilotSpawnOptions, which does not accept it, and consolidate the duplicated src/cli.mjs import in the test suite. Add tests for --help, --version, interactive provider selection, interactive model selection, and the missing-binary path (39 -> 45 tests, line coverage 87.3% -> 93.0%). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
- ESLint ignores `coverage/`, so linting after `npm run test:coverage` no longer depends on removing the report first. - `.gitignore` covers `*.tgz` (npm pack output) and `Thumbs.db`. - CI runs on pushes to `main` and `v*` tags, on pull requests, and on manual dispatch. Pull-request branches previously triggered two identical runs of the six-job matrix. Job names, and therefore the required status checks, are unchanged. - The issue-template security link points to SECURITY.md instead of a generic site URL. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
- Add AGENTS.md with the project-specific stack, repository layout, real commands, code conventions, non-negotiable secret-handling rules, the checklist for adding a built-in provider, the validation gate, and the protected-branch release process. - README: document every CLI option (including --version), add the project structure, release process, contributing, security, changelog and license sections, and add Node engine and license badges. - Bump to 0.2.0 (backward-compatible feature) and keep package.json, package-lock.json, CITATION.cff, CHANGELOG.md and the pinned README versions in sync. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Maintenance pass on the launcher: one small user-facing feature, an actionable failure message, tooling/CI tidy-up, project documentation for contributors and AI agents, and the 0.2.0 version bump. No breaking changes.
Changes
CLI (
src/)-v/--version, printing the installed version read frompackage.json(correct for global, local, andnpm linkinstalls). The flag is consumed by the switcher, like--help;-- --versionstill forwards to Copilot CLI.spawn ... ENOENTfailure with a message naming the resolved executable path, thenpm install -g @github/copilotcommand, and theCOPILOT_BINoverride.platformargument passed tobuildCopilotSpawnOptions, which does not accept it.Tests
--help,--version, interactive provider selection, interactive model selection, and the missing-binary path.src/cli.mjs63.8% → 87.3%).src/cli.mjsimport intest/cli.test.mjs.Tooling / CI
coverage/, so linting afternpm run test:coverageno longer depends on removing the report first..gitignorecovers*.tgz(npm pack output) andThumbs.db.mainandv*tags, on pull requests, and onworkflow_dispatch. Pull-request branches previously ran the six-job matrix twice. Job names are unchanged, so the required status checks still match.SECURITY.mdinstead of a generic site URL.Documentation
AGENTS.md: stack, repository layout, real commands, code conventions, non-negotiable secret-handling rules, the checklist for adding a built-in provider, the validation gate, generated files, and the protected-branch release process.README.md: full command-line option table (including--version), project structure, release process, contributing, security, changelog and license sections, Node engine and license badges, and refreshed pinned install versions.CHANGELOG.md: 0.2.0 entry.Versioning
package.json,package-lock.json,CITATION.cff,CHANGELOG.md, and the pinned README versions are all in sync.Testing
npm run lint && npm testpasses — 45/45, 0 failures--dry-runagainst the built-in Chutes preset from the packed tarball;COPILOT_PROVIDER_API_KEYcorrectly rendered as<redacted>. No live inference call was made.Additional verification:
npm audit --omit=dev --audit-level=high→ 0 vulnerabilities (also 0 including dev dependencies).npm pack→copilot-byok-switcher-0.2.0.tgz, 20.4 kB, 16 files. Contents verified:bin/,src/,examples/,docs/,schemas/,package.json,README.md,CHANGELOG.md,SECURITY.md,LICENSE. No tests, nonode_modules, no.env, no local configuration.copilot-byok --version→0.2.0,--helpand--dry-runbehave as documented.Checklist
Notes
--versionand-vare now consumed by the switcher instead of being forwarded to Copilot CLI. Use-- --versionto reach Copilot's own flag. This matches how--help/-halready behaved.npm publish,git tag v0.2.0,git push origin v0.2.0, and a GitHub Release forv0.2.0.🤖 Generated with Claude Code