https://github.com/live-codes/monaco-codeium-provider
https://github.com/live-codes/monaco-codeium-provider
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/live-codes/monaco-codeium-provider
- Owner: live-codes
- License: mit
- Created: 2024-02-07T10:41:20.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-14T08:50:17.000Z (over 2 years ago)
- Last Synced: 2025-06-08T04:42:41.327Z (about 1 year ago)
- Language: TypeScript
- Size: 48.8 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Monaco Codeium Provider
AI auto-completion provider for Monaco editor powered by Codeium.
As used in [LiveCodes](https://livecodes.io).
Based on https://github.com/Exafunction/codeium-react-code-editor ([MIT License](https://github.com/Exafunction/codeium-react-code-editor/blob/cf3f020b3bf518bd1683f0b31df578e50ef93407/LICENSE))
## Installation
```bash
npm install @live-codes/monaco-codeium-provider
```
## Usage
```js
import { registerCodeiumProvider } from "@live-codes/monaco-codeium-provider";
const provider = registerCodeiumProvider(
monaco,
// optional config
{
languageServer: "https://web-backend.codeium.com",
apiKey: "codeium-api-key",
onAutocomplete: (acceptedText) => {
// runs on completion
console.log(acceptedText);
},
getEditors: () => {
// return an array of other monaco editors that you want their content to be used for AI context
// e.g. if the current editor is for JS, return HTML and CSS editors
return [];
},
}
);
// to dispose
provider.dispose();
```