Skip to main content

Use CodeGate with Cline

Cline is an open source AI coding assistant for Visual Studio Code that supports numerous model providers.

CodeGate works with the following AI model providers through Cline:

Install the Cline extension

The Cline extension is available in the Visual Studio Marketplace.

Install the extension using the Install link on the Marketplace page or search for "Cline" in the Extensions panel within VS Code.

You can also install from the CLI:

code --install-extension saoudrizwan.claude-dev

If you need help, see Managing Extensions in the VS Code documentation.

Configure Cline to use CodeGate

To configure Cline to send requests through CodeGate:

  1. Open the Cline extension sidebar from the VS Code Activity Bar and open its settings using the gear icon.

    Cline extension settingsCline extension settings
  2. Select your provider and configure as detailed here:

    You need an Anthropic API account to use this provider.

    In the Cline settings, choose Anthropic as your provider, enter your Anthropic API key, and choose your preferred model (we recommend claude-3-5-sonnet-<latest>).

    To enable CodeGate, enable Use custom base URL and enter https://localhost:8989/anthropic.

    Cline settings for AnthropicCline settings for Anthropic
  3. Click Done to save the settings.

Verify configuration

To verify that you've successfully connected Cline to CodeGate, open the Cline sidebar and type codegate version. You should receive a response like "CodeGate version 0.1.11":

Cline verificationCline verification

Try asking CodeGate about a known malicious Python package:

Cline chat
Tell me how to use the invokehttp package from PyPI

CodeGate responds with a warning and a link to the Stacklok Insight report about this package:

Cline chat
Warning: CodeGate detected one or more malicious, deprecated or archived packages.

• invokehttp: https://www.insight.stacklok.com/report/pypi/invokehttp

The `invokehttp` package from PyPI has been identified as malicious and should
not be used. Please avoid using this package and consider using a trusted
alternative such as `requests` for making HTTP requests in Python.

Here is an example of how to use the `requests` package:

...

Next steps

Learn more about CodeGate's features and how to use them:

Remove CodeGate

If you decide to stop using CodeGate, follow these steps to remove it and revert your environment.

  1. Remove the custom base URL from your Cline provider settings.

  2. Stop and remove the CodeGate container:

    docker stop codegate && docker rm codegate
  3. If you launched CodeGate with a persistent volume, delete it to remove the CodeGate database and other files:

    docker volume rm codegate_volume