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
- Variables
- func NewRootCmd() *cobra.Command
- type ExternalPluginMeta
- type PluginLock
- type PluginSourceInfo
- type Table
- func (t *Table) AddRow(row []string)
- func (t *Table) AddRowWithID(id string, row []string)
- func (t *Table) EnableTerminalAwareWidth(colIndex, minWidth int)
- func (t *Table) EndBatch() *Table
- func (t *Table) Finish()
- func (t *Table) Render() string
- func (t *Table) SetColumnMaxWidth(colIndex, maxWidth int)
- func (t *Table) SetLive(live bool) *Table
- func (t *Table) StartBatch() *Table
- func (t *Table) UpdateRow(id string, columns map[string]string)
- func (t *Table) WithWriter(w io.Writer) *Table
Constants ¶
const (
// PluginLockFile is the name of the plugin lock file in the config directory.
PluginLockFile = "plugins.lock.json"
)
Variables ¶
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 ¶
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 (*Table) AddRow ¶
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
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 ¶
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) 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 ¶
Render formats and returns the table as a string (for static mode). For live mode, use Finish() to complete the table.
func (*Table) SetColumnMaxWidth ¶
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
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
StartBatch begins a batch operation where rendering is deferred. Call EndBatch() to render the accumulated changes.