@devix-cli/core
v1.0.0
Published
Devix foundations: version constant and the plugin API.
Readme
@devix-cli/core
Foundations of Devix: the version constant and the plugin API.
Part of Devix — a modular developer toolkit. Everything else in the monorepo builds on this package, which itself has zero dependencies.
Install
npm install @devix-cli/coreWhat's inside
Version constant
import { DEVIX_VERSION } from "@devix-cli/core";
console.log(DEVIX_VERSION); // the Devix release this package ships withPlugin API (metadata only)
Plugins are manifest metadata, never dynamic code. The registry validates shapes and ids, rejects duplicates and preserves registration order. It never evals, never uses new Function and never imports plugin code — loading third-party code is a deliberate human decision outside this API.
import { PluginError, PluginRegistry } from "@devix-cli/core";
const registry = new PluginRegistry((message) => new PluginError(message, "EINVALID"));
registry.register({
id: "docker",
name: "Docker",
version: "0.1.0",
description: "Docker diagnostics: availability, containers and images.",
commands: ["docker"],
});
registry.all(); // [{ manifest: { id: "docker", … } }]
registry.has("docker"); // trueAPI
| Export | Kind | Description |
| ------------------ | ----- | ------------------------------------------------------------ |
| DEVIX_VERSION | const | Devix version string shipped with the package |
| PluginRegistry | class | Validated plugin manifest registry keyed by stable plugin id |
| PluginError | class | Typed error (EINVALID, EDUPLICATE, EINCONSISTENT) |
| PluginManifest | type | id, name, semver version, description, commands? |
| RegisteredPlugin | type | A registered manifest |
Guarantees
- No dependencies. Core imports nothing, not even other Devix packages.
- Data is data, never code. Manifests are validated plain objects.
- Strict TypeScript, ESM only, Node.js 22+.
Part of Devix
MIT © hauchdev
