Skip to content

feat(environments): add the launch:env commands — list, get, create, update, delete - #241

Merged
SakshiKoli-CS merged 8 commits into
v2-devfrom
cl-7168
Oct 16, 2026
Merged

SakshiKoli-CS merged 8 commits into
v2-devfrom
cl-7168

Conversation

@SakshiKoli-CS

Copy link
Copy Markdown
Contributor

Ticket: CL-7168

What

Adds the V2 environment commands under the launch:env topic:

  • launch:env:list pages through a project's environments and shows each one's first domain that has a URL.
  • launch:env:get shows one environment, with its organization, the resolved project, created/updated dates, and its variables as a count only.
  • launch:env:create creates an environment and follows its first deployment. It looks for the deployment up to three times.
  • launch:env:update changes name, description, branch, auto-deploy, cache priming, response mode and password protection. On a terminal with no flags, it asks which settings to change. The password is only ever asked for with a masked prompt.
  • launch:env:delete deletes an environment, asking first or requiring --yes without a terminal.

Supporting changes:

  • --env input: resolves a name to its uid, with a picker on a terminal.
  • Shared helpers:
    • One name-to-uid lookup for every resource.
    • One untilFound helper.
    • One message for a failed first deployment.
  • Prompts:
    • New askChoices checkbox prompt.
    • Choice prompts no longer wrap around, and short lists show whole.
    • Ctrl-C at a list or checkbox prompt exits 3.
  • --branch / --auto-deploy on a FileUpload project: these now print a warning instead of refusing.
  • -u / -p without --password-protection enable: refused before any API call.
  • 409 from env:update: the empty 409 the endpoint really sends is reported as "name already taken".
  • Test passwords: the env:update tests now generate their passwords at runtime.
  • Talisman: checksums added for the changed files. The flagged text is flag names and test wording, not credentials.

Tests

  • npm test: 113 suites, 2001 tests pass.
  • npm run build and npm run lint pass.
  • Talisman passes over the full v2-dev...cl-7168 range.

#claude_code#
🤖 Generated with Claude Code

Copilot AI lite review requested due to automatic review settings October 14, 2026 11:27
@SakshiKoli-CS
SakshiKoli-CS requested a review from a team as a code owner October 14, 2026 11:27
@snyk-io

snyk-io Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 20 0 25 ✅ Passed
🟡 Medium Severity 12 3 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ Vulnerabilities Without Available Fixes (Informational Only)

The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:

  • Critical without fixes: 0
  • High without fixes: 0
  • Medium without fixes: 3
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

@gitguardian

gitguardian Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

️✅ There are no secrets present in this pull request anymore.

If these secrets were true positive and are still valid, we highly recommend you to revoke them.
While these secrets were previously flagged, we no longer have a reference to the
specific commits where they were detected. Once a secret has been leaked into a git
repository, you should consider it compromised, even if it was deleted immediately.
Find here more information about risks.


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

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.

🟡 Changes recommended

Three moderate findings remain unresolved in prompt cancellation, absent-value rendering, and framework/server-command validation.

1 open finding
What changed in this PR

Adds the launch:env command suite for listing, retrieving, creating, updating, and deleting environments, with shared lookup, paging, prompting, deployment, and documentation support.

Changes:

  • Adds environment lifecycle commands and API integrations.
  • Adds shared resource resolution, prompts, paging, and deployment helpers.
  • Expands tests, fixtures, command metadata, documentation, and Talisman checksums.

Review findings remain in:

  • src/core/prompt.ts: dismissed checkbox prompts should cancel with exit 3.
  • src/environments/environment.presenter.ts: list output should use absent-value handling.
  • src/environments/environment.update.ts: validate the effective framework when serverCmd is selected.
File Description
test/​integration/​retired-commands.test.ts Updates retired command replacements.
test/​integration/​projects-paging.test.ts Uses shared resource references.
test/​integration/​oclif-manifest.test.ts Tests environment topic metadata.
test/​integration/​environments-update.test.ts Tests environment updates end to end.
test/​integration/​environments-list-command.test.ts Tests listing and retrieval flows.
test/​integration/​environments-delete.test.ts Tests deletion flows.
test/​integration/​environments-create.test.ts Tests creation and deployment following.
test/​guards/​layering.test.ts Updates resource layering rules.
test/​fixtures/​README.md Documents environment fixtures.
test/​fixtures/​environments-list.json Adds list fixture.
test/​fixtures/​environment-not-found.json Adds not-found fixture.
test/​fixtures/​environment-get.json Adds get fixture.
src/​resources.ts Registers environment dependencies.
src/​resources.test.ts Tests dependency registration.
src/​projects/​projects.api.ts Reuses shared paging.
src/​projects/​project.source.ts Updates prompt helper imports.
src/​projects/​project.resolver.ts Uses shared name lookup.
src/​projects/​project.resolver.test.ts Updates resolver tests.
src/​projects/​project.presenter.ts Reuses deployment failure wording.
src/​projects/​project.inputs.ts Uses shared resource references.
src/​projects/​project.inputs.test.ts Updates input prompt expectations.
src/​projects/​project.follow.ts Uses shared deployment lookup.
src/​projects/​project.create.ts Applies shared environment rules.
src/​projects/​project-ref.ts Removes project-specific reference helper.
src/​projects/​project-ref.test.ts Removes obsolete helper tests.
src/​git/​git.prompt.test.ts Updates branch picker expectations.
src/​environments/​types.ts Adds environment models.
src/​environments/​environments.api.ts Adds environment API operations.
src/​environments/​environment.update.ts Implements environment updates.
src/​environments/​environment.update.prompt.ts Implements update prompts.
src/​environments/​environment.update.prompt.test.ts Tests update prompts.
src/​environments/​environment.rules.ts Adds repository-only rules.
src/​environments/​environment.resolver.ts Resolves environment names.
src/​environments/​environment.resolver.test.ts Tests environment resolution.
src/​environments/​environment.prompt.ts Adds environment picker.
src/​environments/​environment.prompt.test.ts Tests environment prompting.
src/​environments/​environment.presenter.ts Adds environment rendering.
src/​environments/​environment.presenter.test.ts Tests presentation.
src/​environments/​environment.inputs.ts Adds environment flags and resolution.
src/​environments/​environment.inputs.test.ts Tests environment inputs.
src/​environments/​environment.errors.ts Adds environment error wording.
src/​environments/​environment.create.ts Implements creation and deployment following.
src/​environments/​environment.builder.ts Exposes framework labeling.
src/​deployments/​deployment.presenter.ts Adds shared failure wording.
src/​deployments/​deployment.presenter.test.ts Tests failure messages.
src/​deployments/​deployment.lookup.ts Adds bounded deployment lookup retries.
src/​deployments/​deployment.lookup.test.ts Tests lookup retries.
src/​core/​resource-ref.ts Adds shared resource references.
src/​core/​resource-ref.test.ts Tests resource references.
src/​core/​prompt.ts Adds secret, checkbox, and input helpers.
src/​core/​prompt.test.ts Tests prompt helpers.
src/​core/​paging.ts Adds shared page scanning.
src/​core/​paging.test.ts Tests page scanning.
src/​core/​name-lookup.ts Adds shared name-to-UID lookup.
src/​core/​name-lookup.test.ts Tests shared lookup.
src/​core/​interruptible-ux.ts Improves cancellation handling.
src/​core/​interruptible-ux.test.ts Tests interrupt handling.
src/​commands/​launch/​index.ts Updates command replacements.
src/​commands/​launch/​environments/​index.ts Updates retired environment wording.
src/​commands/​launch/​env/​update.ts Adds update command wiring.
src/​commands/​launch/​env/​update.test.ts Tests update command wiring.
src/​commands/​launch/​env/​list.ts Adds list command.
src/​commands/​launch/​env/​list.test.ts Tests list command.
src/​commands/​launch/​env/​get.ts Adds get command.
src/​commands/​launch/​env/​get.test.ts Tests get command.
src/​commands/​launch/​env/​delete.ts Adds delete command.
src/​commands/​launch/​env/​delete.test.ts Tests delete command.
src/​commands/​launch/​env/​create.ts Adds create command.
src/​commands/​launch/​env/​create.test.ts Tests create command wiring.
README.md Documents environment commands.
package.json Registers topic and commands.
.talismanrc Updates checksums and allowlists.

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/environments/environment.presenter.ts Outdated
@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 20 0 25 ✅ Passed
🟡 Medium Severity 12 3 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ Vulnerabilities Without Available Fixes (Informational Only)

The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:

  • Critical without fixes: 0
  • High without fixes: 0
  • Medium without fixes: 3
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 24 0 25 ✅ Passed
🟡 Medium Severity 12 3 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ Vulnerabilities Without Available Fixes (Informational Only)

The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:

  • Critical without fixes: 0
  • High without fixes: 0
  • Medium without fixes: 3
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

SakshiKoli-CS and others added 8 commits October 16, 2026 12:09
… lookup across resources

Moves the name-to-uid lookup, cursor paging and resource references out of the
projects module into core so environments can reuse them. Adds askChoices (a
checkbox prompt) and scrolling choice prompts that do not wrap round, show short
lists whole, and refuse an empty checklist. Ctrl-C at a list or checkbox prompt
now exits 3 rather than 130. Adds readPipedInput for secrets piped on stdin, the
deployment lookup that retries the first deployment, and a branch picker that
lists the pre-selected branch first. The Talisman checksums for every file the
launch:env work touches are recorded here.

#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Harshi Shah <harshi.shah@contentstack.com>
Projects now use the shared name lookup, paging, resource reference and
deployment lookup, and warn about --branch / --auto-deploy on a FileUpload
project through the shared helper. The project-only reference helper is removed.

#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Harshi Shah <harshi.shah@contentstack.com>
…picker and presenter

EnvironmentsApi gains get, paged list, create, update and delete. Adds the --env
input with its name-to-uid resolver and picker, the environment presenter (the
agreed env:get rows, the list columns with absent-value placeholders), the
repository-only rules and the controller-shaped fixtures. An empty 409 from
update is read as a taken name only when the name was changed.

#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Harshi Shah <harshi.shah@contentstack.com>
Lists a project's environments and shows one environment. Registers the
launch:env topic and command ids, describes the topic and points the retired environment commands at their
replacements.

#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Harshi Shah <harshi.shah@contentstack.com>
Creates an environment and follows its first deployment, ending on the live
announcement without a detail table. --help states the same name and
description limits the flags enforce.

#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Harshi Shah <harshi.shah@contentstack.com>
Updates an environment from flags, or from a settings checklist when no flag is
given on a terminal. Refuses -u / -p without --password-protection enable before
any request, and without a terminal reads the password for -p from standard
input. Warns about and ignores --branch / --auto-deploy on a FileUpload project.

#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Harshi Shah <harshi.shah@contentstack.com>
Deletes an environment after a confirmation.

#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Harshi Shah <harshi.shah@contentstack.com>
Documents the launch:env commands, the stdin -p, and the SIGINT handling, and
regenerates the README command reference.

#claude_code#
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Harshi Shah <harshi.shah@contentstack.com>
@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 24 0 25 ✅ Passed
🟡 Medium Severity 12 3 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ Vulnerabilities Without Available Fixes (Informational Only)

The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:

  • Critical without fixes: 0
  • High without fixes: 0
  • Medium without fixes: 3
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

@SakshiKoli-CS

Copy link
Copy Markdown
Contributor Author

/ship 2b summary — Fixed: blank launch:env:list columns now render the - placeholder (r4270202236, thread resolved; the exact commit is 00ee61c-line feat(environments): add the environments API… after the rewrite).
Resolved (Copilot review body, already handled on the branch):

  • Dismissed checkbox prompts should cancel with exit 3 — done: Ctrl-C at a list or checkbox prompt raises CancelledError (exit 3), see src/core/interruptible-ux.ts and its test.
  • Validate the effective framework when serverCmd is selected — done: --server-cmd with --framework is gated by serverCommandFrameworkGate (environment.inputs.ts), and without --framework environment.update.ts checks the environment's current framework before any request.
    Left for human: none.

History: per the author's request the 52 work-in-progress commits (incl. Talisman checksum refreshes) were folded into 8 logical Conventional Commits — final tree is identical apart from the two refreshed presenter checksums. Next: needs a reviewer approval.

@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 24 0 25 ✅ Passed
🟡 Medium Severity 12 3 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ Vulnerabilities Without Available Fixes (Informational Only)

The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:

  • Critical without fixes: 0
  • High without fixes: 0
  • Medium without fixes: 3
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

@SakshiKoli-CS
SakshiKoli-CS merged commit ce75c13 into v2-dev Oct 16, 2026
7 checks passed
@SakshiKoli-CS
SakshiKoli-CS deleted the cl-7168 branch October 16, 2026 07:06
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.

4 participants