cli

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: MPL-2.0 Imports: 45 Imported by: 0

Documentation

Overview

Package cli holds the txco subcommand surface — the developer-facing rule-authoring loop. Subcommands live in their own files (init.go, apply.go, diff.go); this file is just the dispatcher.

The dispatcher is invoked from chassis/main.go before the server-mode config loader, so subcommands can declare their own flag namespaces without colliding with the server's --web-addr et al.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dispatch

func Dispatch(args []string, stdout, stderr io.Writer) (status int, ok bool)

Dispatch routes a `txco <subcommand> ...` invocation to the right command. Returns ok=true if a subcommand was dispatched (caller should exit with the returned status code) and ok=false if the args don't name a known subcommand (caller should fall through to server-mode boot).

args is typically os.Args; args[0] is the program name, args[1] is the subcommand. `serve` is recognized but treated as a no-op so the server-mode boot can run.

Bare `txco` prints help (Stripe/gcloud-style) — starting the server now requires the explicit `txco serve`. Server-mode flags (e.g. `txco --web-addr=:8080`) still fall through for back-compat.

Types

type ResolvedTarget

type ResolvedTarget struct {
	Name    string
	Chassis string
	// ChassisExplicit is true when Chassis came from real config
	// (txco.yaml target / legacy addr), false when it's the
	// synthesized http://localhost:8081 fallback. Lets resolveTarget
	// prefer the signing profile's bound chassis_url over a blind
	// localhost default, without overriding an explicit config.
	ChassisExplicit bool
	User            string
	Pass            string
	Mock            string // "allow" | "deny"
	Operations      map[string]operationConfig
}

ResolvedTarget is what apply / diff / dev consume. It's flat by design: no operation merging or auth lookup happens past this point.

func (ResolvedTarget) AsClientTarget

func (t ResolvedTarget) AsClientTarget() client.Target

AsClientTarget reduces a ResolvedTarget to the subset the admin HTTP client needs (URL + basic auth). Kept separate so the dev/apply code paths can keep all the operation map / mock policy bits without leaking them into the client package.

Directories

Path Synopsis
Package auth implements the `txco auth …` CLI surface — keygen, dev enrollment, signed whoami, key rotation, and revocation.
Package auth implements the `txco auth …` CLI surface — keygen, dev enrollment, signed whoami, key rotation, and revocation.
Package banner holds the txco logo + small TTY helpers used by every subcommand's help/usage screen.
Package banner holds the txco logo + small TTY helpers used by every subcommand's help/usage screen.
Package bundle walks an on-disk OPS/ tree and produces a flat list of (stack, scope, name, txcl, mock_req, mock_res) records suitable for POSTing to the admin /v1/ops/import endpoint.
Package bundle walks an on-disk OPS/ tree and produces a flat list of (stack, scope, name, txcl, mock_req, mock_res) records suitable for POSTing to the admin /v1/ops/import endpoint.
Package client is the small HTTP client the txco CLI uses to talk to a running chassis admin server.
Package client is the small HTTP client the txco CLI uses to talk to a running chassis admin server.
Package dev contains the process-spawning, health-checking, and file-watching helpers used by `txco dev`.
Package dev contains the process-spawning, health-checking, and file-watching helpers used by `txco dev`.
Package compute implements the authoring CLI for sandboxed op:// computes (wired as `txco op`).
Package compute implements the authoring CLI for sandboxed op:// computes (wired as `txco op`).
Package oprefs resolves `op://NAME` symbolic references in txcl rule bodies to concrete URLs based on a workspace's operations registry.
Package oprefs resolves `op://NAME` symbolic references in txcl rule bodies to concrete URLs based on a workspace's operations registry.
Package signer is the CLI-side RFC 9421 signing surface.
Package signer is the CLI-side RFC 9421 signing surface.
Package state owns the .txco/<stack>.state.json file the txco CLI writes after a `pull` and reads on `push`.
Package state owns the .txco/<stack>.state.json file the txco CLI writes after a `pull` and reads on `push`.
Package template fetches a starter tree from a remote source and copies it into a local directory.
Package template fetches a starter tree from a remote source and copies it into a local directory.

Jump to

Keyboard shortcuts

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