cmd

package
v0.0.0-...-95da229 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AddKeyCmd = &cobra.Command{
	Use:   "add-key [API-KEY]",
	Short: "Add users API-KEY, this will store it in a yaml file.",
	Long: `Add users API-KEY, get the key from clockify.me/user/settings.
	At the bottom of the page, generate KEY.`,
	Run: func(cmd *cobra.Command, args []string) {
		key := ""
		if len(args) == 0 {
			key = viper.GetString("API-KEY")
		} else {
			key = args[0]
		}
		AddKey(key)
	},
}
View Source
var AddPartTimeCmd = &cobra.Command{
	Use:   "add-part-time",
	Short: "Add part-time work to your account",
	Long:  `Add part-time, if you have been working less during a time period.`,
	Run: func(cmd *cobra.Command, args []string) {

		AddPartTimeTimespan()
	},
}
View Source
var CheckBalanceCmd = &cobra.Command{
	Use:   "check-balance",
	Short: "Check balance",
	Long:  `Check the balance of the current account`,
	Run: func(cmd *cobra.Command, args []string) {

		CheckConfigAndPromptSetup()
		CheckBalance()
	},
}
View Source
var DefaultProjectCmd = &cobra.Command{
	Use:   "default-project",
	Short: "Select default workspace project",
	Long: `Display all workspace projects and 
	select the default project to use when starting a timer`,
	Run: func(cmd *cobra.Command, args []string) {

		CheckConfigAndPromptSetup()
		DefaultProject()
	},
}
View Source
var GetUserCmd = &cobra.Command{
	Use:   "current-user",
	Short: "get current user",
	Run: func(cmd *cobra.Command, args []string) {

		CheckConfigAndPromptSetup()
		getUser()
	},
}
View Source
var ListProjectsCmd = &cobra.Command{
	Use:   "list-projects",
	Short: "List all projects",
	Long:  `Display all projects in the current workspace`,
	Run: func(cmd *cobra.Command, args []string) {
		CheckConfigAndPromptSetup()
		ListProjects()
	},
}
View Source
var MenuCmd = &cobra.Command{
	Use:   "menu",
	Short: "Select action to perform",
	Long: `Display all available actions and
	select the action to perform`,
	Run: func(cmd *cobra.Command, args []string) {

		Menu()
	},
}
View Source
var SetupCmd = &cobra.Command{
	Use:   "setup",
	Short: "Setup",
	Long:  `Setup the application, this will ask you for your API key and store it in a yaml file.`,
	Run: func(cmd *cobra.Command, args []string) {
		Authenticate()
	},
}
View Source
var StartTimerCmd = &cobra.Command{
	Use:   "start-timer",
	Short: "Select a project and start a timer",
	Long: `Display all projects in the current workspace and
	select the project to start a timer in. A default project can be used`,
	Run: func(cmd *cobra.Command, args []string) {

		CheckConfigAndPromptSetup()
		StartProject()
	},
}
View Source
var StopTimerCmd = &cobra.Command{
	Use:   "stop-timer",
	Short: "Stop timer",
	Long:  `Stop the current timer`,
	Run: func(cmd *cobra.Command, args []string) {

		CheckConfigAndPromptSetup()
		StopTimer()
	},
}
View Source
var UpdateCmd = &cobra.Command{
	Use:   "update",
	Short: "Update clockify-cli",
	Long:  `Update clockify-cli to the latest version.`,
	Run: func(cmd *cobra.Command, args []string) {
		err := utils.Update()
		if err != nil {
			fmt.Printf("Error updating clockify-cli: %s", err)
		}
	},
}
View Source
var VerfiyMonthCmd = &cobra.Command{
	Use:   "verify-month",
	Short: "Verify month",
	Long:  `Verify the current month for missing entries`,
	Run: func(cmd *cobra.Command, args []string) {
		VerifyFullMonth()
	},
}

Functions

func AddKey

func AddKey(key string)

func AddPartTimeTimespan

func AddPartTimeTimespan()

func Authenticate

func Authenticate()

func CheckBalance

func CheckBalance()

func CheckConfigAndPromptSetup

func CheckConfigAndPromptSetup()

func DefaultProject

func DefaultProject()

func ListProjects

func ListProjects()
func Menu()

func StartProject

func StartProject()

func StopTimer

func StopTimer()

func VerifyFullMonth

func VerifyFullMonth()

Types

This section is empty.

Jump to

Keyboard shortcuts

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