Skip to main content
Version: 0.17.0

Taking the Plugins

An application is written from Plugins that exist, and a Plugin reaches it as two files: its executable, built for the application's architecture, and its Manifest. The composer takes a Plugin from its source: it builds it for the application, places the two files in the project, declares the unit and records where the Plugin came from. Whether you wrote the Plugin or somebody else did changes where its source is, and nothing after that.

Build an application from Plugins that exist — yoke-compose in 70 seconds

The example composes two Plugins:

PluginIts authorWhat it does
com.example.greeteryou, in Building a Pluginanswers greeter.hello with a greeting, and is told which greeting with greeter.set
com.yoke.system-infothe Yoke project, in the repository yoke-plugin-system-info, published at a taganswers system.info with what host it runs on, and publishes the stream system.uptime

Make the project​

From the directory that holds greeter/, make the application's project beside it:

yoke-compose init com.example.hello --dir hello --version 0.1.0 --arch x86_64 --core ">=0.17.0"
com.example.hello made: hello/yoke.yaml, with manifests/ and components/ beside it
OptionIs
com.example.hellothe application's identifier
--versionthe application's own version, not Yoke's and not any Plugin's
--archthe architecture its executables are built for, as uname -m prints it
--corethe range of Core versions it runs on; a host whose Core is outside it refuses the package

Take the greeter​

Your own Plugin is the Plugin project you made in Building a Plugin. Take it from its path, in hello/:

cd hello
yoke-compose add plugin ../greeter
Taking com.example.greeter runs its author's build.
source: ../greeter
commit: e975b4171b590beb86322dc10ed4866cb3fd1a9d
in: plugin/
command: CGO_ENABLED=0 GOOS=linux GOARCH="$YOKE_GOARCH" GOFLAGS=-mod=mod go build -trimpath -o "$YOKE_OUT/greeter" .
Run it? [y/N] y
took ../greeter as the unit greeter, recorded in plugins.yaml

A Plugin whose Manifest needs a device is taken with its binding, since a unit that binds nothing to the need is refused: name the device with --bind, once for each need.

yoke-compose add plugin ../camera --bind camera=/dev/video0

Taking a Plugin runs its author's build, on your machine, so the composer shows what it will run and asks first. Read the command before answering: it is the author's, and it runs as you. --yes answers for a script, and --as <unit> names the unit something other than the program.

What it did: the executable is in components/plugins/greeter, built for the descriptor's arch; the Manifest, as the author keeps it, is in manifests/com.example.greeter.yaml; the unit greeter is declared with the executable's digest pinned. And it recorded where the Plugin came from, in plugins.yaml beside the descriptor:

hello/plugins.yaml
plugins:
- id: com.example.greeter
unit: greeter
source: ../greeter
tag: null
commit: e975b4171b590beb86322dc10ed4866cb3fd1a9d
clean: true
arch: x86_64
digest: sha256:a700b8da21fda0a76389c7027d393531662c97a96702479915ccfd75733bbb73
taken: 2026-11-05T17:46:42Z

plugins.yaml is the project's memory, not the application's: no package carries it, and nothing in it is granted to anybody. A path has no tag; the commit and clean say what the tree was when it was taken.

Take system-info, by its tag​

A Plugin published at a tag is taken by its repository and its tag, the same way. system-info is the first Plugin the Yoke project publishes, as a Plugin project in a repository of its own, so it is taken as yours would be once you hand it on. In hello/:

yoke-compose add plugin https://github.com/yoke-project/yoke-plugin-system-info@v0.1.0
Taking com.yoke.system-info runs its author's build.
source: https://github.com/yoke-project/yoke-plugin-system-info
tag: v0.1.0
commit: 13a52ac04353782f4db8fda048d03d777b14ce38
in: plugin/
command: cargo build --release --target "$YOKE_RUST_TARGET" && cp "target/$YOKE_RUST_TARGET/release/system-info" "$YOKE_OUT/system-info"
Run it? [y/N] y
took https://github.com/yoke-project/yoke-plugin-system-info@v0.1.0 as the unit system-info, recorded in plugins.yaml

The composer fetches the repository at the tag, shows the commit the tag names, and runs the author's build — here Cargo's, since system-info is written in Rust, with the target the descriptor's arch names. Its first build downloads and compiles the crates it depends on, and takes a minute.

hello/plugins.yaml
plugins:
- id: com.example.greeter
unit: greeter
source: ../greeter
tag: null
commit: e975b4171b590beb86322dc10ed4866cb3fd1a9d
clean: true
arch: x86_64
digest: sha256:a700b8da21fda0a76389c7027d393531662c97a96702479915ccfd75733bbb73
taken: 2026-11-05T17:46:42Z
- id: com.yoke.system-info
unit: system-info
source: https://github.com/yoke-project/yoke-plugin-system-info
tag: v0.1.0
commit: 13a52ac04353782f4db8fda048d03d777b14ce38
clean: true
arch: x86_64
digest: sha256:9320c9e8a297ae020a09fcad772ed359167cdcf95534614f095d753ee8046ad1
taken: 2026-11-10T16:02:40Z

A tag is what a later update moves: yoke-compose update plugin com.yoke.system-info --to <tag> takes another version of it (the project), and yoke-compose plugins lists what was taken. The same tag built with another Rust toolchain may give another digest; the project pins the one it built.

A unit is not a Plugin. The unit is what this application runs, under its own name; the Plugin is the program it is launched from. One Plugin may be several units — two add unit naming one --plugin — and the operator authorises the Plugin once for all of them (vocabulary).

Read what each one declares​

A Manifest is what you will ask the operator to grant, so read it before composing the Plugin. system-info declares one question and one stream, each governed by a capability:

hello/manifests/com.yoke.system-info.yaml
manifest: 1
id: com.yoke.system-info
protocol: 1
streams:
- id: system.uptime
tolerates_loss: true
queries:
- id: system.info
capabilities:
- name: query.info.answer
governs:
query: system.info
- name: stream.uptime.publish
governs:
stream: system.uptime

An application uses what it needs of a Plugin, and the rest stays withheld. This one asks the host's description and the greeting, and tells the greeter which greeting to use, so the operator grants three capabilities: query.info.answer, query.hello.answer and command.set.accept. The other two are declared, never granted, and the two Plugins are admitted without them (admission).

A Plugin's identity is how everything after this names it: the project's units, the operator's grants, the log. A Plugin taken from somebody else keeps the identity its author gave it, and the project's Manifest is stored under it, as manifests/<identity>.yaml.

The same, by hand

Without the composer, a Plugin is gathered by hand: its two files copied into the project, and its unit declared with add unit, pinning the executable by digest. From the directory that holds hello/, with the greeter built (handing it on):

mkdir -p hello/components/plugins
cp greeter/build/x86_64/greeter hello/components/plugins/
cp greeter/plugin/com.example.greeter.yaml hello/manifests/
yoke-compose add unit greeter --dir hello --kind plugin --plugin com.example.greeter \
--exec components/plugins/greeter
wrote units.greeter in hello/yoke.yaml

Nothing records where the files came from: that is what plugins.yaml adds. A new build is copied in again, and its digest written again with set (the project).