Add --non-interactive, --ignore, and --agents flags to packref init - #31
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
300ca31 to
1d95c0c
Compare
a59c1da to
235c601
Compare
1d95c0c to
48562c5
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 48562c507c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const shouldAddAgentsGuidance = nonInteractive | ||
| ? agents | ||
| : yield* prompter.confirm({ |
There was a problem hiding this comment.
Return an error when a requested integration is not applied
When --non-interactive --agents runs in a project that has an incomplete PACKREF marker, writeAgentsSection returns "malformed", but the handler only prints a warning and exits with code 0. The same problem occurs for --ignore when tsconfig.json is malformed. Thus, an unattended caller can treat the explicit setup request as successful although part of it was not applied. Return a nonzero exit code when a requested non-interactive integration cannot be completed.
Useful? React with 👍 / 👎.
48562c5 to
25a6e95
Compare
There was a problem hiding this comment.
Pull request overview
This pull request adds a non-interactive mode to packref init so automated tools and coding agents can run setup without prompts. It also adds flags to request specific integrations and to fail with a nonzero exit code when a requested integration cannot complete.
Changes:
- Add
--non-interactive,--ignore, and--agentsflags topackref init, and block--ignore/--agentsunless--non-interactiveis set. - Add a dedicated error type for “requested integration could not complete”, and document the new mode in CLI help and README.
- Add tests for non-interactive flows and add Changesets for the new behavior.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/lib/core/errors.ts | Add RequestedIntegrationError for non-interactive integration failures. |
| src/commands/init.ts | Add non-interactive flag handling and integrate failure behavior for requested integrations. |
| src/commands/tests/init.test.ts | Add coverage for non-interactive success and failure cases. |
| src/commands/tests/help.test.ts | Assert the new init flags appear in --help output. |
| README.md | Document non-interactive agent setup usage and examples. |
| .changeset/eleven-rabbits-share.md | Patch changeset for adding non-interactive init. |
| .changeset/bumpy-years-grab.md | Patch changeset for failing when requested integrations cannot complete. |
Suppressed comments (1)
src/commands/init.ts:132
- Same issue as above.
yield*must yield anEffect. Return a failed effect so the command exits with a nonzero status in non-interactive mode.
)
if (nonInteractive) {
return yield* new RequestedIntegrationError({ target: "AGENTS.md" })
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ) | ||
|
|
||
| if (nonInteractive) { | ||
| return yield* new RequestedIntegrationError({ target: "tsconfig.json" }) | ||
| } |
25a6e95 to
ff0f2f4
Compare

Adds a
--non-interactiveflag topackref initfor use in automated and agent-driven environments. When passed, interactive prompts are skipped entirely and behavior is controlled by flags instead:--ignoreupdates.gitignoreand excludes.packreffrom TypeScript--agentswrites Packref guidance toAGENTS.mdPassing
--ignoreor--agentswithout--non-interactiveexits with an error and a message directing users to the interactive flow. The intro line reflects the active mode when--non-interactiveis set.