SpellCraft: The Sorcerer's Toolkit
A high-performance orchestration engine designed for modern developers who treat their infrastructure like a ritual. Spellcraft transforms complex declarative manifests into living, breathing artifacts with minimal overhead and maximum elegance.
The Triad of Power
Declarative Power
Define your intent, not the execution. Spellcraft's engine optimizes your manifest for maximum efficiency across any environment.
Native Resolution
Automatic dependency mapping and conflict resolution. No more circular references or broken state transitions.
Scoped Extensibility
Inject custom logic via SpellFrame plugins. A sandboxed environment that ensures your scripts stay safe and predictable.
Quick Start Ritual
Install the Toolkit
Install the core library and CLI into your project directory.
npm install --save @c6fc/spellcraft
Summon a Plugin
Equip your environment with specialized plugins from the NPM registry.
npm install --save @c6fc/spellcraft-aws-auth
Writing Your Spell
Create a manifest.jsonnet file using standard
Node resolution to orchestrate your infrastructure.
// Import spellcraft features local spellcraft = import 'spellcraft'; // Import plugin via standard node resolution local aws = import '@c6fc/spellcraft-aws-auth/module.libsonnet'; { 'identity.json': aws.getCallerIdentity(), 'bucket.json': { BucketName: 'spellcraft-artifacts', Region: spellcraft.envvar('AWS_REGION') || 'us-east-1' } }
Generate Artifacts
Trigger the engine to manifest your configuration into physical state.
npx spellcraft generate manifest.jsonnet
Local Magic
JavaScript files in spellcraft_modules/ are accessible in your
spells using modules.<file_basename>.
// Export native JS functions exports.shout = [(text) => text.toUpperCase() + "!!!", "text"]; exports.add = [(a, b) => a + b, "a", "b"]; // Non-arrow functions gain access to 'this' (the plugin context) exports.get_id = [function() { return this.aws.sts().getCallerIdentity().promise(); }];
// Import local aggregator local modules = import 'modules'; { 'test.json': { message: modules.utils.shout("hello"), sum: modules.utils.add(10, 5) } }
The Master CLI
The CLI is the primary interface for interacting with the SpellCraft engine. It provides a simple and intuitive way to manage your spells and artifacts. Plugins can add subcommands to the CLI.
-
spellcraft --help
Lists all available commands, including those added by active plugins.
-
spellcraft generate [file]
Evaluates the Jsonnet manifest and renders resulting configuration artifacts.
Plugin-Extended Mastery
SpellCraft's CLI is dynamically extensible. When you install a module, it can register new subcommands that provide direct access to its specialized capabilities.
-
spellcraft aws-identity
Added by
@c6fc/spellcraft-aws-auth. Performs a live STS call to verify your current AWS identity.
Programmatic API
For complex integrations, use the SpellFrame engine
directly within your Node.js or TypeScript projects. This allows for dynamic manifest generation based
on real-time runtime data.
const { SpellFrame } = require('@c6fc/spellcraft'); const path = require('path'); const frame = new SpellFrame(); (async () => { // 1. Initialize: Loader scans package.json await frame.init(); // 2. Render: Evaluates the Jsonnet const result = await frame.render(path.resolve('./manifest.jsonnet')); // 3. Write: Outputs files to ./render frame.write(); })();