cli

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	History bool
	Help    bool
	Time    int
	Words   int
	File    string
	Text    string
	SetHelp bool
	Lang    string
	Host    int
	Join    string
	Name    string
)
View Source
var (
	Columns = []table.Column{
		{Title: "WPM", Width: 10},
		{Title: "RawWPM", Width: 10},
		{Title: "Acc", Width: 10},
		{Title: "Duration", Width: 10},
	}

	Rows = []table.Row{}
)
View Source
var ConfigCommand = &cobra.Command{
	Use:   "config",
	Short: "Configure your Couik preferences",
	Run: func(cmd *cobra.Command, args []string) {
		fmt.Println(cmd.Usage())
		os.Exit(0)
	},
}
View Source
var RootCmd = &cobra.Command{
	Use:   "couik",
	Short: "Your typing experience brought to the terminal",
	Run:   func(cmd *cobra.Command, args []string) {},
}
View Source
var SetCommand = &cobra.Command{
	Use:   "set",
	Short: "Set config preferences",
	Run: func(cmd *cobra.Command, args []string) {
		if len(args) < 2 {
			fmt.Println(cmd.Usage())
			os.Exit(0)
		}
		key, value := args[0], args[1]

		SetConfig(key, value)
		fmt.Printf("Setting %s to %s", key, value)

		os.Exit(0)
	},
}
View Source
var StatsCmd = &cobra.Command{
	Use:   "stats",
	Short: "display your stats",
	Run: func(cmd *cobra.Command, args []string) {
		DisplayStats()
		os.Exit(0)
	},
}
View Source
var (
	TimeWordsVals = []string{"15s", "30s", "60s", "120s", "quote", "w10", "w25", "w50", "w100", "w200"}
)

Functions

func DisplayHelp

func DisplayHelp()

func DisplayHistory

func DisplayHistory()

func DisplayStats added in v0.1.3

func DisplayStats()

func GetTextFromFile added in v0.1.1

func GetTextFromFile(filepath string) (string, error)

func Init

func Init()

func ParseConfigLang added in v0.1.3

func ParseConfigLang(language string) database.Language

func SetConfig added in v0.1.1

func SetConfig(key, value string)

Types

type Config added in v0.1.1

type Config struct {
	Mode           string `yaml:"mode"`            // default mode for quote typing
	DashboardASCII string `yaml:"dashboard_ascii"` // path for custom dashboard ascii
	QuoteType      string `yaml:"quote_type"`      // small, mid, thicc
	Time           string `yaml:"time"`            // prefered time (30, 60, etc...)
	Language       string `yaml:"language"`        // preferred language for tests
	Ghost          string `yaml:"ghost"`
}

func GetConfig added in v0.1.1

func GetConfig() Config

Jump to

Keyboard shortcuts

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