Compare commits

...

2 Commits

Author SHA1 Message Date
abeatrix 31575a1b31 add docs 2025-07-17 16:30:04 -07:00
abeatrix 36a70e4eff Configure API env via CLINE_ENDPOINT_ENV
This commit introduces the ability to configure the application environment (production, staging, or local) using the `CLINE_ENDPOINT_ENV` environment variable.

- Modified `src/config.ts` and `webview-ui/src/config.ts` to read the `CLINE_ENDPOINT_ENV` environment variable and set the `CURRENT_ENVIRONMENT` accordingly. If the variable is not set, it defaults to "production".
- Updated `.vscode/launch.json` to include `CLINE_ENDPOINT_ENV` with a default value of "staging" for development purposes. This allows developers to easily switch between environments during development.
2025-07-17 16:23:38 -07:00
5 changed files with 32 additions and 2 deletions
+1
View File
@@ -2,6 +2,7 @@
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"saoudrizwan.claude-dev",
"dbaeumer.vscode-eslint",
"connor4312.esbuild-problem-matchers",
"ms-vscode.extension-test-runner",
+2
View File
@@ -14,6 +14,8 @@
"preLaunchTask": "${defaultBuildTask}",
"env": {
"IS_DEV": "true",
// Cline API instance to connect to: "local", "staging", or "production"
// "CLINE_INSTANCE": "staging", // default to "production" when not set
"DEV_WORKSPACE_FOLDER": "${workspaceFolder}"
}
},
+27
View File
@@ -51,8 +51,35 @@ We also welcome contributions to our [documentation](https://github.com/cline/cl
```
4. Launch by pressing `F5` (or `Run`->`Start Debugging`) to open a new VSCode window with the extension loaded. (You may need to install the [esbuild problem matchers extension](https://marketplace.visualstudio.com/items?itemName=connor4312.esbuild-problem-matchers) if you run into issues building the project.)
#### Configuring API Instance for Internal Development
By default, Cline connects to the production API instance. For internal development purposes, you may want to point to a different Cline API instance (staging or local).
To configure the API instance:
1. **Using launch configuration** (recommended):
- Open `.vscode/launch.json`
- Uncomment and modify the `CLINE_INSTANCE` environment variable in the "Run Extension" configuration:
```json
"env": {
"IS_DEV": "true",
"DEV_WORKSPACE_FOLDER": "${workspaceFolder}",
"CLINE_INSTANCE": "staging" // or "local" or "production"
}
```
2. **Using build-time environment variable**:
- Set the `CLINE_INSTANCE` environment variable when building:
```bash
CLINE_INSTANCE=staging npm run build
```
Available instances:
- `"production"` (default) - Production API at `https://api.cline.bot`
- `"staging"` - Staging API at `https://core-api.staging.int.cline.bot`
- `"local"` - Local development API at `http://localhost:7777`
You can search for `CLINE_INSTANCE` in the codebase to see how this configuration is used in `src/config.ts` and `webview-ui/src/config.ts`.
### Creating a Pull Request
+1 -1
View File
@@ -1,6 +1,6 @@
export type Environment = "production" | "staging" | "local"
const CURRENT_ENVIRONMENT: Environment = "production"
const CURRENT_ENVIRONMENT: Environment = (process?.env?.CLINE_INSTANCE as Environment) || "production"
interface EnvironmentConfig {
appBaseUrl: string
+1 -1
View File
@@ -1,6 +1,6 @@
export type Environment = "production" | "staging" | "local"
const CURRENT_ENVIRONMENT: Environment = "production"
const CURRENT_ENVIRONMENT: Environment = (process?.env?.CLINE_INSTANCE as Environment) || "production"
interface EnvironmentConfig {
appBaseUrl: string