cmd

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package cmd implements the CLI commands for TestGen.

This package uses Cobra for command-line parsing and Viper for configuration management, providing a hierarchical command structure:

  • testgen generate: Generate tests for source files
  • testgen validate: Validate existing tests and coverage
  • testgen analyze: Analyze codebase for cost estimation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version is set at build time via ldflags
	// -ldflags="-X github.com/princepal9120/testgen-cli/cmd.Version=v1.0.0"
	Version = "dev"
)

Functions

func Execute

func Execute() error

Execute 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.

func GetLogger

func GetLogger() *slog.Logger

GetLogger returns the configured logger

Types

type AnalysisResult

type AnalysisResult struct {
	Path            string               `json:"path"`
	TotalFiles      int                  `json:"total_files"`
	TotalFunctions  int                  `json:"total_functions"`
	TotalLines      int                  `json:"total_lines"`
	ByLanguage      map[string]LangStats `json:"by_language"`
	EstimatedTokens int                  `json:"estimated_tokens,omitempty"`
	EstimatedCost   float64              `json:"estimated_cost_usd,omitempty"`
	Files           []FileAnalysis       `json:"files,omitempty"`
}

type FileAnalysis

type FileAnalysis struct {
	Path      string `json:"path"`
	Language  string `json:"language"`
	Lines     int    `json:"lines"`
	Functions int    `json:"functions"`
	Tokens    int    `json:"estimated_tokens,omitempty"`
}

type LangStats

type LangStats struct {
	Files     int `json:"files"`
	Lines     int `json:"lines"`
	Functions int `json:"functions"`
}

Jump to

Keyboard shortcuts

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