Skip to content

Commit ffd7ada

Browse files
authored
Merge branch 'main' into virtual-quota-provider
2 parents b5870ee + 3aa33b3 commit ffd7ada

File tree

30 files changed

+526
-68
lines changed

30 files changed

+526
-68
lines changed

.github/workflows/code-qa.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ jobs:
162162
with:
163163
distribution: 'jetbrains'
164164
java-version: '21'
165+
check-latest: false
166+
token: ${{ secrets.GITHUB_TOKEN }}
165167
- name: Install system dependencies
166168
run: |
167169
sudo apt-get update
@@ -209,4 +211,4 @@ jobs:
209211
run: pnpm install
210212
- name: Run unit tests
211213
working-directory: cli
212-
run: pnpm test
214+
run: pnpm test

.github/workflows/marketplace-publish.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ jobs:
134134
with:
135135
distribution: "jetbrains"
136136
java-version: "21"
137+
check-latest: false
138+
token: ${{ secrets.GITHUB_TOKEN }}
137139
- name: Install system dependencies
138140
run: |
139141
sudo apt-get update

.vscode/launch.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,23 @@
4444
},
4545
"resolveSourceMapLocations": ["${workspaceFolder}/**", "!**/node_modules/**"],
4646
"presentation": { "hidden": false, "group": "tasks", "order": 1 }
47+
},
48+
{
49+
"name": "Run Extension [Local Backend]",
50+
"type": "extensionHost",
51+
"request": "launch",
52+
"runtimeExecutable": "${execPath}",
53+
"args": ["--extensionDevelopmentPath=${workspaceFolder}/src", "--disable-extensions"],
54+
"sourceMaps": true,
55+
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
56+
"preLaunchTask": "${defaultBuildTask}",
57+
"env": {
58+
"NODE_ENV": "development",
59+
"VSCODE_DEBUG_MODE": "true",
60+
"KILOCODE_BACKEND_BASE_URL": "${input:kilocodeBackendBaseUrl}"
61+
},
62+
"resolveSourceMapLocations": ["${workspaceFolder}/**", "!**/node_modules/**"],
63+
"presentation": { "hidden": false, "group": "tasks", "order": 2 }
4764
}
4865
],
4966
"inputs": [
@@ -52,6 +69,12 @@
5269
"description": "Directory the dev extension will open in",
5370
"default": "${workspaceFolder}/launch",
5471
"type": "promptString"
72+
},
73+
{
74+
"id": "kilocodeBackendBaseUrl",
75+
"description": "Override the kilocode backend base URL",
76+
"default": "http://localhost:3000",
77+
"type": "promptString"
5578
}
5679
]
5780
}

DEVELOPMENT.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,18 @@ These hooks help maintain code quality and consistency. If you encounter issues
248248
- Check the Output panel in VSCode (View > Output) and select "Kilo Code" from the dropdown
249249
- For webview issues, use the browser developer tools in the webview (right-click > "Inspect Element")
250250
251+
### Testing with Local Backend
252+
253+
To test the extension against a local Kilo Code backend:
254+
255+
1. **Set up your local backend** at `http://localhost:3000`
256+
2. **Use the "Run Extension [Local Backend]" launch configuration**:
257+
- Go to Run and Debug (Ctrl+Shift+D)
258+
- Select "Run Extension [Local Backend]" from the dropdown
259+
- Press F5 to start debugging
260+
261+
This automatically sets the `KILOCODE_BACKEND_BASE_URL` environment variable, making all sign-in/sign-up buttons point to your local backend instead of production.
262+
251263
## Contributing
252264
253265
We welcome contributions to Kilo Code! Here's how you can help:

apps/kilocode-docs/docs/cli.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ to start the CLI and begin a new task with your preferred model and relevant mod
4242
| `/model list` | List available models | |
4343
| `/model info` | Prints description for a specific model by name | `/model info z-ai/glm-4.5v` |
4444
| `/model select` | Select and switch to a new model | |
45+
| `/config` | Open configuration editor (same as `kilocode config`) | |
4546
| `/new` | Start a new task with the agent with a clean slate | |
4647
| `/help` | List available commands and how to use them | |
4748
| `/exit` | Exit the CLI | |
@@ -56,6 +57,10 @@ You can reference the [Provider Configuration Guide](https://github.com/Kilo-Org
5657

5758
to complete configuration with an interactive workflow on the command line.
5859

60+
:::tip
61+
You can also use the `/config` slash command during an interactive session, which is equivalent to running `kilocode config`.
62+
:::
63+
5964
## Autonomous mode (Non-Interactive)
6065

6166
Autonomous mode allows Kilo Code to run in automated environments like CI/CD pipelines without requiring user interaction.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import { describe, it, expect, vi, beforeEach } from "vitest"
2+
import { configCommand } from "../config.js"
3+
import type { CommandContext } from "../core/types.js"
4+
import openConfigFile from "../../config/openConfig.js"
5+
6+
// Mock the openConfigFile function
7+
vi.mock("../../config/openConfig.js", () => ({
8+
default: vi.fn(),
9+
}))
10+
11+
describe("configCommand", () => {
12+
let mockContext: CommandContext
13+
let addMessageSpy: ReturnType<typeof vi.fn>
14+
15+
beforeEach(() => {
16+
vi.clearAllMocks()
17+
addMessageSpy = vi.fn()
18+
19+
mockContext = {
20+
input: "/config",
21+
args: [],
22+
options: {},
23+
sendMessage: vi.fn(),
24+
addMessage: addMessageSpy,
25+
clearMessages: vi.fn(),
26+
replaceMessages: vi.fn(),
27+
clearTask: vi.fn(),
28+
setMode: vi.fn(),
29+
exit: vi.fn(),
30+
routerModels: null,
31+
currentProvider: null,
32+
kilocodeDefaultModel: "",
33+
updateProviderModel: vi.fn(),
34+
refreshRouterModels: vi.fn(),
35+
updateProvider: vi.fn(),
36+
profileData: null,
37+
balanceData: null,
38+
profileLoading: false,
39+
balanceLoading: false,
40+
}
41+
})
42+
43+
it("should have correct metadata", () => {
44+
expect(configCommand.name).toBe("config")
45+
expect(configCommand.aliases).toContain("c")
46+
expect(configCommand.aliases).toContain("settings")
47+
expect(configCommand.category).toBe("settings")
48+
expect(configCommand.priority).toBe(8)
49+
})
50+
51+
it("should open config file successfully", async () => {
52+
vi.mocked(openConfigFile).mockResolvedValue(undefined)
53+
54+
await configCommand.handler(mockContext)
55+
56+
expect(addMessageSpy).toHaveBeenCalledWith(
57+
expect.objectContaining({
58+
type: "system",
59+
content: "Opening configuration file...",
60+
}),
61+
)
62+
expect(openConfigFile).toHaveBeenCalled()
63+
})
64+
})

cli/src/commands/config.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/**
2+
* /config command - Open the CLI configuration file
3+
*/
4+
5+
import type { Command } from "./core/types.js"
6+
import openConfigFile from "../config/openConfig.js"
7+
8+
export const configCommand: Command = {
9+
name: "config",
10+
aliases: ["c", "settings"],
11+
description: "Open the CLI configuration file in your default editor",
12+
usage: "/config",
13+
examples: ["/config"],
14+
category: "settings",
15+
priority: 8,
16+
handler: async (context) => {
17+
const { addMessage } = context
18+
19+
addMessage({
20+
id: Date.now().toString(),
21+
type: "system",
22+
content: "Opening configuration file...",
23+
ts: Date.now(),
24+
})
25+
26+
await openConfigFile()
27+
},
28+
}

cli/src/commands/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { modeCommand } from "./mode.js"
1515
import { modelCommand } from "./model.js"
1616
import { profileCommand } from "./profile.js"
1717
import { teamsCommand } from "./teams.js"
18+
import { configCommand } from "./config.js"
1819

1920
/**
2021
* Initialize all commands
@@ -29,4 +30,5 @@ export function initializeCommands(): void {
2930
commandRegistry.register(modelCommand)
3031
commandRegistry.register(profileCommand)
3132
commandRegistry.register(teamsCommand)
33+
commandRegistry.register(configCommand)
3234
}

cli/src/services/telemetry/identity.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import * as crypto from "crypto"
99
import * as os from "os"
1010
import { KiloCodePaths } from "../../utils/paths.js"
1111
import { logs } from "../logs.js"
12+
import { getApiUrl } from "@roo-code/types"
1213

1314
/**
1415
* User identity structure
@@ -107,7 +108,7 @@ export class IdentityManager {
107108

108109
try {
109110
// Fetch user profile from Kilocode API
110-
const response = await fetch("https://api.kilocode.ai/api/profile", {
111+
const response = await fetch(getApiUrl("/profile"), {
111112
headers: {
112113
Authorization: `Bearer ${kilocodeToken}`,
113114
"Content-Type": "application/json",

0 commit comments

Comments
 (0)