cli

package
v0.110.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: AGPL-3.0 Imports: 22 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cli is the outflare command line client: every API operation as a command, read from the OpenAPI document built into the binary.

outflare login                    save the server URL and an API token
outflare list-leads --q ana       call an operation (flags are its parameters and body fields)
outflare create-lead --email ana@acme-com.example --first-name Ana
outflare help create-webhook      what an operation takes and needs
outflare api GET /v1/whoami       call any path
outflare listen --forward-to URL  send new events to a local receiver

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GeneratePython

func GeneratePython(spec []byte) ([]byte, error)

GeneratePython writes the Python SDK's operations module from the API document: one method per operation, the same set the CLI has, so the SDK cannot fall behind the server. The engine's tests check that the committed file matches; regenerate it with go run ./engine/cmd/sdkgen.

func Run

func Run(ctx context.Context, env Env, args []string) int

Run runs one command line (without the program name) and returns the exit code.

Types

type Env

type Env struct {
	Stdin          io.Reader
	Stdout, Stderr io.Writer
	Getenv         func(string) string
	ConfigDir      string // where config.json lives; empty uses the user config dir
	HTTP           *http.Client
	Version        string
	// Spec is the OpenAPI document the commands come from.
	Spec []byte
	// TTY reports whether stdout is a terminal (pretty output).
	TTY bool
	// RetryBase is the first wait between retries, doubling each time;
	// zero means 500ms. Tests make it tiny.
	RetryBase time.Duration
}

Env is what a run reads from and writes to, so tests can drive it.

Jump to

Keyboard shortcuts

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