Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Dongx for VSCodeNew to Visual Studio Code? Get it now.
Dongx for VSCode

Dongx for VSCode

pisces2622

|
5 installs
| (0) | Free
Set custom environment variables for terminal integration
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Dongx for VSCode

A VS Code extension that helps you manage environment variables for terminal integration, specifically designed to set Anthropic API configurations.

Features

  • 🚀 Easy Setup: Set custom environment variables with a single command
  • 🔧 Safe Configuration: Asks for user confirmation before modifying settings
  • 🗑️ Clean Removal: Remove environment variables when no longer needed
  • 👀 View Current Settings: Check what environment variables are currently set
  • ⚡ Auto-Setup: Optional automatic setup when extension activates
  • 🌍 Cross-Platform: Works on Windows, macOS, and Linux

Commands

This extension provides the following commands:

  • Dongx: Set Environment Variables - Set ANTHROPIC environment variables
  • Dongx: Remove Environment Variables - Remove ANTHROPIC environment variables
  • Dongx: Show Current Environment Settings - Display current configuration

Usage

Setting Environment Variables

  1. Open the Command Palette (Cmd+Shift+P on macOS, Ctrl+Shift+P on Windows/Linux)
  2. Run the command Dongx: Set Environment Variables
  3. Confirm the action when prompted
  4. The extension will add these environment variables to your VS Code terminal settings:
    ANTHROPIC_BASE_URL=http://japi-ai-proxy-pre.jd.com/aiProxy
    ANTHROPIC_API_KEY=sk-ant-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    

Customizing Values

You can customize the default values in VS Code settings:

  1. Open Settings (Cmd+, on macOS, Ctrl+, on Windows/Linux)
  2. Search for "dongx"
  3. Modify the following settings:
    • dongx.anthropicBaseUrl: Custom Anthropic API Base URL
    • dongx.anthropicApiKey: Your Anthropic API Key
    • dongx.autoSetOnActivation: Auto-set variables when extension activates

Removing Variables

  1. Open the Command Palette
  2. Run Dongx: Remove Environment Variables
  3. Confirm the removal when prompted

Configuration

The extension adds the following settings to VS Code:

{
  "dongx.anthropicBaseUrl": "http://japi-ai-proxy-pre.jd.com/aiProxy",
  "dongx.anthropicApiKey": "sk-ant-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 
  "dongx.autoSetOnActivation": false
}

How It Works

This extension modifies your VS Code user settings to add environment variables that will be available in all new integrated terminal sessions. The modified setting looks like:

{
  "terminal.integrated.env.osx": {
    "ANTHROPIC_BASE_URL": "http://japi-ai-proxy-pre.jd.com/aiProxy",
    "ANTHROPIC_API_KEY": "sk-ant-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  }
}

The platform-specific key (osx, windows, or linux) is automatically detected.

Installation

From Source

  1. Copy the dongx-vscode-extension folder to your VS Code extensions directory:

    • Windows: %USERPROFILE%\\.vscode\\extensions\\
    • macOS: ~/.vscode/extensions/
    • Linux: ~/.vscode/extensions/
  2. Restart VS Code

  3. The extension should now be active

Development

  1. Clone or download this extension
  2. Open the extension folder in VS Code
  3. Press F5 to launch a new Extension Development Host
  4. Test the extension in the new VS Code window

Safety Features

  • User Confirmation: Always asks for permission before modifying settings
  • Non-Destructive: Merges with existing environment variables instead of overwriting
  • Reversible: Provides easy removal of added variables
  • Visible Changes: All changes are made to your VS Code settings.json file

Troubleshooting

Variables Not Working in Terminal

  1. Make sure you've created a new terminal after setting the variables
  2. Check that terminal.integrated.inheritEnv is enabled in VS Code settings
  3. Verify the variables are set by running Dongx: Show Current Environment Settings

Extension Not Loading

  1. Check the VS Code Developer Console (Help → Toggle Developer Tools) for errors
  2. Make sure the extension folder is in the correct location
  3. Restart VS Code completely

Requirements

  • VS Code version 1.74.0 or higher
  • No additional dependencies required

Release Notes

1.0.0

  • Initial release
  • Support for setting ANTHROPIC environment variables
  • Cross-platform compatibility
  • User confirmation dialogs
  • Settings management

Contributing

This is a simple extension built for specific use cases. If you encounter issues or have suggestions, please create an issue or submit a pull request.

License

MIT License - Feel free to modify and distribute as needed.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft