Skip to content

Add --non-interactive, --ignore, and --agents flags to packref init - #31

Merged
adelrodriguez merged 1 commit into
mainfrom
08-07-add_--non-interactive_--ignore_and_--agents_flags_to_packref_init_
Aug 7, 2026
Merged

Add --non-interactive, --ignore, and --agents flags to packref init#31
adelrodriguez merged 1 commit into
mainfrom
08-07-add_--non-interactive_--ignore_and_--agents_flags_to_packref_init_

Conversation

@adelrodriguez

Copy link
Copy Markdown
Collaborator

Adds a --non-interactive flag to packref init for use in automated and agent-driven environments. When passed, interactive prompts are skipped entirely and behavior is controlled by flags instead:

  • --ignore updates .gitignore and excludes .packref from TypeScript
  • --agents writes Packref guidance to AGENTS.md

Passing --ignore or --agents without --non-interactive exits with an error and a message directing users to the interactive flow. The intro line reflects the active mode when --non-interactive is set.

@adelrodriguez
adelrodriguez marked this pull request as ready for review August 7, 2026 15:38
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 812324bb-9143-4b11-b279-dba4495bcb64

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

adelrodriguez commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator Author

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 300ca312f5

ℹ️ 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".

@adelrodriguez
adelrodriguez force-pushed the 08-07-add_--non-interactive_--ignore_and_--agents_flags_to_packref_init_ branch from 300ca31 to 1d95c0c Compare August 7, 2026 15:47
@adelrodriguez
adelrodriguez force-pushed the 08-07-upgrade_to_node_24_and_bun_1.3.14_recommend_npx_packref_as_primary_cli_and_restructure_agent_docs branch from a59c1da to 235c601 Compare August 7, 2026 15:47
Base automatically changed from 08-07-upgrade_to_node_24_and_bun_1.3.14_recommend_npx_packref_as_primary_cli_and_restructure_agent_docs to main August 7, 2026 15:58
@adelrodriguez
adelrodriguez force-pushed the 08-07-add_--non-interactive_--ignore_and_--agents_flags_to_packref_init_ branch from 1d95c0c to 48562c5 Compare August 7, 2026 15:59
@adelrodriguez

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/commands/init.ts
Comment on lines +58 to +60
const shouldAddAgentsGuidance = nonInteractive
? agents
: yield* prompter.confirm({

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@adelrodriguez
adelrodriguez force-pushed the 08-07-add_--non-interactive_--ignore_and_--agents_flags_to_packref_init_ branch from 48562c5 to 25a6e95 Compare August 7, 2026 16:14
@adelrodriguez
adelrodriguez requested a lite review from Copilot August 7, 2026 16:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 --agents flags to packref init, and block --ignore/--agents unless --non-interactive is 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 an Effect. 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.

Comment thread src/commands/init.ts
Comment on lines 109 to +113
)

if (nonInteractive) {
return yield* new RequestedIntegrationError({ target: "tsconfig.json" })
}
Comment thread src/lib/core/errors.ts
@adelrodriguez
adelrodriguez force-pushed the 08-07-add_--non-interactive_--ignore_and_--agents_flags_to_packref_init_ branch from 25a6e95 to ff0f2f4 Compare August 7, 2026 16:26
@adelrodriguez
adelrodriguez merged commit 14f4563 into main Aug 7, 2026
7 checks passed
@adelrodriguez
adelrodriguez deleted the 08-07-add_--non-interactive_--ignore_and_--agents_flags_to_packref_init_ branch August 7, 2026 16:30
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.

2 participants