Add non-interactive CLI flags, tests, CI, and --version flag - #22
Merged
Conversation
Adds --project, --author, --email, --remote, --yes and --help flags (parsed via node:util parseArgs, no new dependency) so create-startr can be driven without a TTY, e.g. by Claude Code or other coding agents. When --project/--author/--email are all supplied, prompts are skipped entirely; --yes skips the confirmation step. In a non-interactive shell, missing required flags now fail fast with a clear error instead of hanging on stdin, and the confirmation step refuses to wait for input unless --yes is passed. Also fixes the catch block to exit 1 on failure — previously the process always exited 0 even when scaffolding failed, which is wrong for anything scripting against this CLI. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adds coverage for the non-interactive CLI paths added in the previous commit (help/version output, missing-flag failures, validation errors, and the confirmation-refusal-without-yes path) using Node's built-in test runner via `npm test`, so this doesn't add a test-framework dependency. Adds a GitHub Actions workflow that runs those tests plus `npm audit --audit-level=high` on every push/PR, so dependency vulnerabilities like the simple-git RCE fixed in #21 get caught automatically going forward instead of requiring a manual audit. Also adds a --version/-v flag (reads package.json via createRequire since this is an ESM module) and an explicit "engines": { "node": ">=22" } in package.json, formalizing the Node version requirement the README already documented. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This was referenced Jul 26, 2026
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
--project,--author,--email,--remote,--yes,--help, and--versionflags (parsed with the built-innode:utilparseArgs— no new dependency) socreate-startrcan run without a TTY.--project,--author, and--emailare all supplied, the interactive prompts are skipped entirely;--yesskips the confirmation step. This is the intended entry point for Claude Code or other coding agents to scaffold a project directly.prompts()waiting for stdin that will never arrive. Similarly, the confirmation step refuses to block on input unless--yesis passed.catchblock to callprocess.exit(1)on failure — previously the process always exited0even when scaffolding failed partway through, which breaks any script/agent relying on the exit code to detect success.Added in a follow-up commit:
--help,--version, missing/partial flags, validation errors, confirmation-refusal) using Node's built-in test runner (node --test, wired tonpm test) — no new test-framework dependency..github/workflows/ci.yml) that runs the test suite andnpm audit --audit-level=highon every push/PR, so dependency vulnerabilities like thesimple-gitcritical RCE fixed in Fix npm audit vulnerabilities #21 get caught automatically going forward.engines: { node: ">=22" }field inpackage.json, formalizing the Node version requirement the README already documented.Test plan
--help/--versionprint expected output and exit 0--project/--author/--emailvalues → validation error, exit 1--yesin non-TTY → refuses to hang, exit 1 with a clear message--project --author --email --yes) → clones, rewritesconfig.R/README.md, renames.Rproj, removesDESCRIPTION, exits 0 — verified end to end against a real clonenpm test→ 8/8 passingnpm audit --audit-level=high→ 0 vulnerabilities🤖 Generated with Claude Code