Plugin SDK (C ABI, version 3)
A plugin is a shared library that extends the engine with commands, frame hooks and editor panels. Any language that can export C symbols works; crates/ae_plugin_hello is a complete Rust example and crates/ae_plugin is the host side.
What a plugin exports
uint32_t neux_plugin_abi(void); // return 3
int32_t neux_plugin_init(const NeuxHost *host); // register things; return 0 for ok
typedef struct NeuxHost {
uint32_t abi_version;
void *ctx;
void (*log)(void *ctx, int32_t level, const char *msg); // 0 debug 1 info 2 warn 3 error
int32_t (*register_command)(void *ctx, const char *name, const char *description,
int32_t (*cb)(const char *args_json, char *out, size_t cap)); // 0 ok, -1 refused
// run an engine tool: bytes written to out, or < 0 with the error text in out
// (-1 not inside a callback, -2 the tool failed, -3 the answer did not fit)
int32_t (*call_tool)(void *ctx, const char *name, const char *args_json, char *out, size_t cap);
int32_t (*register_frame_hook)(void *ctx, void (*cb)(float dt)); // up to 16; 0 ok, -1 refused
int32_t (*register_panel)(void *ctx, const char *title, int32_t (*cb)(char *out, size_t cap)); // up to 8
} NeuxHost;
- Commands get their arguments as JSON text and write a JSON answer into
out(at most 1 MiB), returning the byte count; a negative return is an error and whatever text was written is the message. Names are[a-z0-9_.-], unique. - Frame hooks run every frame with the frame time.
- Panels are asked a few times a second for
{"rows": ["text", {"text": "Button", "command": "name"}]}; a row with acommandis a button that runs that plugin command. They appear in the editor's PLUGINS tab. - Tools (
call_tool): inside the editor window the scene tools (scene_entities,scene_inspect,scene_spawn,scene_despawn,scene_set,scene_remove,scene_undo,scene_redo,schema) on the live, undoable editor; underneux plugin call --project DIRevery toolneux mcpoffers (validated, undoable, confined to the project).
All strings are UTF-8 and NUL-terminated; the host keeps no pointer past a call. The host table stays valid while the library is loaded, so a plugin may keep the pointer. Fields of NeuxHost are only appended; a breaking change bumps the version, and a plugin reporting another version is refused. Load a library once per process (its globals are shared).
Where plugins run
By default a plugin runs in a child process (neux plugin-host LIB, JSON lines over stdio) inside an OS sandbox where one exists: macOS sandbox-exec and Linux bwrap give it no network and no file writes. Everywhere else it is still a separate process, so a crash or a hang (commands get 10 s, a frame-hook round 1.5 s) kills only the plugin, which then stays stopped; the editor carries on. The plugin's tool calls are forwarded to the editor, so it reaches only what the editor allows. neux plugin list LIB prints the isolation in force (os or process). --in-process / --plugin-in-process load into the editor's own process instead (faster; a crash takes the editor down) — only for plugins you wrote.
Not an OS sandbox on Windows, and not a WASM sandbox: a plugin may still read files and burn CPU. Treat a native plugin as code you chose to run.
Loading and trust
neux editor --plugin LIB(repeatable) loads the libraries you name.- The project's
Plugins/folder (.dylib/.so/.dll) loads only libraries signed by a key in your trust list ($NEUX_TRUST_FILE, else~/.neux/trusted-keys.txt: one public key in hex per line,#comments). Anything else is named in the Console and left alone, so opening someone's project never runs code they signed for no one you trust. - A shipped game (
neux player, what a build runs) also trusts the keys inPlugins/trusted-keys.txtinside its package; the build already copiesPlugins/. That checks the plugin is what the developer signed, not that you should trust the developer.
neux plugin keygen my.key # prints the public key; my.key is the secret (0600), never overwritten
neux plugin sign Plugins/mine.dylib --key my.key # writes Plugins/mine.dylib.neuxsig
neux plugin verify Plugins/mine.dylib # valid? signed by a key in your trust list?
echo "<public key> # my laptop" >> ~/.neux/trusted-keys.txt
A signature is Ed25519 over the file's SHA-256; changing one byte of the library breaks it. The same commands sign any file, so they work for other build artifacts too.
Running one
neux plugin list path/to/lib.dylib
neux plugin call path/to/lib.dylib hello '{"name":"Neux"}'
neux plugin call path/to/lib.dylib drop_marker --project MyGame --scene Scenes/main.scene.json --frames 60 --save Scenes/main.scene.json
In the editor, every command is in the Ctrl+K palette as Plugin: NAME; type JSON after it for arguments (Plugin: sum [1,2,3]). The answer or error goes to the Console.
Limits
Plugins cannot add components or editor windows beyond the PLUGINS tab, and inside the editor they cannot run tools other than the scene tools. No WASM interface exists (no runtime is vendored).
Plugin packages: a project as a preset for other projects
A plugin does not have to be code. Plugins tab > Package This Project packs the open project, or only the groups of files you tick (scenes, scripts, prefabs and materials, models, pictures and sounds, project settings), into one .neuxplugin file. It is kept in ~/.neux/packages/ (your library, the same in every project) and in the project's Packages/ folder (to share or keep in version control). Import Package lists the library, or takes a file, and copies its files into the open project at the same paths. A file the project already has with other contents is never overwritten: the package's copy goes to Imported/<name>/. The editor's caches (Library/), builds and the native plugins in Plugins/ are never packed, and a package can only hold project files.