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

auto_awesome

Declarative Power

Define your intent, not the execution. Spellcraft's engine optimizes your manifest for maximum efficiency across any environment.

hub

Native Resolution

Automatic dependency mapping and conflict resolution. No more circular references or broken state transitions.

extension

Scoped Extensibility

Inject custom logic via SpellFrame plugins. A sandboxed environment that ensures your scripts stay safe and predictable.

Quick Start Ritual

1

Install the Toolkit

Install the core library and CLI into your project directory.

Bash
npm install --save @c6fc/spellcraft
2

Summon a Plugin

Equip your environment with specialized plugins from the NPM registry.

Bash
npm install --save @c6fc/spellcraft-aws-auth
3

Writing Your Spell

Create a manifest.jsonnet file using standard Node resolution to orchestrate your infrastructure.

Jsonnet
// 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'
  }
}
4

Generate Artifacts

Trigger the engine to manifest your configuration into physical state.

Bash
npx spellcraft generate manifest.jsonnet

Local Magic

JavaScript files in spellcraft_modules/ are accessible in your spells using modules.<file_basename>.

spellcraft_modules/utils.js
// 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();
}];
manifest.jsonnet
Active
// 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.

  • visibility

    spellcraft --help

    Lists all available commands, including those added by active plugins.

  • auto_awesome

    spellcraft generate [file]

    Evaluates the Jsonnet manifest and renders resulting configuration artifacts.

extension 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.

  • badge

    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.

code SpellFrame Integration
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();
})();

Community Modules

Module Name Maintainer NPM Version License Download
@c6fc/spellcraft-aws-auth c6fc NPM Version License file_download
@c6fc/spellcraft-aws-terraform c6fc NPM Version License file_download
@c6fc/spellcraft-gcp-auth c6fc NPM Version License file_download
@c6fc/spellcraft-gcp-terraform c6fc NPM Version License file_download
@c6fc/spellcraft-terraform c6fc NPM Version License file_download