Skip to content

plugin-example-command

Placement compiled-in (in-process)
Source github.com/opencharly/plugin-example-command/candy/plugin-example-command
Version 2026.175.0900
Candy plugin-example-command

This plugin is listed in charly/charly.yml’s compiled_plugins:, so its providers are compiled into the charly binary and register in-process.

The reserved words this plugin serves:

  • examplecommand — command class

Reference OUT-OF-TREE charly COMMAND-class plugin — a standalone Go module (go.mod + main.go) contributing the examplecommand command via the charly plugin SDK (github.com/opencharly/sdk). On charly examplecommand <args…>, charly’s CLI dispatch (provider_command_external.go dispatchExternalCommand) RESOLVES this plugin’s binary (host-built from source, or baked into a deployed image) and syscall.Exec’s it with the pass-through tokens in CLI mode (sdk.Main → cliMain). The plugin therefore owns real terminal stdio and does ONE observable, deterministic thing: it PRINTS the joined args to STDOUT, so a test can assert the command ran, received its args, AND reached a real stdout. The command-class companion of the verb-class candy/plugin-example-external. The command class is external-capable: charly prescans examplecommand into the CLI grammar and fork/execs this binary on a charly examplecommand invocation.

The CUE schema below is the authoritative grammar for this plugin’s input. It is the same single source that generates the plugin’s Go parameter types and answers the runtime Describe RPC, so this page cannot disagree with either.

// plugin-example-command's OWN self-contained CUE schema — the SINGLE SOURCE for this plugin's
// served declaration surface (there is no schema-less plugin: every plugin ships a
// non-empty schema over Describe).
//
// SELF-CONTAINED and PACKAGE-LESS: it references no base def and carries no package
// clause, so it compiles STANDALONE — the property the SDK's serve-side compile needs
// and the property that lets the host splice `base ++ plugin` at the load gate
// (registerPluginUnitSchema); a self-contained schema that will not splice is a LOUD
// load failure.
//
// NO GO CONSUMER: the plugin declares no typed `plugin_input` (its authored input is
// its pass-through CLI grammar), so this schema generates NO `params` package and has
// NO `cue exp gengotypes` artifact — it is the SERVED documentation/config surface,
// not a code-generation source.
//
// It DOCUMENTS the `command: examplecommand` contract (the `OpRun {args: [...]}` envelope).
#ExampleCommandPlugin: {
// The command word the plugin serves.
command: "examplecommand"
// What the command does, in one line (the public-docs surface).
contract: string & !=""
}

See also the candy reference for this candy’s install surface.