kongcli

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddCmd

type AddCmd struct {
	Logger    Logger `kong:"-"`
	Name      string `short:"n" help:"The name of the bookmark"`
	Directory string `short:"d" help:"The bookmarked directory"`
}

func (*AddCmd) Run

func (c *AddCmd) Run(s *storepkg.Store) error

type CLI

type CLI struct {
	Debug bool `help:"Enable debug logging to ~/.local/state/cdbm/logs.jsonl" short:"D"`

	Add    AddCmd    `cmd:"" help:"Add a new entry"`
	List   ListCmd   `cmd:"" help:"List existing entries"`
	Init   InitCmd   `cmd:"" help:"Generate shell initialization code"`
	Edit   EditCmd   `cmd:"" help:"Edit an existing bookmark (rename or move)"`
	Delete DeleteCmd `cmd:"" help:"Delete an existing bookmark"`
	Cd     CdCmd     `cmd:"" help:"Change directory to bookmark"`
}

func New

func New(store *store.Store) *CLI

func Parse

func Parse(store *store.Store) (*kong.Context, *CLI)

func (*CLI) BeforeApply

func (c *CLI) BeforeApply() error

type CdCmd

type CdCmd struct {
	Logger Logger `kong:"-"`
	Name   string `arg:"" help:"Bookmark name"`
}

func (*CdCmd) Run

func (c *CdCmd) Run(store *store.Store) error

type DeleteCmd

type DeleteCmd struct {
	Name   string `arg:"" help:"Name of the bookmark to delete"`
	Logger Logger `kong:"-"`
}

func (*DeleteCmd) Run

func (c *DeleteCmd) Run(store *store.Store) error

type EditCmd

type EditCmd struct {
	Name      string `arg:"" help:"Name of the bookmark to edit" optional:"" name:"bookmark-name"`
	NewName   string `name:"name" short:"n" help:"The new name of the bookmark"`
	Directory string `name:"directory" short:"d" help:"The new bookmarked directory"`
	Logger    Logger `kong:"-"`
}

func (*EditCmd) Run

func (c *EditCmd) Run(store *store.Store) error

type InitCmd

type InitCmd struct {
	Logger Logger `kong:"-"`
	Shell  string `arg:"" help:"Shell type (zsh, bash, fish)"`
}

func (*InitCmd) Run

func (c *InitCmd) Run(store *store.Store) error

type ListCmd

type ListCmd struct {
	Logger Logger `kong:"-"`
}

func (*ListCmd) Run

func (c *ListCmd) Run(store *store.Store) error

type Logger

type Logger interface {
	Log(action string, details map[string]any) error
}

Jump to

Keyboard shortcuts

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