AI Code Assistant 🪄
LiveCodes supports AI-powered code completion, totally for free with no account or API token required, using Windsurf. This can be easily enabled from the UI (as easy as flipping a switch!)
The large generative machine learning model is capable of understanding the context of your code and comments (across the 3 code editors) in order to generate suggestions on what you might want to type next.
It has a wide range of language support, and it works everywhere (in the standalone app, embedded playgrounds and self-hosted apps).
Examples:
JavaScript:
Python:
Instructions
The AI code assistant can be enabled from:
UI
The editor settings screen (Settings menu → Editor Settings → Enable AI Code Assistant).
Note
When set from the UI, this configuration is saved locally to user settings and is remembered across sessions.
Configuration
Alternatively, this can be enabled (only for the current session) using the enableAI
property in the configuration object. This can be used to enable the AI code assistant in embedded playgrounds.
Example:
import { createPlayground } from 'livecodes';
createPlayground('#container', {
config: {
enableAI: true,
},
});
Also this can be enabled using query params (e.g. https://livecodes.io/?enableAI).
Usage
On typing, the code completion suggestions will be shown in dimmed color. Press Tab to accept, or Esc to cancel.
On mobile, tap on the suggestion to accept it, or continue typing to reject.
Please note that when using Windsurf AI assistant, your code is sent to Windsurf servers for code completion. However, your code is not used for training their model. Check Windsurf FAQ and privacy policy for more details.