@aws/lsp-codewhisperer

中文文档
0.0.133发布于 2026/10/29Apache-2.0TypeScriptCommonJS构建来源已验证近 30 天下载 3240

CodeWhisperer Language Server

原始使用文档
文档目录5 节
  1. Guides
  2. Proxy
  3. Bundling with webworker runtime
  4. Fetching Amazon Q configuration(s)
  5. Supported workspace configurations

CodeWhisperer Server

Guides

Proxy

To use the CodeWhisperer server behind a proxy, import the CodeWhispererServerTokenProxy as the server and set up the environment variable HTTPS_PROXY or https_proxy to the proxy URL you are using. You can pass the environment variable to the process or just set it up globally on your system.

export HTTPS_PROXY=https://proxy.example.com:5678
export https_proxy=https://proxy.example.com:5678

or

export HTTPS_PROXY=http://username:[email protected]:5678
export https_proxy=http://username:[email protected]:5678

Bundling with webworker runtime

Amazon Q Servers implemented in this package may have dependencies on NodeJS native modules, not available in non-Node.js environments.

To make cross-platform bundle, use bundler that allow overriding modules with compatible alternatives (e.g. Webpack).

NodeJS modules used in this package

  • CodeWhispererServer:
    • path
  • SecurityScanServer:
    • path, os

To override modules use next alternatives:

Fetching Amazon Q configuration(s)

The following Amazon Q configurations can be fetched with the aws/getConfigurationFromServer request exposed by QConfigurationServer:

  • customizations
  • developer profiles

The request expects a section parameter, recognizing the following options:

  • aws.q
    • aws.q.customizations
    • aws.q.developerProfiles

Example:

await languageClient.sendRequest(getConfigurationFromServerRequestType.method, {
            section: 'aws.q',
        })
// result:
{
  'customizations': [customization1, customization2, ...],
  'developerProfiles': [profile1, profile2, ...] // (if enabled)
}

Granular requests such as aws.q.customizations will only return that particular configuration.

Example:

await languageClient.sendRequest(getConfigurationFromServerRequestType.method, {
            section: 'aws.q.customizations',
        })
// result:
[customization1, customization2, ...]

Developer Profiles

By default, developer profiles are not fetched. To enable the fetching, the client needs to signal support for them at initialization in the InitializeParams.

Example:

const params: InitializeParams = {
  // ...
  aws: {
    // ...
    awsClientCapabilities: {
      q: {
        developerProfiles: true
      }
    }
  }
}

Supported workspace configurations

The server supports the following workspace configurations:

  • aws.q.customization (type: string | undefined, default: undefined)
    • The customization ARN to be used in API requests, an empty string will be interpreted as undefined.
  • aws.q.optOutTelemetry (type: OPTOUT | OPTIN, default: OPTIN)
    • This flag controls whether to opt-in or opt-out to telemetry.
  • aws.q.inlineSuggestions.extraContext (type: string | undefined, default: undefined)
    • The extra context to be included for suggestions, an empty string will be interpreted as undefined. See below for more context.
  • aws.q.inlineChat.extraContext (type: string | undefined, default: undefined)
    • The extra context to be included for inline chat, an empty string will be interpreted as undefined. See below for more context.
  • aws.codeWhisperer.includeSuggestionsWithCodeReferences: (type: boolean, default: false)
    • This flag controls whether to include references with code suggestions.
  • aws.codeWhisperer.shareCodeWhispererContentWithAWS: (type: boolean, default: false)
    • This flag controls whether to share Q content with AWS.

The client can signal updates to the workspace configuration with the DidChangeConfiguration notification.

Extra context for Q Inline Suggestions

In cases when the client runs in a specific environment that requires customized suggestions, the server supports a aws.q.inlineSuggestions.extraContext workspace configuration. This extra context will be passed to the left file content of the request in the beginning of the file.

Extra context for Q Inline Chat

In cases when the client runs in a specific environment that requires customized inline chat responses, the server supports a aws.q.inlineChat.extraContext workspace configuration. This extra context will be prepended to the document text of the request, similar to how inline suggestions work.

版本与发布记录

@aws/lsp-codewhisperer 共发布 125 个版本,首次发布于 2024/03/08;过去 12 个月发布了 44 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.0.133latest2026/10/2910 天前
0.0.1322026/10/2316 天前
0.0.1312026/10/1623 天前
0.0.1302026/10/0929 天前
0.0.1292026/10/021 个月前
0.0.1282026/09/101 个月前

关于 @aws/lsp-codewhisperer 的常见问题

@aws/lsp-codewhisperer 是什么?

CodeWhisperer Language Server

如何安装 @aws/lsp-codewhisperer?

在项目目录运行 npm install @aws/lsp-codewhisperer,或使用 pnpm add / yarn add / bun add。

@aws/lsp-codewhisperer 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@aws/lsp-codewhisperer 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@aws/lsp-codewhisperer 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@aws/lsp-codewhisperer 可以商用吗?

@aws/lsp-codewhisperer 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@aws/lsp-codewhisperer 的下载量有多少?

根据 npm 官方下载统计,@aws/lsp-codewhisperer 在 2026/10/08 – 2026/11/06 这 30 天内被下载 3,240 次,日均约 108 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@aws/lsp-codewhisperer 还在维护吗?

最新版本 0.0.133 发布于 2026/10/29(10 天前);至今共发布 125 个版本,其中过去 12 个月发布了 44 个;首次发布于 2024/03/08。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。