cli

package
v2.3.111 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Commands

func Commands() []*C.Command

func CpCommand

func CpCommand() *C.Command

CpCommand returns the CLI command for copying files from source to destination

func EmbedCommand

func EmbedCommand() *C.Command

EmbedCommand returns the CLI command for generating embed declarations

func ExamplesCommand

func ExamplesCommand() *C.Command

ExamplesCommand returns the CLI command for managing Go examples

func LensCommand

func LensCommand() *C.Command

LensCommand creates the CLI command for lens generation.

Two modes are supported:

  1. Annotation mode (default): scans Go files in --dir for structs annotated with "fp-go:Lens" and generates lenses for them.

  2. Type-name mode (--type flag, following the stringer convention): accepts a comma-separated list of struct names and optional package patterns as positional arguments (default "."). Uses go/packages for full type resolution — generics, external field types, and struct tags are all handled correctly without requiring source annotations.

func McpCommand

func McpCommand() *C.Command

McpCommand returns the CLI command for starting the MCP server

Types

type Example

type Example struct {
	ID         string // "package::ExampleName"
	Package    string
	Symbol     string // "Type.Method" parsed from func name
	Name       string // "ExampleType_Method"
	Code       string
	DocComment string
	Output     string // contents of // Output: block
	Imports    string // import statements needed by the example
	File       string
}

Example represents a Go example function

Directories

Path Synopsis
Package lenses contains the pure utility functions used by the lens code generator.
Package lenses contains the pure utility functions used by the lens code generator.

Jump to

Keyboard shortcuts

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