Getting Started

This guide walks you through creating your first Nimbalyst extension. By the end, you'll have a working extension that registers a custom editor for .hello files.

The intended workflow is to scaffold and iterate on extensions from inside Nimbalyst:

  1. Enable Extension Dev Tools in Settings > Advanced

  2. Use File > New Extension Project or Developer > New Extension Project

  3. Or ask Claude to run /new-extension minimal ~/my-first-extension "Hello Editor"

  4. Ask Claude to build and install it with extension_build and extension_install

  5. Use extension_reload while iterating

The rest of this guide shows the manual scaffold path if you prefer to create the project yourself.

Prerequisites

  1. Enable Extension Dev Tools - Go to Settings > Advanced and enable "Extension Dev Tools"

  2. Node.js 18+ - Required for building extensions

Step 1: Create the Project

Create a new directory for your extension:

Step 2: Install Dependencies

Step 3: Create the Manifest

Create manifest.json - this tells Nimbalyst about your extension:

apiVersion is currently optional but recommended.

Step 4: Create the Vite Config

Create vite.config.ts:

Step 5: Create the TypeScript Config

Create tsconfig.json:

Step 6: Create the Extension Entry Point

Create src/index.ts:

Step 7: Create the Editor Component

Create src/HelloEditor.tsx:

Key points:

  • useEditorLifecycle handles loading, saving, file watching, echo detection, and dirty state

  • applyContent pushes content into the editor (on load, external changes)

  • getCurrentContent pulls content from the editor (on save)

  • Call markDirty() when the user edits -- the hook manages host.setDirty() for you

  • Content lives in a ref, not React state -- the textarea uses defaultValue

Step 8: Add Build Script

Update your package.json to add a build script:

Step 9: Build and Install

Now ask Claude to build and install your extension:

"Build and install my extension from ~/my-first-extension"

Claude will use the extension_build and extension_install tools to compile and load your extension.

Step 10: Test It

  1. Create a new file with the .hello extension

  2. Your custom editor should appear instead of the default text editor

  3. Make changes and save - they persist to the file

Next Steps

  • Add styling with a styles.css file

  • Add AI tools so Claude can interact with your editor

  • Add a toolbar with actions

  • Handle more complex file formats

See the custom-editors.md guide for more advanced editor development.

Troubleshooting

Extension doesn't load

  1. Check the console for errors (View > Toggle Developer Tools)

  2. Verify your manifest.json has a valid id field

  3. Make sure dist/index.js exists after building

Editor doesn't appear for file type

  1. Check that filePatterns in the manifest matches your file extension

  2. Verify the component name matches what you export in components

Changes don't appear after editing

Ask Claude to reload the extension:

"Reload my hello-editor extension"

This will rebuild and hot-reload without restarting Nimbalyst.

Last updated