Skip to content

feat: add apiops configure command for guided filter & override config generation - #181

Closed
EMaher with Copilot wants to merge 2 commits into
mainfrom
copilot/add-interactive-prompt-setup
Closed

feat: add apiops configure command for guided filter & override config generation#181
EMaher with Copilot wants to merge 2 commits into
mainfrom
copilot/add-interactive-prompt-setup

Conversation

Copilot AI commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

After apiops extract, there was no guided path for producing configuration.extractor.yaml or per-environment override files — users had to author them from scratch with deep schema knowledge.

New command: apiops configure

Scans extracted artifacts, then either interactively guides the user or applies best-effort defaults to produce:

  • configuration.extractor.yaml — API filter (selected or all)
  • configuration.<env>.yaml — per-environment overrides (one per --environments value)
# Interactive (default when TTY detected)
apiops configure

# Non-interactive, custom environments
apiops configure --non-interactive --environments dev,staging,prod

New / changed files

Core implementation

  • src/services/artifact-scanner.ts — scans artifact dir for APIs (strips ;rev=N duplicates), secret named values, backend URLs, loggers, products
  • src/services/configure-service.ts — orchestrates scan → gather (interactive or defaults) → write files; conflict detection with --force escape hatch
  • src/cli/configure-command.ts — Commander command (--artifact-dir, --environments, --output, --non-interactive, --force)

Prompt service extensions (src/services/prompt-service.ts)

  • askApiFilter — multi-select from discovered API names
  • askSecretTokenName — token name per secret named value per environment
  • askBackendUrl — URL override per backend per environment
  • askYesNo — generic yes/no with configurable default

Model (src/models/config.ts) — added ConfigureConfig interface

Non-interactive defaults

  • All APIs included in filter
  • Each secret: true named value → {#[TOKEN_NAME]#} placeholder (name uppercased, punctuation → _)
  • No backend URL overrides written (user edits manually)

Documentation & contracts

  • docs/commands/configure.md — full usage docs with onboarding flow diagram
  • specs/contracts/cli-commands.md — command contract

… setup

Adds the `apiops configure` command that scans extracted APIM artifacts
and generates filter + per-environment override configuration files with
an interactive guided experience.

New files:
- src/cli/configure-command.ts
- src/services/artifact-scanner.ts
- src/services/configure-service.ts
- docs/commands/configure.md
- tests/unit/cli/configure-command.test.ts
- tests/unit/services/artifact-scanner.test.ts
- tests/unit/services/configure-service.test.ts

Modified files:
- src/models/config.ts (ConfigureConfig interface)
- src/services/prompt-service.ts (new configure prompts)
- src/cli/index.ts (register configure command)
- specs/contracts/cli-commands.md (configure contract)
- specs/tasks.md (Phase 6b tasks)

Closes #120
Copilot AI changed the title [WIP] Add interactive prompt for configuration file setup feat: add apiops configure command for guided filter & override config generation Jun 22, 2026
Copilot AI requested a review from EMaher June 22, 2026 18:47
@EMaher

EMaher commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Opted to create prompt files to help create overrides and extraction filter files. See #183

@EMaher EMaher closed this Jul 1, 2026
@EMaher EMaher added the close:wont-fix Will not be addressed label Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

close:wont-fix Will not be addressed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants