Welcome to the examples! Each plugin below is a fully working, buildable project you can use as a starting point for your own plugins. Build them all with make build-examples or go explore one at a time. 🚀
A configuration plugin that manages a small Pokedex – because every good config system needs Pokemon data. Demonstrates:
config.Plugin (List, Get, Set, Validate)plugin.ServeSee zhi-config-pokedex/main.go and the Configuration Plugin docs for details.
A transform plugin that evolves starter Pokemon before display. It’s super effective! Demonstrates:
transform.Plugin (BeforeDisplay, AfterSave, ValidatePolicy)See zhi-transform-pokedex/main.go and the Transform Plugin docs for details.
A store plugin that persists configuration trees as JSON files on disk. Simple, readable, debuggable. Demonstrates:
store.Plugin (Save, Load, Delete, ListTrees)ZHI_JSON_STORE_DIR environment variableThis example does not support versioning or encryption.
See zhi-store-json/main.go and the Store Plugin docs for details.
A store plugin that persists configuration trees in memory. Poof – gone when the process exits, perfect for testing. Demonstrates:
store.Plugin with the simplest possible backend (a Go map)This example does not support versioning or encryption.
See zhi-store-memory/main.go and the Store Plugin docs for details.
A store plugin backed by HashiCorp Vault’s KV v2 secrets engine. For when your configs need a bodyguard. Demonstrates:
VAULT_ADDR, VAULT_TOKEN, ZHI_VAULT_MOUNT, ZHI_VAULT_PREFIX)See zhi-store-vault/main.go and the Store Plugin docs for details.
A meta-plugin that mirrors writes to multiple stores – write once, persist everywhere. This is the prime example of the meta-plugin SDK in action. Demonstrates:
pkg/zhiplugin/launch/ to start child plugin processesstore.DelegatingPlugin to forward calls to a base storestore.MirroredPlugin to replicate writes across a primary and backup storeSee zhi-store-mirror/main.go and the Meta-Plugin SDK docs for details.
A config plugin written in Java using Bean Validation and GraalVM native-image. Proof that zhi plugins aren’t Go-only! Demonstrates:
@ConfigPrefix, @ConfigProperty)native-imageSee zhi-config-javabean/ and the Java Plugin Development docs for details.
A UI plugin that exposes the zhi configuration engine as an HTTP/JSON API. REST lovers, this one’s for you. Demonstrates:
ui.Plugin (Run, Capabilities) with RequiresTTY: falseController interface for all core operations (tree, export, apply, components)Apply output to HTTP clientsZHI_HTTP_ADDR environment variableSee zhi-ui-httpapi/main.go and the UI Plugin docs for details.
A UI plugin that exposes the zhi configuration engine as an MCP (Model Context Protocol) server over HTTP. Let your LLM do the configuring! Demonstrates:
ui.Plugin (Run, Capabilities) with RequiresTTY: falsepkg/mcpbridge/ library to register all MCP tools, resources, and promptsmcp.NewStreamableHTTPHandlercrypto/subtle.ConstantTimeCompareZHI_MCP_ADDR and auth token via ZHI_MCP_TOKENA builtin MCP stdio plugin (mcp-stdio) is also available for direct use with LLM clients that support stdio transport (e.g. Claude Desktop, Claude Code). Launch it with zhi edit --ui mcp-stdio.
See zhi-ui-mcp-sse/main.go and the UI Plugin docs for details.
A browser-based Web UI plugin that serves a full configuration editor on localhost. For when the terminal isn’t fancy enough. Demonstrates:
ui.Plugin (Run, Capabilities) with RequiresTTY: falseController interface for all core operationsSee zhi-ui-webui/ and the UI Plugin docs for details.