zhi

zhi

zhi

CI Release Go Report Card codecov Go Go Reference License: MIT Contributor Covenant

zhi is a modern platform for configuration management and provisioning. It gives you an extensible plugin system that auto-generates a friendly terminal UI, while keeping all your configs secure by default. Think of it as โ€œVault meets Terraform, but for your app configโ€. ๐Ÿ”

๐ŸŽฏ Core Principles

  1. ๐Ÿ›ก๏ธ Configuration & Validation โ€“ structured, validated settings that catch misconfigurations before they reach production.
  2. ๐Ÿ” Secure Storage โ€“ encrypted at rest, so confidentiality and compliance come out of the box.
  3. ๐Ÿงฉ Modularity โ€“ an extensible plugin system that supports multiple provisioning backends (Docker Compose, Kubernetes, Helm, and beyond).

โœจ Features


๐Ÿš€ Getting Started

Prerequisites

Installation

From a release (recommended):

# Linux amd64
curl -sSL https://github.com/MrWong99/zhi/releases/latest/download/zhi_linux_amd64.tar.gz | tar xz
sudo mv zhi /usr/local/bin/

# macOS arm64 (Apple Silicon)
curl -sSL https://github.com/MrWong99/zhi/releases/latest/download/zhi_darwin_arm64.tar.gz | tar xz
sudo mv zhi /usr/local/bin/

From source:

go install github.com/MrWong99/zhi/cmd/zhi@latest

Build from repository:

git clone https://github.com/MrWong99/zhi.git
cd zhi
make build

The binary lands in bin/. Youโ€™re ready to roll! ๐ŸŽ‰

Quick Start

# Initialize a new workspace
zhi init

# View all configuration paths
zhi list paths

# Get a specific value
zhi get database/host

# Set a value
zhi set database/host mydb.example.com

# Validate the configuration
zhi validate

# Export as JSON
zhi export --format json

# Launch an editor
zhi edit

๐Ÿ’ป Interactive TUI Editor

zhi edit tui

๐ŸŒ Web UI Editor

zhi edit webui

๐Ÿค– MCP Server (for LLM Clients)

zhi includes built-in MCP (Model Context Protocol) support, allowing LLM clients like Claude Desktop, Claude Code, and Cursor to manage configurations programmatically. Your AI assistant can now tweak your configs โ€“ what a time to be alive!

Stdio transport (recommended for local use):

zhi edit --ui mcp-stdio

Configure in Claude Desktopโ€™s claude_desktop_config.json:

{
  "mcpServers": {
    "zhi": {
      "command": "zhi",
      "args": ["edit", "--ui", "mcp-stdio"],
      "cwd": "/path/to/workspace"
    }
  }
}

HTTP transport (for remote/network access): install the zhi-ui-mcp-sse external plugin. See examples/zhi-ui-mcp-sse/.

๐Ÿ“ฆ Components

Components group related configuration into named bundles that users can toggle:

# List components and their status
zhi list components

# Enable a component (auto-enables dependencies)
zhi component enable redis

# Disable a component
zhi component disable monitoring

Components defined in zhi.yaml control which paths appear in exports and the TUI. See the Components guide for details.

๐Ÿ” Verbose / Debug Logging

Pass --verbose to any command to enable debug-level logging to stderr:

zhi validate --verbose

๐Ÿ“š User Guide

Detailed documentation for using zhi:


๐Ÿ”Œ Plugin Development

zhiโ€™s plugin system supports four types: config, transform, store, and UI. Plugins are separate binaries communicating over gRPC โ€“ so they can be written in any language that speaks gRPC.

๐Ÿงช Examples

The examples/ directory contains fully working plugins you can build and experiment with. Go ahead, break things โ€“ thatโ€™s what examples are for! ๐Ÿ”ฌ

Example Type What it demonstrates
zhi-config-pokedex Config Typed values, metadata, validation โ€“ gotta validate โ€˜em all!
zhi-transform-pokedex Transform Tree mutation, value mapping
zhi-store-json Store File-based persistence
zhi-store-memory Store Minimal in-memory store
zhi-store-vault Store HashiCorp Vault KV v2 backend
zhi-store-mirror Store (meta) Meta-plugin: mirrors writes to memory + JSON file
zhi-ui-httpapi UI HTTP/JSON API with SSE streaming
zhi-ui-mcp-sse UI MCP server over HTTP for LLM clients
zhi-ui-webui UI Browser-based Web UI
zhi-config-javabean Config Java plugin with Bean Validation and GraalVM native-image

All Go example plugins are published to the GitHub Container Registry on every release and can be installed directly:

zhi plugin install oci://ghcr.io/mrwong99/zhi/zhi-store-memory:v0.0.9

See Sharing and Registries for the full list and details.

Build everything locally with:

make build-all

See the examples README for more details.


๐Ÿข Enterprise Mirror (zhi-mirror)

For enterprise and air-gapped environments, zhi-mirror provides a local registry mirror with:

# Start the mirror server
zhi-mirror serve --listen :5050 --upstream-registry ghcr.io

# Export artifacts for air-gapped transfer
zhi-mirror export --artifacts zhi-project/zhi-config-ansible:v1.2.0 --output bundle.tar

# Import into an air-gapped mirror
zhi-mirror import --input bundle.tar

Clients point to the mirror by setting sharing.defaultRegistry in ~/.zhi/config.yaml or via the ZHI_REGISTRY environment variable. See the Enterprise Mirror guide for the full documentation.


๐Ÿค Contributing

Contributions are welcome โ€“ whether itโ€™s a bug fix, a new plugin idea, or improving documentation. Every contribution helps zhi evolve. โค๏ธ

Please read the Contributing Guide to get started. The short version:

git clone https://github.com/MrWong99/zhi.git
cd zhi
make deps
make check

Before opening a pull request, make sure make check passes.


๐ŸŒ Community


๐Ÿ€„ The Origin of the Name

zhi logo

The name zhi (pronounced roughly โ€œjrrโ€ in Mandarin) carries layered meanings:

This multiplicity reflects the projectโ€™s vision: to arrange systems securely, with wisdom in design, while remaining flexible and modular.


๐Ÿ“œ License

MIT โ€“ Copyright (c) 2025 Lukas Schmidt