Skip to content

Conversation

@agusayerza
Copy link
Contributor

@agusayerza agusayerza commented Jan 16, 2026

Description: This PR updates the CLI to dynamically fetch available environments from the server when prompting the user, instead of relying solely on hardcoded defaults.
Changes:

  • Added GET /api/v1/environments endpoint to the server to list environments for the current account.
  • Updated CLI utils.ts to include getEnvironments function.
  • Updated interactive.service.ts to use getEnvironments to populate the environment selection prompt.
  • Updated ensure.service.ts to integrate with the updated prompt logic.

Another alternative would have been to use the GetMeta endpoint to get the environments, but decided to add an endpoint specifically to get them instead.

NAN-4556


The CLI now falls back to the previous hardcoded environment list and logs a warning if the API call fails or returns nothing, the integration coverage verifies the endpoint requires authentication and scopes results to the caller’s account, and an optional debug flag lets Ensure.environment() surface request diagnostics during prompts.


This summary was automatically generated by @propel-code-bot

@linear
Copy link

linear bot commented Jan 16, 2026

@my-senior-dev-pr-review
Copy link

🤖 My Senior Dev — Analysis Complete

👤 For @agusayerza

📁 Expert in packages/ (20 edits) • ⚡ 4th PR this month

View your contributor analytics →


📊 9 files reviewed • 2 need attention

⚠️ Needs Attention:

  • packages/cli/lib/index.ts — Modifications allow dynamic fetching of environments; requires scrutiny for security checks and potential impacts on existing command behavior.

🚀 Open Interactive Review →

The full interface unlocks features not available in GitHub:

  • 💬 AI Chat — Ask questions on any file, get context-aware answers
  • 🔍 Smart Hovers — See symbol definitions and usage without leaving the diff
  • 📚 Code Archeology — Understand how files evolved over time (/archeology)
  • 🎯 Learning Insights — See how this PR compares to similar changes

💬 Chat here: @my-senior-dev explain this change — or try @chaos-monkey @security-auditor @optimizer @skeptic @junior-dev

📖 View all 12 personas & slash commands

You can interact with me by mentioning @my-senior-dev in any comment:

In PR comments or on any line of code:

  • Ask questions about the code or PR
  • Request explanations of specific changes
  • Get suggestions for improvements

Slash commands:

  • /help — Show all available commands
  • /archeology — See the history and evolution of changed files
  • /profile — Performance analysis and suggestions
  • /expertise — Find who knows this code best
  • /personas — List all available AI personas

AI Personas (mention to get their perspective):

Persona Focus
@chaos-monkey 🐵 Edge cases & failure scenarios
@skeptic 🤨 Challenge assumptions
@optimizer Performance & efficiency
@security-auditor 🔒 Security vulnerabilities
@accessibility-advocate Inclusive design
@junior-dev 🌱 Simple explanations
@tech-debt-collector 💳 Code quality & shortcuts
@ux-champion 🎨 User experience
@devops-engineer 🚀 Deployment & scaling
@documentation-nazi 📚 Documentation gaps
@legacy-whisperer 🏛️ Working with existing code
@test-driven-purist Testing & TDD

For the best experience, view this PR on myseniordev.com — includes AI chat, file annotations, and interactive reviews.

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