From 3a68ad68b34fff1f9531dfbfdeb7ca761a029419 Mon Sep 17 00:00:00 2001 From: "kiloconnect[bot]" <240665456+kiloconnect[bot]@users.noreply.github.com> Date: Thu, 2 Apr 2026 12:47:16 +0000 Subject: [PATCH 1/3] docs(kilo-docs): expand CLI organization usage documentation Replace the brief 'Switching into an Organization' section with a comprehensive guide covering interactive usage (/teams command) and non-interactive usage (KILO_ORG_ID env var, persisted selection, default org fallback) with CI/CD examples. --- .../pages/code-with-ai/platforms/cli.md | 30 +++++++++++++++++-- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/packages/kilo-docs/pages/code-with-ai/platforms/cli.md b/packages/kilo-docs/pages/code-with-ai/platforms/cli.md index fec996bc220..826a1837af2 100644 --- a/packages/kilo-docs/pages/code-with-ai/platforms/cli.md +++ b/packages/kilo-docs/pages/code-with-ai/platforms/cli.md @@ -468,10 +468,34 @@ The CLI supports overriding config values with environment variables. The suppor - For `kilocode` provider: `KILOCODE_` (e.g., `KILOCODE_MODEL` → `kilocodeModel`) - For other providers: `KILO_` (e.g., `KILO_API_KEY` → `apiKey`) -## Switching into an Organization from the CLI +## Using the CLI in an Organization -Use the `/teams` command to see a list of all organizations you can switch into. +If you belong to a Kilo organization (Team or Enterprise), you can route CLI requests through that organization. The process differs slightly between interactive and non-interactive usage. -Use `/teams` and select a team to switch teams. +### Interactive Usage + +In an interactive CLI session, use the `/teams` command to see a list of all organizations you can switch into. Select an organization from the list to switch into it. Your selection is persisted locally so it carries over to future sessions. The process is the same when switching into a Team or Enterprise organization. + +### Non-Interactive Usage (`kilo run`) + +There is no `--org` or `--team` flag on `kilo run`. Instead, the organization is determined from the following sources, in order of priority (highest first): + +1. **`KILO_ORG_ID` environment variable** — Best for non-interactive and CI environments. Set it alongside your API key: + + ```bash + KILO_ORG_ID= kilo run "your message" + ``` + + In CI (e.g., GitHub Actions), set it as a repository secret: + + ```yaml + env: + KILO_API_KEY: ${{ secrets.KILO_API_KEY }} + KILO_ORG_ID: ${{ secrets.KILO_ORG_ID }} + ``` + +2. **Persisted selection from the last `/teams` pick** — If you've run an interactive session and selected an organization via `/teams`, that selection is stored in the CLI's local state file and reused automatically. + +3. **Default organization on your account** — If your account belongs to only one organization, it is used automatically without any additional configuration. From d3bb4f92803cf0b9afbb8851de1ca5538b20fc47 Mon Sep 17 00:00:00 2001 From: Alex Gold Date: Thu, 2 Apr 2026 08:55:49 -0400 Subject: [PATCH 2/3] Revise CLI organization selection instructions Updated instructions for interactive CLI usage and clarified organization selection process. --- .../pages/code-with-ai/platforms/cli.md | 20 +++---------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/packages/kilo-docs/pages/code-with-ai/platforms/cli.md b/packages/kilo-docs/pages/code-with-ai/platforms/cli.md index 826a1837af2..be5b191c2bb 100644 --- a/packages/kilo-docs/pages/code-with-ai/platforms/cli.md +++ b/packages/kilo-docs/pages/code-with-ai/platforms/cli.md @@ -474,28 +474,14 @@ If you belong to a Kilo organization (Team or Enterprise), you can route CLI req ### Interactive Usage -In an interactive CLI session, use the `/teams` command to see a list of all organizations you can switch into. Select an organization from the list to switch into it. Your selection is persisted locally so it carries over to future sessions. +In an interactive CLI session, use the `/teams` command to select an organization from your membership list. -The process is the same when switching into a Team or Enterprise organization. +Your selection is persisted locally so it carries over to future sessions. ### Non-Interactive Usage (`kilo run`) There is no `--org` or `--team` flag on `kilo run`. Instead, the organization is determined from the following sources, in order of priority (highest first): -1. **`KILO_ORG_ID` environment variable** — Best for non-interactive and CI environments. Set it alongside your API key: - - ```bash - KILO_ORG_ID= kilo run "your message" - ``` - - In CI (e.g., GitHub Actions), set it as a repository secret: - - ```yaml - env: - KILO_API_KEY: ${{ secrets.KILO_API_KEY }} - KILO_ORG_ID: ${{ secrets.KILO_ORG_ID }} - ``` +1. **`KILO_ORG_ID` environment variable** — Best for non-interactive and CI environments. 2. **Persisted selection from the last `/teams` pick** — If you've run an interactive session and selected an organization via `/teams`, that selection is stored in the CLI's local state file and reused automatically. - -3. **Default organization on your account** — If your account belongs to only one organization, it is used automatically without any additional configuration. From e12f41a1d426489ade647aed5daea359954b4e40 Mon Sep 17 00:00:00 2001 From: Alex Gold Date: Thu, 2 Apr 2026 08:56:14 -0400 Subject: [PATCH 3/3] Apply suggestion from @kilo-code-bot[bot] Co-authored-by: kilo-code-bot[bot] <240665456+kilo-code-bot[bot]@users.noreply.github.com> --- packages/kilo-docs/pages/code-with-ai/platforms/cli.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/kilo-docs/pages/code-with-ai/platforms/cli.md b/packages/kilo-docs/pages/code-with-ai/platforms/cli.md index be5b191c2bb..1ee5cbfe61d 100644 --- a/packages/kilo-docs/pages/code-with-ai/platforms/cli.md +++ b/packages/kilo-docs/pages/code-with-ai/platforms/cli.md @@ -484,4 +484,4 @@ There is no `--org` or `--team` flag on `kilo run`. Instead, the organization is 1. **`KILO_ORG_ID` environment variable** — Best for non-interactive and CI environments. -2. **Persisted selection from the last `/teams` pick** — If you've run an interactive session and selected an organization via `/teams`, that selection is stored in the CLI's local state file and reused automatically. +2. **`Persisted selection from the last `/teams` pick`** — If you've run an interactive session and selected an organization via `/teams`, that selection is stored in the CLI auth file and reused automatically.