cli

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2026 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package cli wires unison's command-line interface together.

unison is a sqlc codegen plugin and the orchestrator that drives it. The two modes share one binary, so this package owns the one decision that separates them and the logging setup they both use.

Logging is stdlib slog to stderr, and that is not a style preference. In plugin mode sqlc hands the process a CodeGenRequest on stdin and reads a CodeGenResponse protobuf back from stdout, so stdout is a protocol channel: anything else written there corrupts the response. Nothing in this module may print to stdout outside of a command that owns its own output.

Index

Constants

View Source
const CommandName = "unison"

CommandName is the name the CLI reports for itself. It is the tool's name rather than the module's, because that is what a consumer types and what .unison-version pins.

Variables

This section is empty.

Functions

func Execute

func Execute(ctx context.Context) error

Execute dispatches to one of unison's two modes.

Plugin mode is not a subcommand, because sqlc does not call it like one: it passes the gRPC method to invoke as the first argument, writes a request to stdin, and expects a response on stdout. Deciding here — before cobra sees the arguments — is what keeps that call from being parsed as a typo.

Types

This section is empty.

Directories

Path Synopsis
Package pluginenv names the environment unison's two modes share.
Package pluginenv names the environment unison's two modes share.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL