cli

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 35 Imported by: 0

Documentation

Overview

Package cli provides the command-line interface for Tinct.

Package cli provides the command-line interface for Tinct.

Package cli provides the command-line interface for Tinct.

Package cli provides the command-line interface for Tinct.

Package cli provides the command-line interface for Tinct.

Package cli provides the command-line interface for Tinct.

Package cli provides the command-line interface for Tinct.

Package cli provides the command-line interface for Tinct.

Package cli provides the command-line interface for Tinct.

Package cli provides the command-line interface for Tinct.

Package cli provides the command-line interface for Tinct.

Package cli provides the command-line interface for Tinct.

Package cli provides the command-line interface for Tinct.

Package cli provides the command-line interface for Tinct.

Package cli provides the command-line interface for Tinct.

Package cli provides command-line interface utilities.

Index

Constants

View Source
const (
	// PluginLockFile is the name of the plugin lock file in the config directory.
	PluginLockFile = "plugins.lock.json"
)

Variables

View Source
var (

	// RootCmd represents the base command when called without any subcommands.
	RootCmd = &cobra.Command{
		Use:   "tinct",
		Short: "A modern color palette generator",
		Long: `Tinct is a modern, extensible CLI tool that extracts color palettes from images
and generates configuration files for your favorite applications.

Extract vibrant color schemes from wallpapers and apply them system-wide to
terminal emulators, window managers, application launchers, and more.`,
		Version:      version.Short(),
		SilenceUsage: true,
	}
)

Functions

func NewRootCmd

func NewRootCmd() *cobra.Command

NewRootCmd adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the RootCmd.

Types

type ExternalPluginMeta

type ExternalPluginMeta struct {
	// Name is the plugin's actual name (from --plugin-info).
	Name string `json:"name"`

	// Path is the absolute path to the plugin executable.
	Path string `json:"path"`

	// Type is the plugin type (input or output).
	Type string `json:"type"`

	// Version is the plugin version if available.
	Version string `json:"version,omitempty"`

	// Description is the plugin description if available.
	Description string `json:"description,omitempty"`

	// Source contains structured information about where the plugin came from.
	Source *repository.PluginSource `json:"source,omitempty"`

	// SourceLegacy is the old string-based source field for backward compatibility.
	SourceLegacy string `json:"source_legacy,omitempty"`
}

ExternalPluginMeta contains metadata about an external plugin.

type PluginLock

type PluginLock struct {
	// ExternalPlugins maps plugin names to their metadata.
	ExternalPlugins map[string]*ExternalPluginMeta `json:"external_plugins,omitempty"`
}

PluginLock represents the plugin lock file structure. This file tracks installed external plugins and their sources.

type PluginSourceInfo

type PluginSourceInfo struct {
	URL      string
	FilePath string // For git repos, path to file within repo
	Ref      string // For git repos, branch/tag/commit
}

PluginSourceInfo represents the type of plugin source.

type Table

type Table struct {
	// contains filtered or unexported fields
}

Table represents a simple table formatter with dynamic column widths.

func NewTable

func NewTable(headers []string) *Table

NewTable creates a new table with the given headers.

func (*Table) AddRow

func (t *Table) AddRow(row []string)

AddRow adds a row to the table. For static tables, just adds the row. For live tables, you should use AddRowWithID instead.

func (*Table) AddRowWithID added in v0.1.11

func (t *Table) AddRowWithID(id string, row []string)

AddRowWithID adds or updates a row in the table with a unique identifier. This is the preferred method for live tables. id is a unique identifier for the row. row is the row data matching the headers.

func (*Table) EnableTerminalAwareWidth

func (t *Table) EnableTerminalAwareWidth(colIndex, minWidth int)

EnableTerminalAwareWidth enables terminal-aware width calculation for a column. The specified column will size to fit available terminal width (after other columns). minWidth specifies the minimum width for the column.

func (*Table) EndBatch added in v0.1.17

func (t *Table) EndBatch() *Table

EndBatch ends a batch operation and renders the table.

func (*Table) Finish added in v0.1.11

func (t *Table) Finish()

Finish completes the table rendering. For live mode, renders the final state (all updates were collected without rendering). For static mode, does nothing (use Render() instead).

func (*Table) Render

func (t *Table) Render() string

Render formats and returns the table as a string (for static mode). For live mode, use Finish() to complete the table.

func (*Table) SetColumnMaxWidth

func (t *Table) SetColumnMaxWidth(colIndex, maxWidth int)

SetColumnMaxWidth sets a maximum width for a specific column. Text longer than this will be wrapped to multiple lines.

func (*Table) SetLive added in v0.1.11

func (t *Table) SetLive(live bool) *Table

SetLive enables or disables live updating mode. In live mode, the table collects updates and renders the final state at Finish(). Intermediate updates are not rendered to avoid terminal compatibility issues.

func (*Table) StartBatch added in v0.1.17

func (t *Table) StartBatch() *Table

StartBatch begins a batch operation where rendering is deferred. Call EndBatch() to render the accumulated changes.

func (*Table) UpdateRow added in v0.1.11

func (t *Table) UpdateRow(id string, columns map[string]string)

UpdateRow updates specific columns in an existing row identified by ID. columns is a map of column name -> new value.

func (*Table) WithWriter added in v0.1.11

func (t *Table) WithWriter(w io.Writer) *Table

WithWriter sets the output writer for the table.

Jump to

Keyboard shortcuts

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