Skip to content

feat: add channel list, view, and delete commands - #609

Open
NickJosevski wants to merge 1 commit into
mainfrom
nj/channel-list-view-delete
Open

feat: add channel list, view, and delete commands#609
NickJosevski wants to merge 1 commit into
mainfrom
nj/channel-list-view-delete

Conversation

@NickJosevski

@NickJosevski NickJosevski commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Adds three subcommands to octopus channel:

  • list — list a project's channels. Takes the project positionally or via -p/--project, with --filter/-q for name filtering.
  • view — view a channel by name or ID. Resolves the lifecycle name and shows version rules, Git reference/resource rules, tenant tags, custom field definitions and ephemeral-environment settings. Supports --web.
  • delete — delete a channel by name or ID. Confirmation prompt in interactive mode, -y/--confirm for automation.

All three support table/json/basic output and prompt for the project when it isn't supplied.

Notes

  • Config-as-Code: delete warns in interactive mode when the project is version-controlled — the server does not guard against deleting a channel an OCL deployment references.
  • Lookup scoping: view and delete resolve the channel through a shared helper that falls back to a project-scoped lookup, so an ID belonging to another project is never used.
  • No slug lookup: the server does not resolve channel slugs on the by-ID route, and go-octopusdeploy v2.108.0 doesn't expose Slug on channels.Channel. Both commands accept name or ID only; surfacing slugs needs an SDK bump.
  • view vs create: view is read-only and shows fields channel create cannot yet set. Extending create (and adding update) is a follow-up, not part of this PR.

Adds three subcommands to `octopus channel`:

- `list` — list a project's channels, with `--filter`/`-q` name filtering.
  Takes the project positionally or via `-p/--project`.
- `view` — view a channel by name or ID, resolving the lifecycle name and
  surfacing version rules, Git reference/resource rules, tenant tags, custom
  field definitions and ephemeral-environment settings. Supports `--web`.
- `delete` — delete a channel by name or ID, with a confirmation prompt in
  interactive mode and `-y/--confirm` for automation.

All three support the standard table/json/basic output formats, prompt for the
project when it isn't supplied, and resolve the channel through a shared
helper that keeps lookups scoped to the requested project.

`delete` warns in interactive mode when the project is version-controlled,
since the server does not guard against deleting a channel referenced by OCL
deployments.

`view` is read-only and deliberately shows fields `channel create` cannot yet
set; extending create (and adding update) is left to a follow-up.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

1 participant