From dcfd6d6f730c9560b8558680cf9577437dbdaeee Mon Sep 17 00:00:00 2001 From: Danny Kopping Date: Wed, 29 Oct 2025 07:36:08 -0600 Subject: [PATCH] chore: graduate `aibridge` cli out of experimental (#20524) --- docs/manifest.json | 15 ++++ docs/reference/cli/aibridge.md | 16 +++++ docs/reference/cli/aibridge_interceptions.md | 16 +++++ .../cli/aibridge_interceptions_list.md | 69 +++++++++++++++++++ docs/reference/cli/index.md | 1 + .../cli/{exp_aibridge.go => aibridge.go} | 3 +- ...{exp_aibridge_test.go => aibridge_test.go} | 3 - enterprise/cli/root.go | 7 +- enterprise/cli/testdata/coder_--help.golden | 1 + .../cli/testdata/coder_aibridge_--help.golden | 12 ++++ ...coder_aibridge_interceptions_--help.golden | 12 ++++ ..._aibridge_interceptions_list_--help.golden | 37 ++++++++++ 12 files changed, 183 insertions(+), 9 deletions(-) create mode 100644 docs/reference/cli/aibridge.md create mode 100644 docs/reference/cli/aibridge_interceptions.md create mode 100644 docs/reference/cli/aibridge_interceptions_list.md rename enterprise/cli/{exp_aibridge.go => aibridge.go} (97%) rename enterprise/cli/{exp_aibridge_test.go => aibridge_test.go} (99%) create mode 100644 enterprise/cli/testdata/coder_aibridge_--help.golden create mode 100644 enterprise/cli/testdata/coder_aibridge_interceptions_--help.golden create mode 100644 enterprise/cli/testdata/coder_aibridge_interceptions_list_--help.golden diff --git a/docs/manifest.json b/docs/manifest.json index 78a0d38ec9..57711406c8 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -1180,6 +1180,21 @@ "path": "./reference/cli/index.md", "icon_path": "./images/icons/terminal.svg", "children": [ + { + "title": "aibridge", + "description": "Manage AIBridge.", + "path": "reference/cli/aibridge.md" + }, + { + "title": "aibridge interceptions", + "description": "Manage AIBridge interceptions.", + "path": "reference/cli/aibridge_interceptions.md" + }, + { + "title": "aibridge interceptions list", + "description": "List AIBridge interceptions as JSON.", + "path": "reference/cli/aibridge_interceptions_list.md" + }, { "title": "autoupdate", "description": "Toggle auto-update policy for a workspace", diff --git a/docs/reference/cli/aibridge.md b/docs/reference/cli/aibridge.md new file mode 100644 index 0000000000..7b16c5cdc8 --- /dev/null +++ b/docs/reference/cli/aibridge.md @@ -0,0 +1,16 @@ + +# aibridge + +Manage AIBridge. + +## Usage + +```console +coder aibridge +``` + +## Subcommands + +| Name | Purpose | +|-----------------------------------------------------------|--------------------------------| +| [interceptions](./aibridge_interceptions.md) | Manage AIBridge interceptions. | diff --git a/docs/reference/cli/aibridge_interceptions.md b/docs/reference/cli/aibridge_interceptions.md new file mode 100644 index 0000000000..9cfb3d45a7 --- /dev/null +++ b/docs/reference/cli/aibridge_interceptions.md @@ -0,0 +1,16 @@ + +# aibridge interceptions + +Manage AIBridge interceptions. + +## Usage + +```console +coder aibridge interceptions +``` + +## Subcommands + +| Name | Purpose | +|-------------------------------------------------------|--------------------------------------| +| [list](./aibridge_interceptions_list.md) | List AIBridge interceptions as JSON. | diff --git a/docs/reference/cli/aibridge_interceptions_list.md b/docs/reference/cli/aibridge_interceptions_list.md new file mode 100644 index 0000000000..7e86cd4968 --- /dev/null +++ b/docs/reference/cli/aibridge_interceptions_list.md @@ -0,0 +1,69 @@ + +# aibridge interceptions list + +List AIBridge interceptions as JSON. + +## Usage + +```console +coder aibridge interceptions list [flags] +``` + +## Options + +### --initiator + +| | | +|------|---------------------| +| Type | string | + +Only return interceptions initiated by this user. Accepts a user ID, username, or "me". + +### --started-before + +| | | +|------|---------------------| +| Type | string | + +Only return interceptions started before this time. Must be after 'started-after' if set. Accepts a time in the RFC 3339 format, e.g. "2006-01-02T15:04:05Z07:00". + +### --started-after + +| | | +|------|---------------------| +| Type | string | + +Only return interceptions started after this time. Must be before 'started-before' if set. Accepts a time in the RFC 3339 format, e.g. "2006-01-02T15:04:05Z07:00". + +### --provider + +| | | +|------|---------------------| +| Type | string | + +Only return interceptions from this provider. + +### --model + +| | | +|------|---------------------| +| Type | string | + +Only return interceptions from this model. + +### --after-id + +| | | +|------|---------------------| +| Type | string | + +The ID of the last result on the previous page to use as a pagination cursor. + +### --limit + +| | | +|---------|------------------| +| Type | int | +| Default | 100 | + +The limit of results to return. Must be between 1 and 1000. diff --git a/docs/reference/cli/index.md b/docs/reference/cli/index.md index c298f8bcb6..c1410b4599 100644 --- a/docs/reference/cli/index.md +++ b/docs/reference/cli/index.md @@ -68,6 +68,7 @@ Coder — A tool for provisioning self-hosted development environments with Terr | [groups](./groups.md) | Manage groups | | [prebuilds](./prebuilds.md) | Manage Coder prebuilds | | [external-workspaces](./external-workspaces.md) | Create or manage external workspaces | +| [aibridge](./aibridge.md) | Manage AIBridge. | ## Options diff --git a/enterprise/cli/exp_aibridge.go b/enterprise/cli/aibridge.go similarity index 97% rename from enterprise/cli/exp_aibridge.go rename to enterprise/cli/aibridge.go index 722f7bf239..90953b6aa2 100644 --- a/enterprise/cli/exp_aibridge.go +++ b/enterprise/cli/aibridge.go @@ -134,8 +134,7 @@ func (r *RootCmd) aibridgeInterceptionsList() *serpent.Command { return xerrors.Errorf("limit value must be between 1 and %d", maxInterceptionsLimit) } - expCli := codersdk.NewExperimentalClient(client) - resp, err := expCli.AIBridgeListInterceptions(inv.Context(), codersdk.AIBridgeListInterceptionsFilter{ + resp, err := client.AIBridgeListInterceptions(inv.Context(), codersdk.AIBridgeListInterceptionsFilter{ Pagination: codersdk.Pagination{ AfterID: afterID, // #nosec G115 - Checked above. diff --git a/enterprise/cli/exp_aibridge_test.go b/enterprise/cli/aibridge_test.go similarity index 99% rename from enterprise/cli/exp_aibridge_test.go rename to enterprise/cli/aibridge_test.go index db1cf43629..a5b48a14e1 100644 --- a/enterprise/cli/exp_aibridge_test.go +++ b/enterprise/cli/aibridge_test.go @@ -54,7 +54,6 @@ func TestAIBridgeListInterceptions(t *testing.T) { }, nil) args := []string{ - "exp", "aibridge", "interceptions", "list", @@ -135,7 +134,6 @@ func TestAIBridgeListInterceptions(t *testing.T) { }, nil) args := []string{ - "exp", "aibridge", "interceptions", "list", @@ -189,7 +187,6 @@ func TestAIBridgeListInterceptions(t *testing.T) { }, nil) args := []string{ - "exp", "aibridge", "interceptions", "list", diff --git a/enterprise/cli/root.go b/enterprise/cli/root.go index 3cec119703..78858ef48d 100644 --- a/enterprise/cli/root.go +++ b/enterprise/cli/root.go @@ -25,13 +25,12 @@ func (r *RootCmd) enterpriseOnly() []*serpent.Command { r.prebuilds(), r.provisionerd(), r.externalWorkspaces(), + r.aibridge(), } } -func (r *RootCmd) enterpriseExperimental() []*serpent.Command { - return []*serpent.Command{ - r.aibridge(), - } +func (*RootCmd) enterpriseExperimental() []*serpent.Command { + return []*serpent.Command{} } func (r *RootCmd) EnterpriseSubcommands() []*serpent.Command { diff --git a/enterprise/cli/testdata/coder_--help.golden b/enterprise/cli/testdata/coder_--help.golden index ddb44f78ae..8424ccac92 100644 --- a/enterprise/cli/testdata/coder_--help.golden +++ b/enterprise/cli/testdata/coder_--help.golden @@ -14,6 +14,7 @@ USAGE: $ coder templates init SUBCOMMANDS: + aibridge Manage AIBridge. external-workspaces Create or manage external workspaces features List Enterprise features groups Manage groups diff --git a/enterprise/cli/testdata/coder_aibridge_--help.golden b/enterprise/cli/testdata/coder_aibridge_--help.golden new file mode 100644 index 0000000000..d005ae429a --- /dev/null +++ b/enterprise/cli/testdata/coder_aibridge_--help.golden @@ -0,0 +1,12 @@ +coder v0.0.0-devel + +USAGE: + coder aibridge + + Manage AIBridge. + +SUBCOMMANDS: + interceptions Manage AIBridge interceptions. + +——— +Run `coder --help` for a list of global options. diff --git a/enterprise/cli/testdata/coder_aibridge_interceptions_--help.golden b/enterprise/cli/testdata/coder_aibridge_interceptions_--help.golden new file mode 100644 index 0000000000..1f3b3af5ad --- /dev/null +++ b/enterprise/cli/testdata/coder_aibridge_interceptions_--help.golden @@ -0,0 +1,12 @@ +coder v0.0.0-devel + +USAGE: + coder aibridge interceptions + + Manage AIBridge interceptions. + +SUBCOMMANDS: + list List AIBridge interceptions as JSON. + +——— +Run `coder --help` for a list of global options. diff --git a/enterprise/cli/testdata/coder_aibridge_interceptions_list_--help.golden b/enterprise/cli/testdata/coder_aibridge_interceptions_list_--help.golden new file mode 100644 index 0000000000..c98fd0019a --- /dev/null +++ b/enterprise/cli/testdata/coder_aibridge_interceptions_list_--help.golden @@ -0,0 +1,37 @@ +coder v0.0.0-devel + +USAGE: + coder aibridge interceptions list [flags] + + List AIBridge interceptions as JSON. + +OPTIONS: + --after-id string + The ID of the last result on the previous page to use as a pagination + cursor. + + --initiator string + Only return interceptions initiated by this user. Accepts a user ID, + username, or "me". + + --limit int (default: 100) + The limit of results to return. Must be between 1 and 1000. + + --model string + Only return interceptions from this model. + + --provider string + Only return interceptions from this provider. + + --started-after string + Only return interceptions started after this time. Must be before + 'started-before' if set. Accepts a time in the RFC 3339 format, e.g. + "====[timestamp]=====07:00". + + --started-before string + Only return interceptions started before this time. Must be after + 'started-after' if set. Accepts a time in the RFC 3339 format, e.g. + "====[timestamp]=====07:00". + +——— +Run `coder --help` for a list of global options.