utils

package
v0.99.16 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package utils provides shared CLI utility functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(cmd *cobra.Command) (*client.Client, error)

NewClient builds an API client from CLI flags, environment variables, and stored config. Server URL resolution order: --server-url, FLOWBOT_SERVER_URL, then stored server_url. Token resolution order: FLOWBOT_TOKEN, then stored token file.

func NewPublicClient

func NewPublicClient(cmd *cobra.Command) (*client.Client, error)

NewPublicClient builds an API client that can call public endpoints without a token. Server URL resolution matches NewClient. Returns an error when no server URL is configured.

func ResolveServerURL

func ResolveServerURL(cmd *cobra.Command) (string, error)

ResolveServerURL returns the Flowbot server URL from flags, env, or stored config. Resolution order: --server-url, FLOWBOT_SERVER_URL, then stored server_url.

Types

This section is empty.

Jump to

Keyboard shortcuts

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