@srcnexus/create-extension
@srcnexus/create-extension scaffolds a ready-to-build SrcNexus extension project in one command. It is published on npm as @srcnexus/create-extension.
Usage
npm create @srcnexus/extension
There is nothing to install first — npm create fetches and runs the latest version. Requires Node.js 16 or later.
The tool prompts you for a name, ID, description, and language (TypeScript or JavaScript), then generates the project.
Non-interactive mode
npm create @srcnexus/extension -- --name "My Extension" --lang typescript -y
| Option | Description |
|---|---|
--name <name> | Extension display name |
--id <id> | Extension ID (auto-derived from the name if omitted) |
--description <desc> | Extension description |
--lang <lang> | typescript (or ts) / javascript (or js) |
--dir <path> | Output directory (default: ./<id>) |
-y, --yes | Skip prompts and use defaults |
-h, --help | Show help |
What gets generated
my-extension/
manifest.json # Extension metadata and contributions
package.json # Dependencies (@srcnexus/ext-sdk, esbuild)
build.js # esbuild bundler (with optional CodeMirror support)
src/main.ts # Entry point with a sample "Hello World" command
tsconfig.json # TypeScript config (TypeScript projects only)
.gitignore
The entry point already imports @srcnexus/ext-sdk and registers a working command, so you have something you can build and run immediately.
Next steps
cd my-extension
npm install
npm run build
npm run build bundles your source into dist/main.js. Open the project in SrcNexus to test it, or deploy it with the SrcNexus CLI:
srcnexus deploy --extension
Alternative: scaffold inside the app
If you prefer not to leave the editor, install the Create Extension extension from the store — it runs the same guided setup on-device.
Related
- Extensions — Getting Started
- Extension Manifest reference
@srcnexus/ext-sdk— the SDK the generated project depends on- All npm packages