Getting Started
Build your first extension for the ted code editor
What is a ted Extension?
Extensions are plain JavaScript folders that extend the ted editor with new commands, status bar items, sidebar panels, and more. They live in ~/.ted/extensions/ and are loaded automatically on startup.
Folder Structure
Every extension is a folder with this shape:
my-extension/
├── package.json # Manifest
└── index.js # Entry pointYou can optionally add:
README.md— shown on the marketplaceicon.png— 128×128 icon shown in the marketplace
package.json Manifest
{
"name": "my-extension",
"displayName": "My Extension",
"description": "What my extension does",
"version": "1.0.0",
"main": "index.js",
"activationEvents": ["onStartup"]
}| Field | Required | Description |
|---|---|---|
name | ✓ | Unique identifier (kebab-case) |
version | ✓ | Semver string, e.g. 1.0.0 |
displayName | ✓ | Human-readable name |
main | ✓ | Entry JS file, relative to the extension root |
description | — | Short description (shown in the marketplace) |
activationEvents | — | When to activate the extension |
Extension Entry Point
Your index.js must export an activate function, and optionally a deactivate function:
function activate(api) {
// Called when ted loads your extension.
// Use `api` to interact with the editor.
api.editor.showNotification("My extension is active!", "info");
}
function deactivate() {
// Called when the extension is unloaded.
// Clean up timers, listeners, etc.
}
module.exports = { activate, deactivate };Installing Locally
- Create your extension folder in
~/.ted/extensions/<name>/ - Add
package.jsonandindex.js - Restart ted — your extension will be loaded automatically
~/.ted/
└── extensions/
└── my-extension/
├── package.json
└── index.jsActivation Events
| Event | When it fires |
|---|---|
onStartup | When ted starts |
onCommand:<id> | When a specific command is invoked |
onEditorChange | When the active file changes |
If activationEvents is omitted, the extension activates on startup.