Help us shape the future of Go! Take the 2026 Go Developer Survey

cli

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package cli exposes application use cases through commands and the terminal interface. Client factories resolve configuration lazily, after command flags have been parsed.

Index

Constants

This section is empty.

Variables

View Source
var Version string

Version can be set with -ldflags "-X github.com/vekio/overmind/internal/cli.Version=vX.Y.Z".

Functions

func New

New assembles CLI commands and opens the TUI when invoked without a subcommand. Client creation is deferred until an application operation is requested.

func NewSetupCommand

func NewSetupCommand(configFile *configlib.ConfigFile[appconfig.Settings]) *urfavecli.Command

NewSetupCommand creates the interactive initial configuration command.

Types

type Client

type Client interface {
	// GetRawNote loads managed source without requiring a valid body.
	GetRawNote(context.Context, rawedit.GetQuery) (rawedit.GetResult, error)
	// UpdateRawNote validates and saves source, reporting partial index failures.
	UpdateRawNote(context.Context, rawedit.UpdateCommand) (rawedit.UpdateResult, error)
	// GetPage loads and verifies the requested page document.
	GetPage(context.Context, page.GetQuery) (page.GetResult, error)
	// UpdatePage replaces editable page values while preserving identity and creation time.
	UpdatePage(context.Context, page.UpdateCommand) (page.UpdateResult, error)
	// GetInbox loads and verifies the requested inbox document.
	GetInbox(context.Context, inbox.GetQuery) (inbox.GetResult, error)
	// UpdateInbox replaces editable inbox values while preserving identity and creation time.
	UpdateInbox(context.Context, inbox.UpdateCommand) (inbox.UpdateResult, error)
	// GetBookmark loads and verifies the requested bookmark document.
	GetBookmark(context.Context, bookmark.GetQuery) (bookmark.GetResult, error)
	// UpdateBookmark replaces editable bookmark values while preserving identity and creation time.
	UpdateBookmark(context.Context, bookmark.UpdateCommand) (bookmark.UpdateResult, error)
	// GetPerson loads and verifies the requested person document.
	GetPerson(context.Context, person.GetQuery) (person.GetResult, error)
	// UpdatePerson replaces editable person values while preserving identity and creation time.
	UpdatePerson(context.Context, person.UpdateCommand) (person.UpdateResult, error)
	// GetHabit loads and verifies the requested habit document.
	GetHabit(context.Context, habit.GetQuery) (habit.GetResult, error)
	// UpdateHabit replaces editable habit values while preserving identity and creation time.
	UpdateHabit(context.Context, habit.UpdateCommand) (habit.UpdateResult, error)
	// ListGroups lists normalized group names assigned to people.
	ListGroups(context.Context, person.ListGroupsQuery) (person.ListGroupsResult, error)
	// DeleteNote removes source before its derived projection.
	DeleteNote(context.Context, notes.DeleteCommand) (notes.DeleteResult, error)
	// Reindex rebuilds the complete index from vault documents.
	Reindex(context.Context, notes.ReindexCommand) (notes.ReindexResult, error)
	// ListNotes queries filtered and paginated index summaries.
	ListNotes(context.Context, notes.ListQuery) (notes.ListResult, error)
	// CreateHabit validates and persists a new habit.
	CreateHabit(context.Context, habit.CreateCommand) (habit.CreateResult, error)
	// CreateBookmark validates and persists a new bookmark.
	CreateBookmark(context.Context, bookmark.CreateCommand) (bookmark.CreateResult, error)
	// CreateInbox validates and persists a new inbox.
	CreateInbox(context.Context, inbox.CreateCommand) (inbox.CreateResult, error)
	// CreateJournal validates and persists a new journal.
	CreateJournal(context.Context, journal.CreateCommand) (journal.CreateResult, error)
	// GetJournal loads and verifies the requested journal document.
	GetJournal(context.Context, journal.GetQuery) (journal.GetResult, error)
	// UpdateJournal replaces editable journal values while preserving identity and creation time.
	UpdateJournal(context.Context, journal.UpdateCommand) (journal.UpdateResult, error)
	// CreatePerson validates and persists a new person.
	CreatePerson(context.Context, person.CreateCommand) (person.CreateResult, error)
	// CreatePage validates and persists a new page.
	CreatePage(context.Context, page.CreateCommand) (page.CreateResult, error)
}

Client provides the note operations used by the CLI.

type ClientFactory

type ClientFactory func(context.Context) (Client, error)

ClientFactory creates the client after command flags have been parsed.

type LocalClient

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

LocalClient runs CLI operations against the in-process application.

func NewLocalClient

func NewLocalClient(application *app.Application) *LocalClient

NewLocalClient adapts an application running in this process to the CLI.

func (*LocalClient) CreateBookmark

func (client *LocalClient) CreateBookmark(ctx context.Context, command bookmark.CreateCommand) (bookmark.CreateResult, error)

CreateBookmark delegates to the corresponding application use case.

func (*LocalClient) CreateHabit added in v0.3.0

func (client *LocalClient) CreateHabit(ctx context.Context, command habit.CreateCommand) (habit.CreateResult, error)

CreateHabit forwards raw CLI input to the use case's domain validation.

func (*LocalClient) CreateInbox added in v0.3.0

func (client *LocalClient) CreateInbox(ctx context.Context, command inbox.CreateCommand) (inbox.CreateResult, error)

CreateInbox delegates to the corresponding application use case.

func (*LocalClient) CreateJournal

func (client *LocalClient) CreateJournal(ctx context.Context, command journal.CreateCommand) (journal.CreateResult, error)

CreateJournal delegates to the corresponding application use case.

func (*LocalClient) CreatePage

func (client *LocalClient) CreatePage(ctx context.Context, command page.CreateCommand) (page.CreateResult, error)

CreatePage delegates to the corresponding application use case.

func (*LocalClient) CreatePerson

func (client *LocalClient) CreatePerson(ctx context.Context, command person.CreateCommand) (person.CreateResult, error)

CreatePerson delegates to the corresponding application use case.

func (*LocalClient) DeleteNote

func (client *LocalClient) DeleteNote(ctx context.Context, command notes.DeleteCommand) (notes.DeleteResult, error)

DeleteNote delegates to the corresponding application use case.

func (*LocalClient) GetBookmark added in v0.4.0

func (client *LocalClient) GetBookmark(ctx context.Context, query bookmark.GetQuery) (bookmark.GetResult, error)

GetBookmark delegates to the corresponding application use case.

func (*LocalClient) GetHabit added in v0.4.0

func (client *LocalClient) GetHabit(ctx context.Context, query habit.GetQuery) (habit.GetResult, error)

GetHabit delegates to the corresponding application use case.

func (*LocalClient) GetInbox added in v0.4.0

func (client *LocalClient) GetInbox(ctx context.Context, query inbox.GetQuery) (inbox.GetResult, error)

GetInbox delegates to the corresponding application use case.

func (*LocalClient) GetJournal added in v0.4.0

func (client *LocalClient) GetJournal(ctx context.Context, query journal.GetQuery) (journal.GetResult, error)

GetJournal delegates to the corresponding application use case.

func (*LocalClient) GetPage added in v0.4.0

func (client *LocalClient) GetPage(ctx context.Context, query page.GetQuery) (page.GetResult, error)

GetPage delegates to the corresponding application use case.

func (*LocalClient) GetPerson added in v0.4.0

func (client *LocalClient) GetPerson(ctx context.Context, query person.GetQuery) (person.GetResult, error)

GetPerson delegates to the corresponding application use case.

func (*LocalClient) GetRawNote added in v0.4.0

func (client *LocalClient) GetRawNote(ctx context.Context, query rawedit.GetQuery) (rawedit.GetResult, error)

GetRawNote delegates to the corresponding application use case.

func (*LocalClient) ListGroups added in v0.4.0

func (client *LocalClient) ListGroups(ctx context.Context, query person.ListGroupsQuery) (person.ListGroupsResult, error)

ListGroups delegates to the corresponding application use case.

func (*LocalClient) ListNotes

func (client *LocalClient) ListNotes(ctx context.Context, query notes.ListQuery) (notes.ListResult, error)

ListNotes delegates to the corresponding application use case.

func (*LocalClient) Reindex added in v0.3.0

func (client *LocalClient) Reindex(ctx context.Context, command notes.ReindexCommand) (notes.ReindexResult, error)

Reindex delegates to the corresponding application use case.

func (*LocalClient) UpdateBookmark added in v0.4.0

func (client *LocalClient) UpdateBookmark(ctx context.Context, command bookmark.UpdateCommand) (bookmark.UpdateResult, error)

UpdateBookmark delegates to the corresponding application use case.

func (*LocalClient) UpdateHabit added in v0.4.0

func (client *LocalClient) UpdateHabit(ctx context.Context, command habit.UpdateCommand) (habit.UpdateResult, error)

UpdateHabit delegates to the corresponding application use case.

func (*LocalClient) UpdateInbox added in v0.4.0

func (client *LocalClient) UpdateInbox(ctx context.Context, command inbox.UpdateCommand) (inbox.UpdateResult, error)

UpdateInbox delegates to the corresponding application use case.

func (*LocalClient) UpdateJournal added in v0.4.0

func (client *LocalClient) UpdateJournal(ctx context.Context, command journal.UpdateCommand) (journal.UpdateResult, error)

UpdateJournal delegates to the corresponding application use case.

func (*LocalClient) UpdatePage added in v0.4.0

func (client *LocalClient) UpdatePage(ctx context.Context, command page.UpdateCommand) (page.UpdateResult, error)

UpdatePage delegates to the corresponding application use case.

func (*LocalClient) UpdatePerson added in v0.4.0

func (client *LocalClient) UpdatePerson(ctx context.Context, command person.UpdateCommand) (person.UpdateResult, error)

UpdatePerson delegates to the corresponding application use case.

func (*LocalClient) UpdateRawNote added in v0.4.0

func (client *LocalClient) UpdateRawNote(ctx context.Context, command rawedit.UpdateCommand) (rawedit.UpdateResult, error)

UpdateRawNote delegates to the corresponding application use case.

Jump to

Keyboard shortcuts

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