cli

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

Package cli implements the abs-mcp command line interface: the cobra commands, flag and config handling, and the MCP server exposing Audiobookshelf library tools to AI clients.

Index

Constants

This section is empty.

Variables

View Source
var DefaultToolsets = []string{"core"}

DefaultToolsets is what the binary registers when --toolsets is not given: enough to find things and read them, and nothing that writes. The whole surface is around 12,000 tokens of tool definitions before a question is asked, which is a poor thing to spend a client's context on by default. Ask for more with --toolsets, or --toolsets all for everything.

Functions

func Make

func Make() (*cobra.Command, error)

func ValidateParams

func ValidateParams(params []string) func(cmd *cobra.Command, args []string) error

Types

type FlagData

type FlagData struct {
	Server       string   `mapstructure:"server"`
	Token        string   `mapstructure:"token"`
	ReadOnly     bool     `mapstructure:"read-only"`
	EnableDelete bool     `mapstructure:"enable-delete"`
	Toolsets     []string `mapstructure:"toolsets"`
	AllowTools   []string `mapstructure:"allow-tools"`
	DenyTools    []string `mapstructure:"deny-tools"`
	Listen       string   `mapstructure:"listen"`
	AuthToken    string   `mapstructure:"auth-token"`
	AllowNoAuth  bool     `mapstructure:"allow-no-auth"`
	ProviderTag  string   `mapstructure:"provider-tag"`
	Providers    []string `mapstructure:"providers"`
}

func GetFlags

func GetFlags() *FlagData

GetFlags returns the fully populated FlagData. We must unmarshal from Viper instead of using globally bound pflags variables because pflags only parses command-line arguments. Viper merges environment variables (and config files) on top of the CLI flags.

func (*FlagData) NewClient

func (f *FlagData) NewClient() (*abs.Client, error)

func (*FlagData) ToolOptions

func (f *FlagData) ToolOptions() tools.Options

ToolOptions maps the flags onto the tool registration options.

Jump to

Keyboard shortcuts

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