Documentation
¶
Index ¶
- func Execute(args []string) (err error)
- func ExitCode(err error) int
- func GetTokenSource(ctx context.Context, flags *RootFlags) (oauth2.TokenSource, int64, error)
- func NewClientFromFlags(ctx context.Context, flags *RootFlags) (*api.Client, error)
- func VersionString() string
- type ApprovalsApproveCmd
- type ApprovalsCmd
- type ApprovalsListCmd
- type ApprovalsRejectCmd
- type ApprovalsSubmitCmd
- type ApprovalsUnsubmitCmd
- type AuthCmd
- type AuthListCmd
- type AuthLoginCmd
- type AuthLogoutCmd
- type AuthSetupCmd
- type AuthStatusCmd
- type AuthSwitchCmd
- type BulkCmd
- type BulkExportCmd
- type BulkImportCmd
- type CLI
- type ClientsAddCmd
- type ClientsCmd
- type ClientsEditCmd
- type ClientsListCmd
- type ClientsRemoveCmd
- type ClientsShowCmd
- type CompanyCmd
- type CompletionBashCmd
- type CompletionCmd
- type CompletionFishCmd
- type CompletionZshCmd
- type ConfigCmd
- type ConfigPathCmd
- type ConfigSetCmd
- type ConfigShowCmd
- type ConfigUnsetCmd
- type DashboardCmd
- type EstimatesAddCmd
- type EstimatesCmd
- type EstimatesEditCmd
- type EstimatesListCmd
- type EstimatesMarkAcceptedCmd
- type EstimatesMarkDeclinedCmd
- type EstimatesMarkDraftCmd
- type EstimatesMarkSentCmd
- type EstimatesRemoveCmd
- type EstimatesSendCmd
- type EstimatesShowCmd
- type ExitError
- type ExpensesAddCmd
- type ExpensesCategoriesCmd
- type ExpensesCmd
- type ExpensesEditCmd
- type ExpensesListCmd
- type ExpensesReceiptCmd
- type ExpensesRemoveCmd
- type ExpensesShowCmd
- type InvoicePaymentsAddCmd
- type InvoicePaymentsCmd
- type InvoicePaymentsListCmd
- type InvoicePaymentsRemoveCmd
- type InvoicesAddCmd
- type InvoicesCmd
- type InvoicesEditCmd
- type InvoicesListCmd
- type InvoicesMarkClosedCmd
- type InvoicesMarkDraftCmd
- type InvoicesMarkSentCmd
- type InvoicesRemoveCmd
- type InvoicesSendCmd
- type InvoicesShowCmd
- type ProjectsAddCmd
- type ProjectsCmd
- type ProjectsEditCmd
- type ProjectsListCmd
- type ProjectsRemoveCmd
- type ProjectsShowCmd
- type ReportsBudgetCmd
- type ReportsCmd
- type ReportsExpensesCmd
- type ReportsTimeCmd
- type ReportsUninvoicedCmd
- type RootFlags
- type TasksAddCmd
- type TasksCmd
- type TasksEditCmd
- type TasksListCmd
- type TasksRemoveCmd
- type TasksShowCmd
- type TimeAddCmd
- type TimeCmd
- type TimeEditCmd
- type TimeListCmd
- type TimeLogCmd
- type TimeRemoveCmd
- type TimeShowCmd
- type TimerCmd
- type TimerRestartCmd
- type TimerStartCmd
- type TimerStatusCmd
- type TimerStopCmd
- type TimerToggleCmd
- type UsersAddCmd
- type UsersCmd
- type UsersEditCmd
- type UsersListCmd
- type UsersMeCmd
- type UsersRemoveCmd
- type UsersShowCmd
- type VersionCmd
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTokenSource ¶
GetTokenSource returns an oauth2.TokenSource and account ID for API calls. Priority: env PAT > --account-id flag > keyring OAuth token
func NewClientFromFlags ¶
NewClientFromFlags creates an API client from CLI flags.
Types ¶
type ApprovalsApproveCmd ¶
type ApprovalsApproveCmd struct {
IDs []int64 `arg:"" optional:"" help:"Time entry IDs to approve"`
Week bool `help:"Approve all submitted entries for current week" short:"w"`
User string `help:"Filter by user ID when using --week"`
Force bool `help:"Skip confirmation" short:"f"`
}
ApprovalsApproveCmd approves submitted time entries.
func (*ApprovalsApproveCmd) Run ¶
func (c *ApprovalsApproveCmd) Run(cli *CLI) error
type ApprovalsCmd ¶
type ApprovalsCmd struct {
List ApprovalsListCmd `cmd:"" help:"List time entries pending approval"`
Submit ApprovalsSubmitCmd `cmd:"" help:"Submit time entries for approval"`
Approve ApprovalsApproveCmd `cmd:"" help:"Approve submitted time entries (manager)"`
Reject ApprovalsRejectCmd `cmd:"" help:"Reject submitted time entries (manager)"`
Unsubmit ApprovalsUnsubmitCmd `cmd:"" help:"Unsubmit entries back to draft"`
}
ApprovalsCmd groups approval workflow subcommands.
type ApprovalsListCmd ¶
type ApprovalsListCmd struct {
Status string `help:"Filter by status" enum:"submitted,unsubmitted,approved" default:"submitted"`
User string `help:"Filter by user ID or 'me'"`
Week bool `help:"Show current week only"`
From string `help:"Start date (YYYY-MM-DD or 'today')" short:"f"`
To string `help:"End date" short:"t"`
All bool `help:"Fetch all history instead of defaulting to the last 30 days"`
}
ApprovalsListCmd lists time entries pending approval.
func (*ApprovalsListCmd) Run ¶
func (c *ApprovalsListCmd) Run(cli *CLI) error
type ApprovalsRejectCmd ¶
type ApprovalsRejectCmd struct {
IDs []int64 `arg:"" help:"Time entry IDs to reject"`
Force bool `help:"Skip confirmation" short:"f"`
}
ApprovalsRejectCmd rejects submitted time entries.
func (*ApprovalsRejectCmd) Run ¶
func (c *ApprovalsRejectCmd) Run(cli *CLI) error
type ApprovalsSubmitCmd ¶
type ApprovalsSubmitCmd struct {
IDs []int64 `arg:"" optional:"" help:"Time entry IDs to submit"`
Week bool `help:"Submit all unsubmitted entries for current week" short:"w"`
Force bool `help:"Skip confirmation" short:"f"`
}
ApprovalsSubmitCmd submits time entries for approval.
func (*ApprovalsSubmitCmd) Run ¶
func (c *ApprovalsSubmitCmd) Run(cli *CLI) error
type ApprovalsUnsubmitCmd ¶
type ApprovalsUnsubmitCmd struct {
IDs []int64 `arg:"" optional:"" help:"Time entry IDs to unsubmit"`
Week bool `help:"Unsubmit all submitted entries for current week" short:"w"`
Force bool `help:"Skip confirmation" short:"f"`
}
ApprovalsUnsubmitCmd returns submitted entries back to draft.
func (*ApprovalsUnsubmitCmd) Run ¶
func (c *ApprovalsUnsubmitCmd) Run(cli *CLI) error
type AuthCmd ¶
type AuthCmd struct {
Setup AuthSetupCmd `cmd:"" help:"Store OAuth client credentials"`
Login AuthLoginCmd `cmd:"" help:"Authenticate with Harvest"`
Logout AuthLogoutCmd `cmd:"" help:"Remove stored authentication"`
Status AuthStatusCmd `cmd:"" help:"Show authentication status"`
List AuthListCmd `cmd:"" help:"List authenticated accounts"`
Switch AuthSwitchCmd `cmd:"" help:"Switch default account"`
}
AuthCmd groups authentication subcommands.
type AuthListCmd ¶
type AuthListCmd struct{}
AuthListCmd lists all authenticated accounts.
func (*AuthListCmd) Run ¶
func (c *AuthListCmd) Run() error
type AuthLoginCmd ¶
type AuthLoginCmd struct {
ClientName string `help:"OAuth client name" default:"default" name:"client-name"`
ForceConsent bool `help:"Force consent prompt even if already authorized" name:"force-consent"`
Manual bool `help:"Manual authorization (paste URL instead of callback server)"`
PAT bool `help:"Use Personal Access Token instead of OAuth" name:"pat"`
}
AuthLoginCmd authenticates with Harvest.
func (*AuthLoginCmd) Run ¶
func (c *AuthLoginCmd) Run(cli *CLI) error
type AuthLogoutCmd ¶
type AuthLogoutCmd struct {
Email string `help:"Email/account to log out" name:"email"`
ClientName string `help:"OAuth client name" default:"default" name:"client-name"`
All bool `help:"Log out all accounts"`
}
AuthLogoutCmd removes stored tokens.
func (*AuthLogoutCmd) Run ¶
func (c *AuthLogoutCmd) Run() error
type AuthSetupCmd ¶
type AuthSetupCmd struct {
ClientID string `arg:"" optional:"" help:"OAuth client ID"`
ClientSecret string `help:"OAuth client secret (for non-interactive use)" name:"client-secret"`
ClientName string `help:"Client name (default: default)" default:"default" name:"client-name"`
}
AuthSetupCmd stores OAuth credentials.
func (*AuthSetupCmd) Run ¶
func (c *AuthSetupCmd) Run() error
type AuthStatusCmd ¶
type AuthStatusCmd struct {
ClientName string `help:"OAuth client name" default:"default" name:"client-name"`
}
AuthStatusCmd shows authentication status.
func (*AuthStatusCmd) Run ¶
func (c *AuthStatusCmd) Run() error
type AuthSwitchCmd ¶
type AuthSwitchCmd struct {
Account string `arg:"" help:"Account email or alias to set as default"`
}
AuthSwitchCmd switches the default account.
func (*AuthSwitchCmd) Run ¶
func (c *AuthSwitchCmd) Run() error
type BulkCmd ¶
type BulkCmd struct {
Export BulkExportCmd `cmd:"" help:"Export time entries to CSV"`
Import BulkImportCmd `cmd:"" help:"Import time entries from CSV"`
}
BulkCmd groups bulk operation subcommands.
type BulkExportCmd ¶
type BulkExportCmd struct {
From string `help:"Start date (required)" short:"f" required:""`
To string `help:"End date (required)" short:"t" required:""`
Project string `help:"Filter by project ID or name" short:"p"`
User string `help:"Filter by user ID or 'me'" short:"u"`
Output string `help:"Output file path (default: stdout)" short:"o"`
}
BulkExportCmd exports time entries to CSV.
func (*BulkExportCmd) Run ¶
func (c *BulkExportCmd) Run(cli *CLI) error
type BulkImportCmd ¶
type BulkImportCmd struct {
File string `arg:"" help:"CSV file path"`
DryRun bool `help:"Show what would be created without creating" short:"n"`
}
BulkImportCmd imports time entries from CSV.
func (*BulkImportCmd) Run ¶
func (c *BulkImportCmd) Run(cli *CLI) error
type CLI ¶
type CLI struct {
RootFlags `embed:""`
Version kong.VersionFlag `help:"Print version and exit"`
VersionCmd VersionCmd `cmd:"" name:"version" help:"Show version information"`
Auth AuthCmd `cmd:"" help:"Authentication commands"`
Config ConfigCmd `cmd:"" help:"Configuration commands"`
Time TimeCmd `cmd:"" help:"Time entry commands"`
Timer TimerCmd `cmd:"" help:"Timer commands"`
Projects ProjectsCmd `cmd:"" help:"Project commands"`
Clients ClientsCmd `cmd:"" help:"Client commands"`
Tasks TasksCmd `cmd:"" help:"Task commands"`
Users UsersCmd `cmd:"" help:"User management commands"`
Expenses ExpensesCmd `cmd:"" help:"Expense commands"`
Estimates EstimatesCmd `cmd:"" help:"Estimate commands"`
Invoices InvoicesCmd `cmd:"" help:"Invoice commands"`
Reports ReportsCmd `cmd:"" help:"Report commands"`
Company CompanyCmd `cmd:"" help:"Show company information"`
Approvals ApprovalsCmd `cmd:"" help:"Approval workflow commands"`
Bulk BulkCmd `cmd:"" help:"Bulk import/export operations"`
Completion CompletionCmd `cmd:"" help:"Generate shell completions"`
Dashboard DashboardCmd `cmd:"" help:"Show weekly time tracking summary"`
}
CLI is the root command structure.
type ClientsAddCmd ¶
type ClientsAddCmd struct {
Name string `arg:"" help:"Client name"`
Address string `help:"Client address"`
Currency string `help:"Currency code (e.g., USD, EUR)"`
Active *bool `help:"Is active (default: true)"`
}
ClientsAddCmd creates a new client.
func (*ClientsAddCmd) Run ¶
func (c *ClientsAddCmd) Run(cli *CLI) error
type ClientsCmd ¶
type ClientsCmd struct {
List ClientsListCmd `cmd:"" help:"List all clients"`
Show ClientsShowCmd `cmd:"" help:"Show a client"`
Add ClientsAddCmd `cmd:"" help:"Create a client"`
Edit ClientsEditCmd `cmd:"" help:"Update a client"`
Remove ClientsRemoveCmd `cmd:"" help:"Delete a client"`
}
ClientsCmd groups client subcommands.
type ClientsEditCmd ¶
type ClientsEditCmd struct {
ID int64 `arg:"" help:"Client ID"`
Name string `help:"Client name"`
Address string `help:"Client address"`
Currency string `help:"Currency code"`
Active *bool `help:"Is active"`
}
ClientsEditCmd updates an existing client.
func (*ClientsEditCmd) Run ¶
func (c *ClientsEditCmd) Run(cli *CLI) error
type ClientsListCmd ¶
type ClientsListCmd struct {
Active *bool `help:"Filter by active status"`
UpdatedSince string `help:"Filter by updated since (ISO datetime)"`
}
ClientsListCmd lists clients with filters.
func (*ClientsListCmd) Run ¶
func (c *ClientsListCmd) Run(cli *CLI) error
type ClientsRemoveCmd ¶
type ClientsRemoveCmd struct {
ID int64 `arg:"" help:"Client ID"`
Force bool `help:"Skip confirmation" short:"f"`
}
ClientsRemoveCmd deletes a client.
func (*ClientsRemoveCmd) Run ¶
func (c *ClientsRemoveCmd) Run(cli *CLI) error
type ClientsShowCmd ¶
type ClientsShowCmd struct {
ID int64 `arg:"" help:"Client ID"`
}
ClientsShowCmd shows a single client.
func (*ClientsShowCmd) Run ¶
func (c *ClientsShowCmd) Run(cli *CLI) error
type CompanyCmd ¶
type CompanyCmd struct {
Edit bool `help:"Edit company settings" short:"e"`
WantsTimestamps *bool `help:"Enable timestamp timers (with --edit)" name:"timestamps"`
WeeklyCapacity *int `help:"Weekly capacity in seconds (with --edit)" name:"weekly-capacity"`
}
CompanyCmd shows company information.
func (*CompanyCmd) Run ¶
func (c *CompanyCmd) Run(cli *CLI) error
type CompletionBashCmd ¶
type CompletionBashCmd struct{}
func (*CompletionBashCmd) Run ¶
func (c *CompletionBashCmd) Run() error
type CompletionCmd ¶
type CompletionCmd struct {
Bash CompletionBashCmd `cmd:"" help:"Generate bash completions"`
Zsh CompletionZshCmd `cmd:"" help:"Generate zsh completions"`
Fish CompletionFishCmd `cmd:"" help:"Generate fish completions"`
}
CompletionCmd generates shell completions.
type CompletionFishCmd ¶
type CompletionFishCmd struct{}
func (*CompletionFishCmd) Run ¶
func (c *CompletionFishCmd) Run() error
type CompletionZshCmd ¶
type CompletionZshCmd struct{}
func (*CompletionZshCmd) Run ¶
func (c *CompletionZshCmd) Run() error
type ConfigCmd ¶
type ConfigCmd struct {
Show ConfigShowCmd `cmd:"" default:"1" help:"Show current configuration"`
Set ConfigSetCmd `cmd:"" help:"Set a configuration value"`
Unset ConfigUnsetCmd `cmd:"" help:"Remove a configuration value"`
Path ConfigPathCmd `cmd:"" help:"Show configuration directory path"`
}
ConfigCmd groups configuration subcommands.
type ConfigPathCmd ¶
type ConfigPathCmd struct{}
ConfigPathCmd shows configuration paths.
func (*ConfigPathCmd) Run ¶
func (c *ConfigPathCmd) Run() error
type ConfigSetCmd ¶
type ConfigSetCmd struct {
Key string `arg:"" help:"Configuration key"`
Value string `arg:"" help:"Configuration value"`
}
ConfigSetCmd sets a configuration value.
func (*ConfigSetCmd) Run ¶
func (c *ConfigSetCmd) Run() error
type ConfigShowCmd ¶
type ConfigShowCmd struct{}
ConfigShowCmd shows current configuration.
func (*ConfigShowCmd) Run ¶
func (c *ConfigShowCmd) Run(cli *CLI) error
type ConfigUnsetCmd ¶
type ConfigUnsetCmd struct {
Key string `arg:"" help:"Configuration key to remove"`
}
ConfigUnsetCmd removes a configuration value.
func (*ConfigUnsetCmd) Run ¶
func (c *ConfigUnsetCmd) Run() error
type DashboardCmd ¶
type DashboardCmd struct {
Week string `help:"Week to show (default: current)" short:"w"`
}
DashboardCmd shows a weekly summary view.
func (*DashboardCmd) Run ¶
func (c *DashboardCmd) Run(cli *CLI) error
Run executes the dashboard command.
type EstimatesAddCmd ¶
type EstimatesAddCmd struct {
HarvestClient string `help:"Client ID or name (required)" name:"harvest-client" short:"c" required:""`
Subject string `help:"Estimate subject" short:"s"`
Number string `help:"Estimate number (auto-generated if not set)"`
PurchaseOrder string `help:"Purchase order number"`
IssueDate string `help:"Issue date (default: today)" short:"d"`
Currency string `help:"Currency code"`
Tax float64 `help:"Tax percentage"`
Tax2 float64 `help:"Second tax percentage"`
Discount float64 `help:"Discount percentage"`
Notes string `help:"Additional notes" short:"n"`
}
EstimatesAddCmd creates a new estimate.
func (*EstimatesAddCmd) Run ¶
func (c *EstimatesAddCmd) Run(cli *CLI) error
type EstimatesCmd ¶
type EstimatesCmd struct {
List EstimatesListCmd `cmd:"" help:"List estimates"`
Show EstimatesShowCmd `cmd:"" help:"Show an estimate"`
Add EstimatesAddCmd `cmd:"" help:"Create an estimate"`
Edit EstimatesEditCmd `cmd:"" help:"Update an estimate"`
Remove EstimatesRemoveCmd `cmd:"" help:"Delete an estimate"`
Send EstimatesSendCmd `cmd:"" help:"Send estimate via email"`
MarkSent EstimatesMarkSentCmd `cmd:"" name:"mark-sent" help:"Mark estimate as sent"`
MarkAccepted EstimatesMarkAcceptedCmd `cmd:"" name:"mark-accepted" help:"Mark estimate as accepted"`
MarkDeclined EstimatesMarkDeclinedCmd `cmd:"" name:"mark-declined" help:"Mark estimate as declined"`
MarkDraft EstimatesMarkDraftCmd `cmd:"" name:"mark-draft" help:"Convert estimate back to draft"`
}
EstimatesCmd groups estimate subcommands.
type EstimatesEditCmd ¶
type EstimatesEditCmd struct {
ID int64 `arg:"" help:"Estimate ID"`
HarvestClient string `help:"Client ID or name" name:"harvest-client" short:"c"`
Subject string `help:"Estimate subject" short:"s"`
Number string `help:"Estimate number"`
PurchaseOrder string `help:"Purchase order number"`
IssueDate string `help:"Issue date" short:"d"`
Currency string `help:"Currency code"`
Tax float64 `help:"Tax percentage"`
Tax2 float64 `help:"Second tax percentage"`
Discount float64 `help:"Discount percentage"`
Notes string `help:"Additional notes" short:"n"`
}
EstimatesEditCmd updates an existing estimate.
func (*EstimatesEditCmd) Run ¶
func (c *EstimatesEditCmd) Run(cli *CLI) error
type EstimatesListCmd ¶
type EstimatesListCmd struct {
HarvestClient string `help:"Filter by client ID or name" name:"harvest-client" short:"c"`
State string `help:"Filter by state: draft, sent, accepted, declined" enum:",draft,sent,accepted,declined" default:""`
UpdatedSince string `help:"Filter by updated since date"`
From string `help:"Filter by issue date on or after" short:"f"`
To string `help:"Filter by issue date on or before" short:"t"`
All bool `help:"Fetch all history instead of defaulting to the last 30 days"`
}
EstimatesListCmd lists estimates with filters.
func (*EstimatesListCmd) Run ¶
func (c *EstimatesListCmd) Run(cli *CLI) error
type EstimatesMarkAcceptedCmd ¶
type EstimatesMarkAcceptedCmd struct {
ID int64 `arg:"" help:"Estimate ID"`
}
EstimatesMarkAcceptedCmd marks an estimate as accepted.
func (*EstimatesMarkAcceptedCmd) Run ¶
func (c *EstimatesMarkAcceptedCmd) Run(cli *CLI) error
type EstimatesMarkDeclinedCmd ¶
type EstimatesMarkDeclinedCmd struct {
ID int64 `arg:"" help:"Estimate ID"`
}
EstimatesMarkDeclinedCmd marks an estimate as declined.
func (*EstimatesMarkDeclinedCmd) Run ¶
func (c *EstimatesMarkDeclinedCmd) Run(cli *CLI) error
type EstimatesMarkDraftCmd ¶
type EstimatesMarkDraftCmd struct {
ID int64 `arg:"" help:"Estimate ID"`
}
EstimatesMarkDraftCmd converts an estimate back to draft.
func (*EstimatesMarkDraftCmd) Run ¶
func (c *EstimatesMarkDraftCmd) Run(cli *CLI) error
type EstimatesMarkSentCmd ¶
type EstimatesMarkSentCmd struct {
ID int64 `arg:"" help:"Estimate ID"`
}
EstimatesMarkSentCmd marks an estimate as sent.
func (*EstimatesMarkSentCmd) Run ¶
func (c *EstimatesMarkSentCmd) Run(cli *CLI) error
type EstimatesRemoveCmd ¶
type EstimatesRemoveCmd struct {
ID int64 `arg:"" help:"Estimate ID"`
Force bool `help:"Skip confirmation" short:"f"`
}
EstimatesRemoveCmd deletes an estimate.
func (*EstimatesRemoveCmd) Run ¶
func (c *EstimatesRemoveCmd) Run(cli *CLI) error
type EstimatesSendCmd ¶
type EstimatesSendCmd struct {
ID int64 `arg:"" help:"Estimate ID"`
Recipients []string `help:"Recipient emails (comma-separated or multiple flags)" short:"r" required:""`
Subject string `help:"Email subject" short:"s"`
Body string `help:"Email body" short:"b"`
SendMeACopy bool `help:"Send a copy to yourself"`
}
EstimatesSendCmd sends an estimate via email.
func (*EstimatesSendCmd) Run ¶
func (c *EstimatesSendCmd) Run(cli *CLI) error
type EstimatesShowCmd ¶
type EstimatesShowCmd struct {
ID int64 `arg:"" help:"Estimate ID"`
}
EstimatesShowCmd shows a single estimate.
func (*EstimatesShowCmd) Run ¶
func (c *EstimatesShowCmd) Run(cli *CLI) error
type ExpensesAddCmd ¶
type ExpensesAddCmd struct {
Project string `help:"Project ID or name" short:"p" required:""`
Category string `help:"Expense category ID or name" required:""`
Date string `help:"Date (default: today)" short:"d"`
TotalCost float64 `help:"Total cost amount" required:""`
Notes string `help:"Notes" short:"n"`
Units int `help:"Units (for unit-based categories)"`
Billable *bool `help:"Whether expense is billable"`
Receipt string `help:"Path to receipt file"`
}
ExpensesAddCmd creates a new expense.
func (*ExpensesAddCmd) Run ¶
func (c *ExpensesAddCmd) Run(cli *CLI) error
type ExpensesCategoriesCmd ¶
type ExpensesCategoriesCmd struct {
Active *bool `help:"Filter by active status"`
}
ExpensesCategoriesCmd lists expense categories.
func (*ExpensesCategoriesCmd) Run ¶
func (c *ExpensesCategoriesCmd) Run(cli *CLI) error
type ExpensesCmd ¶
type ExpensesCmd struct {
List ExpensesListCmd `cmd:"" help:"List expenses"`
Show ExpensesShowCmd `cmd:"" help:"Show an expense"`
Add ExpensesAddCmd `cmd:"" help:"Create an expense"`
Edit ExpensesEditCmd `cmd:"" help:"Update an expense"`
Remove ExpensesRemoveCmd `cmd:"" help:"Delete an expense"`
Receipt ExpensesReceiptCmd `cmd:"" help:"Upload receipt to expense"`
Categories ExpensesCategoriesCmd `cmd:"" help:"List expense categories"`
}
ExpensesCmd groups expense subcommands.
type ExpensesEditCmd ¶
type ExpensesEditCmd struct {
ID int64 `arg:"" help:"Expense ID"`
Project string `help:"Project ID or name"`
Category string `help:"Expense category ID or name"`
Date string `help:"Date"`
TotalCost float64 `help:"Total cost amount"`
Notes string `help:"Notes"`
Units int `help:"Units (for unit-based categories)"`
Billable *bool `help:"Whether expense is billable"`
DeleteReceipt bool `help:"Delete the attached receipt"`
}
ExpensesEditCmd updates an existing expense.
func (*ExpensesEditCmd) Run ¶
func (c *ExpensesEditCmd) Run(cli *CLI) error
type ExpensesListCmd ¶
type ExpensesListCmd struct {
User string `help:"Filter by user ID or 'me'"`
HarvestClient string `help:"Filter by client ID or name" name:"harvest-client" short:"c"`
Project string `help:"Filter by project ID or name" short:"p"`
Billed bool `help:"Only billed expenses"`
Unbilled bool `help:"Only unbilled expenses"`
UpdatedSince string `help:"Filter by updated since (ISO datetime)"`
From string `help:"Start date (YYYY-MM-DD or 'today')" short:"f"`
To string `help:"End date" short:"t"`
All bool `help:"Fetch all history instead of defaulting to the last 30 days"`
}
ExpensesListCmd lists expenses with filters.
func (*ExpensesListCmd) Run ¶
func (c *ExpensesListCmd) Run(cli *CLI) error
type ExpensesReceiptCmd ¶
type ExpensesReceiptCmd struct {
ID int64 `arg:"" help:"Expense ID"`
Receipt string `arg:"" help:"Path to receipt file"`
}
ExpensesReceiptCmd uploads a receipt to an expense.
func (*ExpensesReceiptCmd) Run ¶
func (c *ExpensesReceiptCmd) Run(cli *CLI) error
type ExpensesRemoveCmd ¶
type ExpensesRemoveCmd struct {
ID int64 `arg:"" help:"Expense ID"`
Force bool `help:"Skip confirmation" short:"f"`
}
ExpensesRemoveCmd deletes an expense.
func (*ExpensesRemoveCmd) Run ¶
func (c *ExpensesRemoveCmd) Run(cli *CLI) error
type ExpensesShowCmd ¶
type ExpensesShowCmd struct {
ID int64 `arg:"" help:"Expense ID"`
}
ExpensesShowCmd shows a single expense.
func (*ExpensesShowCmd) Run ¶
func (c *ExpensesShowCmd) Run(cli *CLI) error
type InvoicePaymentsAddCmd ¶
type InvoicePaymentsAddCmd struct {
InvoiceID int64 `arg:"" help:"Invoice ID"`
Amount float64 `help:"Payment amount" required:""`
PaidDate string `help:"Payment date (default: today)"`
Notes string `help:"Payment notes"`
}
InvoicePaymentsAddCmd adds a payment to an invoice.
func (*InvoicePaymentsAddCmd) Run ¶
func (c *InvoicePaymentsAddCmd) Run(cli *CLI) error
type InvoicePaymentsCmd ¶
type InvoicePaymentsCmd struct {
List InvoicePaymentsListCmd `cmd:"" help:"List payments for an invoice"`
Add InvoicePaymentsAddCmd `cmd:"" help:"Add a payment to an invoice"`
Remove InvoicePaymentsRemoveCmd `cmd:"" help:"Remove a payment from an invoice"`
}
InvoicePaymentsCmd manages invoice payments.
type InvoicePaymentsListCmd ¶
type InvoicePaymentsListCmd struct {
InvoiceID int64 `arg:"" help:"Invoice ID"`
}
InvoicePaymentsListCmd lists payments for an invoice.
func (*InvoicePaymentsListCmd) Run ¶
func (c *InvoicePaymentsListCmd) Run(cli *CLI) error
type InvoicePaymentsRemoveCmd ¶
type InvoicePaymentsRemoveCmd struct {
InvoiceID int64 `arg:"" help:"Invoice ID"`
PaymentID int64 `arg:"" help:"Payment ID"`
Force bool `help:"Skip confirmation" short:"f"`
}
InvoicePaymentsRemoveCmd removes a payment from an invoice.
func (*InvoicePaymentsRemoveCmd) Run ¶
func (c *InvoicePaymentsRemoveCmd) Run(cli *CLI) error
type InvoicesAddCmd ¶
type InvoicesAddCmd struct {
HarvestClient string `help:"Client ID or name (required)" name:"harvest-client" short:"c" required:""`
Number string `help:"Invoice number"`
Subject string `help:"Invoice subject"`
Notes string `help:"Invoice notes"`
IssueDate string `help:"Issue date (default: today)"`
DueDate string `help:"Due date"`
PaymentTerm string `` /* 140-byte string literal not displayed */
Currency string `help:"Currency code (e.g., USD, EUR)"`
Tax float64 `help:"Tax percentage"`
Tax2 float64 `help:"Tax2 percentage"`
Discount float64 `help:"Discount percentage"`
PurchaseOrder string `help:"Purchase order number"`
}
InvoicesAddCmd creates a new invoice.
func (*InvoicesAddCmd) Run ¶
func (c *InvoicesAddCmd) Run(cli *CLI) error
type InvoicesCmd ¶
type InvoicesCmd struct {
List InvoicesListCmd `cmd:"" help:"List invoices"`
Show InvoicesShowCmd `cmd:"" help:"Show an invoice"`
Add InvoicesAddCmd `cmd:"" help:"Create an invoice"`
Edit InvoicesEditCmd `cmd:"" help:"Update an invoice"`
Remove InvoicesRemoveCmd `cmd:"" help:"Delete an invoice"`
Send InvoicesSendCmd `cmd:"" help:"Send invoice via email"`
MarkSent InvoicesMarkSentCmd `cmd:"" name:"mark-sent" help:"Mark invoice as sent"`
MarkClosed InvoicesMarkClosedCmd `cmd:"" name:"mark-closed" help:"Mark invoice as closed"`
MarkDraft InvoicesMarkDraftCmd `cmd:"" name:"mark-draft" help:"Mark invoice as draft"`
Payments InvoicePaymentsCmd `cmd:"" help:"Manage invoice payments"`
}
InvoicesCmd groups invoice subcommands.
type InvoicesEditCmd ¶
type InvoicesEditCmd struct {
ID int64 `arg:"" help:"Invoice ID"`
Number string `help:"Invoice number"`
Subject string `help:"Invoice subject"`
Notes string `help:"Invoice notes"`
IssueDate string `help:"Issue date"`
DueDate string `help:"Due date"`
PaymentTerm string `help:"Payment term"`
Currency string `help:"Currency code"`
Tax float64 `help:"Tax percentage"`
Tax2 float64 `help:"Tax2 percentage"`
Discount float64 `help:"Discount percentage"`
PurchaseOrder string `help:"Purchase order number"`
}
InvoicesEditCmd updates an existing invoice.
func (*InvoicesEditCmd) Run ¶
func (c *InvoicesEditCmd) Run(cli *CLI) error
type InvoicesListCmd ¶
type InvoicesListCmd struct {
HarvestClient string `help:"Filter by client ID or name" name:"harvest-client" short:"c"`
Project string `help:"Filter by project ID or name" short:"p"`
State string `help:"Filter by state: draft, open, paid, closed" default:"" enum:",draft,open,paid,closed"`
UpdatedSince string `help:"Filter by updated since date"`
From string `help:"Filter by issue date from" short:"f"`
To string `help:"Filter by issue date to" short:"t"`
All bool `help:"Fetch all history instead of defaulting to the last 30 days"`
}
InvoicesListCmd lists invoices with filters.
func (*InvoicesListCmd) Run ¶
func (c *InvoicesListCmd) Run(cli *CLI) error
type InvoicesMarkClosedCmd ¶
type InvoicesMarkClosedCmd struct {
ID int64 `arg:"" help:"Invoice ID"`
}
InvoicesMarkClosedCmd marks an invoice as closed.
func (*InvoicesMarkClosedCmd) Run ¶
func (c *InvoicesMarkClosedCmd) Run(cli *CLI) error
type InvoicesMarkDraftCmd ¶
type InvoicesMarkDraftCmd struct {
ID int64 `arg:"" help:"Invoice ID"`
}
InvoicesMarkDraftCmd marks an invoice as draft (re-opens it).
func (*InvoicesMarkDraftCmd) Run ¶
func (c *InvoicesMarkDraftCmd) Run(cli *CLI) error
type InvoicesMarkSentCmd ¶
type InvoicesMarkSentCmd struct {
ID int64 `arg:"" help:"Invoice ID"`
}
InvoicesMarkSentCmd marks an invoice as sent.
func (*InvoicesMarkSentCmd) Run ¶
func (c *InvoicesMarkSentCmd) Run(cli *CLI) error
type InvoicesRemoveCmd ¶
type InvoicesRemoveCmd struct {
ID int64 `arg:"" help:"Invoice ID"`
Force bool `help:"Skip confirmation" short:"f"`
}
InvoicesRemoveCmd deletes an invoice.
func (*InvoicesRemoveCmd) Run ¶
func (c *InvoicesRemoveCmd) Run(cli *CLI) error
type InvoicesSendCmd ¶
type InvoicesSendCmd struct {
ID int64 `arg:"" help:"Invoice ID"`
Recipients []string `help:"Recipient emails (comma-separated or multiple flags)" short:"r"`
Subject string `help:"Email subject"`
Body string `help:"Email body"`
AttachPDF bool `help:"Attach PDF to email" default:"true"`
SendCopy bool `help:"Send a copy to yourself"`
}
InvoicesSendCmd sends an invoice via email.
func (*InvoicesSendCmd) Run ¶
func (c *InvoicesSendCmd) Run(cli *CLI) error
type InvoicesShowCmd ¶
type InvoicesShowCmd struct {
ID int64 `arg:"" help:"Invoice ID"`
}
InvoicesShowCmd shows a single invoice.
func (*InvoicesShowCmd) Run ¶
func (c *InvoicesShowCmd) Run(cli *CLI) error
type ProjectsAddCmd ¶
type ProjectsAddCmd struct {
Name string `help:"Project name" short:"n" required:""`
HarvestClient string `help:"Client ID or name" name:"harvest-client" short:"c"`
Code string `help:"Project code"`
Billable bool `help:"Project is billable" default:"true"`
BillBy string `help:"Bill by: none, People, Project, Tasks" default:"none" enum:"none,People,Project,Tasks"`
BudgetBy string `help:"Budget by: none, person, project, task" default:"none" enum:"none,person,project,task"`
HourlyRate float64 `help:"Hourly rate"`
Budget float64 `help:"Budget amount"`
Notes string `help:"Project notes"`
StartsOn string `help:"Start date"`
EndsOn string `help:"End date"`
FixedFee bool `help:"Fixed fee project"`
}
ProjectsAddCmd creates a new project.
func (*ProjectsAddCmd) Run ¶
func (c *ProjectsAddCmd) Run(cli *CLI) error
type ProjectsCmd ¶
type ProjectsCmd struct {
List ProjectsListCmd `cmd:"" help:"List all projects"`
Show ProjectsShowCmd `cmd:"" help:"Show a project"`
Add ProjectsAddCmd `cmd:"" help:"Create a project"`
Edit ProjectsEditCmd `cmd:"" help:"Update a project"`
Remove ProjectsRemoveCmd `cmd:"" help:"Delete a project"`
}
ProjectsCmd groups project subcommands.
type ProjectsEditCmd ¶
type ProjectsEditCmd struct {
ID int64 `arg:"" help:"Project ID"`
Name string `help:"Project name" short:"n"`
HarvestClient string `help:"Client ID or name" name:"harvest-client" short:"c"`
Code string `help:"Project code"`
Active string `help:"Is active: true, false" default:"" enum:",true,false"`
Billable string `help:"Is billable: true, false" default:"" enum:",true,false"`
BillBy string `help:"Bill by: none, People, Project, Tasks" default:"" enum:",none,People,Project,Tasks"`
BudgetBy string `help:"Budget by: none, person, project, task" default:"" enum:",none,person,project,task"`
HourlyRate float64 `help:"Hourly rate"`
Budget float64 `help:"Budget amount"`
Notes string `help:"Project notes"`
StartsOn string `help:"Start date"`
EndsOn string `help:"End date"`
FixedFee string `help:"Fixed fee: true, false" default:"" enum:",true,false"`
}
ProjectsEditCmd updates an existing project.
func (*ProjectsEditCmd) Run ¶
func (c *ProjectsEditCmd) Run(cli *CLI) error
type ProjectsListCmd ¶
type ProjectsListCmd struct {
Active string `help:"Filter by active status: true, false, all" default:"all" enum:"true,false,all"`
HarvestClient string `help:"Filter by client ID or name" name:"harvest-client" short:"c"`
UpdatedSince string `help:"Filter by updated since date"`
}
ProjectsListCmd lists projects with filters.
func (*ProjectsListCmd) Run ¶
func (c *ProjectsListCmd) Run(cli *CLI) error
type ProjectsRemoveCmd ¶
type ProjectsRemoveCmd struct {
ID int64 `arg:"" help:"Project ID"`
Force bool `help:"Skip confirmation" short:"f"`
}
ProjectsRemoveCmd deletes a project.
func (*ProjectsRemoveCmd) Run ¶
func (c *ProjectsRemoveCmd) Run(cli *CLI) error
type ProjectsShowCmd ¶
type ProjectsShowCmd struct {
ID int64 `arg:"" help:"Project ID"`
}
ProjectsShowCmd shows a single project.
func (*ProjectsShowCmd) Run ¶
func (c *ProjectsShowCmd) Run(cli *CLI) error
type ReportsBudgetCmd ¶
type ReportsBudgetCmd struct {
Active bool `help:"Only active projects"`
Inactive bool `help:"Only inactive projects"`
}
ReportsBudgetCmd generates project budget report.
func (*ReportsBudgetCmd) Run ¶
func (c *ReportsBudgetCmd) Run(cli *CLI) error
type ReportsCmd ¶
type ReportsCmd struct {
Time ReportsTimeCmd `cmd:"" help:"Time reports"`
Expenses ReportsExpensesCmd `cmd:"" help:"Expense reports"`
Uninvoiced ReportsUninvoicedCmd `cmd:"" help:"Uninvoiced amounts report"`
Budget ReportsBudgetCmd `cmd:"" help:"Project budget report"`
}
ReportsCmd groups report subcommands.
type ReportsExpensesCmd ¶
type ReportsExpensesCmd struct {
By string `help:"Group by: clients, projects, categories, team" default:"projects" enum:"clients,projects,categories,team"`
From string `help:"Start date (required)" short:"f" required:""`
To string `help:"End date (required)" short:"t" required:""`
}
ReportsExpensesCmd generates expense reports.
func (*ReportsExpensesCmd) Run ¶
func (c *ReportsExpensesCmd) Run(cli *CLI) error
type ReportsTimeCmd ¶
type ReportsTimeCmd struct {
By string `help:"Group by: clients, projects, tasks, team" default:"projects" enum:"clients,projects,tasks,team"`
From string `help:"Start date (required)" short:"f" required:""`
To string `help:"End date (required)" short:"t" required:""`
}
ReportsTimeCmd generates time reports.
func (*ReportsTimeCmd) Run ¶
func (c *ReportsTimeCmd) Run(cli *CLI) error
type ReportsUninvoicedCmd ¶
type ReportsUninvoicedCmd struct {
From string `help:"Start date (required)" short:"f" required:""`
To string `help:"End date (required)" short:"t" required:""`
}
ReportsUninvoicedCmd generates uninvoiced amounts report.
func (*ReportsUninvoicedCmd) Run ¶
func (c *ReportsUninvoicedCmd) Run(cli *CLI) error
type RootFlags ¶
type RootFlags struct {
Account string `help:"Account email or alias" short:"a" env:"HARVESTCLI_ACCOUNT"`
AccountID int64 `help:"Harvest account ID override" env:"HARVESTCLI_ACCOUNT_ID"`
Client string `help:"OAuth client name override"`
JSON bool `help:"Output as JSON" short:"j"`
Plain bool `help:"Output as TSV (plain text)"`
Verbose bool `help:"Verbose output" short:"v"`
Color string `help:"Color output: auto, always, never" default:"auto" enum:"auto,always,never"`
}
RootFlags are global flags available to all commands.
type TasksAddCmd ¶
type TasksAddCmd struct {
Name string `arg:"" help:"Task name"`
BillableByDefault *bool `help:"Billable by default"`
DefaultHourlyRate *float64 `help:"Default hourly rate"`
IsDefault *bool `help:"Add to new projects by default"`
Active *bool `help:"Is active (default: true)"`
}
TasksAddCmd creates a new task.
func (*TasksAddCmd) Run ¶
func (c *TasksAddCmd) Run(cli *CLI) error
type TasksCmd ¶
type TasksCmd struct {
List TasksListCmd `cmd:"" help:"List all tasks"`
Show TasksShowCmd `cmd:"" help:"Show a task"`
Add TasksAddCmd `cmd:"" help:"Create a task"`
Edit TasksEditCmd `cmd:"" help:"Update a task"`
Remove TasksRemoveCmd `cmd:"" help:"Delete a task"`
}
TasksCmd groups task subcommands.
type TasksEditCmd ¶
type TasksEditCmd struct {
ID int64 `arg:"" help:"Task ID"`
Name string `help:"Task name"`
BillableByDefault *bool `help:"Billable by default"`
DefaultHourlyRate *float64 `help:"Default hourly rate"`
IsDefault *bool `help:"Add to new projects by default"`
Active *bool `help:"Is active"`
}
TasksEditCmd updates an existing task.
func (*TasksEditCmd) Run ¶
func (c *TasksEditCmd) Run(cli *CLI) error
type TasksListCmd ¶
type TasksListCmd struct {
Active *bool `help:"Filter by active status"`
UpdatedSince string `help:"Filter by updated since (ISO datetime)"`
}
TasksListCmd lists tasks with filters.
func (*TasksListCmd) Run ¶
func (c *TasksListCmd) Run(cli *CLI) error
type TasksRemoveCmd ¶
type TasksRemoveCmd struct {
ID int64 `arg:"" help:"Task ID"`
Force bool `help:"Skip confirmation" short:"f"`
}
TasksRemoveCmd deletes a task.
func (*TasksRemoveCmd) Run ¶
func (c *TasksRemoveCmd) Run(cli *CLI) error
type TasksShowCmd ¶
type TasksShowCmd struct {
ID int64 `arg:"" help:"Task ID"`
}
TasksShowCmd shows a single task.
func (*TasksShowCmd) Run ¶
func (c *TasksShowCmd) Run(cli *CLI) error
type TimeAddCmd ¶
type TimeAddCmd struct {
Project string `help:"Project ID or name" short:"p"`
Task string `help:"Task ID or name"`
Date string `help:"Date (default: today)" short:"d"`
Hours float64 `help:"Hours (duration mode)" short:"h"`
Start string `help:"Start time (timestamp mode)"`
End string `help:"End time (timestamp mode)"`
Notes string `help:"Notes" short:"n"`
Duration bool `help:"Use duration mode (hours)"`
Timestamp bool `help:"Use timestamp mode (start/end)"`
ExtRefID string `help:"External reference ID (e.g., JIRA-123)" name:"external-ref-id"`
ExtRefGroupID string `help:"External reference group ID" name:"external-ref-group-id"`
ExtRefURL string `help:"External reference URL" name:"external-ref-url"`
ExtRefService string `help:"External reference service name (e.g., jira, asana)" name:"external-ref-service"`
}
TimeAddCmd creates a new time entry.
func (*TimeAddCmd) Run ¶
func (c *TimeAddCmd) Run(cli *CLI) error
type TimeCmd ¶
type TimeCmd struct {
List TimeListCmd `cmd:"" help:"List time entries"`
Show TimeShowCmd `cmd:"" help:"Show a time entry"`
Add TimeAddCmd `cmd:"" help:"Create a time entry"`
Edit TimeEditCmd `cmd:"" help:"Update a time entry"`
Remove TimeRemoveCmd `cmd:"" help:"Delete a time entry"`
Log TimeLogCmd `cmd:"" help:"Quick time entry (wizard if no args)"`
}
TimeCmd groups time entry subcommands.
type TimeEditCmd ¶
type TimeEditCmd struct {
ID int64 `arg:"" help:"Time entry ID"`
Project string `help:"Project ID or name"`
Task string `help:"Task ID or name"`
Date string `help:"Date"`
Hours float64 `help:"Hours"`
Start string `help:"Start time"`
End string `help:"End time"`
Notes string `help:"Notes"`
ExtRefID string `help:"External reference ID (e.g., JIRA-123)" name:"external-ref-id"`
ExtRefGroupID string `help:"External reference group ID" name:"external-ref-group-id"`
ExtRefURL string `help:"External reference URL" name:"external-ref-url"`
ExtRefService string `help:"External reference service name (e.g., jira, asana)" name:"external-ref-service"`
}
TimeEditCmd updates an existing time entry.
func (*TimeEditCmd) Run ¶
func (c *TimeEditCmd) Run(cli *CLI) error
type TimeListCmd ¶
type TimeListCmd struct {
From string `help:"Start date (YYYY-MM-DD or 'today')" short:"f"`
To string `help:"End date" short:"t"`
User string `help:"Filter by user ID or 'me'"`
Project string `help:"Filter by project ID or name"`
HarvestClient string `help:"Filter by client ID or name" name:"harvest-client" short:"c"`
Task string `help:"Filter by task ID"`
Billed bool `help:"Only billed entries"`
Unbilled bool `help:"Only unbilled entries"`
Running bool `help:"Only running timers"`
ApprovalStatus string `help:"Filter by approval status" enum:",unsubmitted,submitted,approved" default:""`
All bool `help:"Fetch all history instead of defaulting to the last 30 days"`
}
TimeListCmd lists time entries with filters.
func (*TimeListCmd) Run ¶
func (c *TimeListCmd) Run(cli *CLI) error
type TimeLogCmd ¶
type TimeLogCmd struct {
Notes string `arg:"" optional:"" help:"Entry notes"`
Project string `help:"Project ID or name" short:"p"`
Task string `help:"Task ID or name"`
Hours float64 `help:"Hours" short:"h"`
Date string `help:"Date (default: today)" short:"d"`
}
TimeLogCmd provides quick time entry with wizard fallback.
func (*TimeLogCmd) Run ¶
func (c *TimeLogCmd) Run(cli *CLI) error
type TimeRemoveCmd ¶
type TimeRemoveCmd struct {
ID int64 `arg:"" help:"Time entry ID"`
Force bool `help:"Skip confirmation" short:"f"`
}
TimeRemoveCmd deletes a time entry.
func (*TimeRemoveCmd) Run ¶
func (c *TimeRemoveCmd) Run(cli *CLI) error
type TimeShowCmd ¶
type TimeShowCmd struct {
ID int64 `arg:"" help:"Time entry ID"`
}
TimeShowCmd shows a single time entry.
func (*TimeShowCmd) Run ¶
func (c *TimeShowCmd) Run(cli *CLI) error
type TimerCmd ¶
type TimerCmd struct {
Status TimerStatusCmd `cmd:"" default:"1" help:"Show running timer"`
Start TimerStartCmd `cmd:"" help:"Start a timer"`
Stop TimerStopCmd `cmd:"" help:"Stop running timer"`
Restart TimerRestartCmd `cmd:"" help:"Restart a stopped timer"`
Toggle TimerToggleCmd `cmd:"" help:"Toggle timer (stop if running, start last if not)"`
}
TimerCmd groups timer subcommands.
type TimerRestartCmd ¶
type TimerRestartCmd struct {
ID int64 `arg:"" help:"Time entry ID to restart"`
}
TimerRestartCmd restarts a stopped time entry.
func (*TimerRestartCmd) Run ¶
func (c *TimerRestartCmd) Run(cli *CLI) error
Run executes the restart command.
type TimerStartCmd ¶
type TimerStartCmd struct {
Project string `help:"Project ID or name" short:"p"`
Task string `help:"Task ID or name"`
Notes string `help:"Notes" short:"n"`
}
TimerStartCmd starts a new timer.
func (*TimerStartCmd) Run ¶
func (c *TimerStartCmd) Run(cli *CLI) error
Run executes the start command.
type TimerStatusCmd ¶
type TimerStatusCmd struct{}
TimerStatusCmd shows the current running timer.
func (*TimerStatusCmd) Run ¶
func (c *TimerStatusCmd) Run(cli *CLI) error
Run executes the status command.
type TimerStopCmd ¶
type TimerStopCmd struct{}
TimerStopCmd stops the running timer.
func (*TimerStopCmd) Run ¶
func (c *TimerStopCmd) Run(cli *CLI) error
Run executes the stop command.
type TimerToggleCmd ¶
type TimerToggleCmd struct {
Project string `help:"Project for new timer if starting" short:"p"`
Task string `help:"Task for new timer"`
}
TimerToggleCmd toggles the timer (stop if running, start last if not).
func (*TimerToggleCmd) Run ¶
func (c *TimerToggleCmd) Run(cli *CLI) error
Run executes the toggle command.
type UsersAddCmd ¶
type UsersAddCmd struct {
Email string `help:"User email" required:""`
FirstName string `help:"First name" required:"" name:"first-name"`
LastName string `help:"Last name" required:"" name:"last-name"`
Timezone string `help:"Timezone"`
HasAccessToAllFutureProjects *bool `help:"Has access to all future projects" name:"access-all-projects"`
IsContractor *bool `help:"Is contractor" name:"contractor"`
IsActive *bool `help:"Is active" name:"active"`
WeeklyCapacity *int `help:"Weekly capacity (seconds)" name:"weekly-capacity"`
DefaultHourlyRate *float64 `help:"Default hourly rate" name:"hourly-rate"`
CostRate *float64 `help:"Cost rate" name:"cost-rate"`
Roles []string `help:"Roles (comma-separated)"`
AccessRoles []string `help:"Access roles (comma-separated)" name:"access-roles"`
}
UsersAddCmd creates a new user.
func (*UsersAddCmd) Run ¶
func (c *UsersAddCmd) Run(cli *CLI) error
type UsersCmd ¶
type UsersCmd struct {
List UsersListCmd `cmd:"" help:"List all users"`
Show UsersShowCmd `cmd:"" help:"Show a user by ID"`
Me UsersMeCmd `cmd:"" help:"Show current authenticated user"`
Add UsersAddCmd `cmd:"" help:"Create a new user"`
Edit UsersEditCmd `cmd:"" help:"Update a user"`
Remove UsersRemoveCmd `cmd:"" help:"Delete/deactivate a user"`
}
UsersCmd groups user subcommands.
type UsersEditCmd ¶
type UsersEditCmd struct {
ID int64 `arg:"" help:"User ID"`
Email string `help:"User email"`
FirstName string `help:"First name" name:"first-name"`
LastName string `help:"Last name" name:"last-name"`
Timezone string `help:"Timezone"`
HasAccessToAllFutureProjects *bool `help:"Has access to all future projects" name:"access-all-projects"`
IsContractor *bool `help:"Is contractor" name:"contractor"`
IsActive *bool `help:"Is active" name:"active"`
WeeklyCapacity *int `help:"Weekly capacity (seconds)" name:"weekly-capacity"`
DefaultHourlyRate *float64 `help:"Default hourly rate" name:"hourly-rate"`
CostRate *float64 `help:"Cost rate" name:"cost-rate"`
Roles []string `help:"Roles (comma-separated)"`
AccessRoles []string `help:"Access roles (comma-separated)" name:"access-roles"`
}
UsersEditCmd updates an existing user.
func (*UsersEditCmd) Run ¶
func (c *UsersEditCmd) Run(cli *CLI) error
type UsersListCmd ¶
type UsersListCmd struct {
Active *bool `help:"Filter by active status"`
UpdatedSince string `help:"Filter by updated_since (ISO 8601)"`
}
UsersListCmd lists all users with optional filters.
func (*UsersListCmd) Run ¶
func (c *UsersListCmd) Run(cli *CLI) error
type UsersMeCmd ¶
type UsersMeCmd struct{}
UsersMeCmd shows the current authenticated user.
func (*UsersMeCmd) Run ¶
func (c *UsersMeCmd) Run(cli *CLI) error
type UsersRemoveCmd ¶
type UsersRemoveCmd struct {
ID int64 `arg:"" help:"User ID"`
Force bool `help:"Skip confirmation" short:"f"`
}
UsersRemoveCmd deletes/deactivates a user.
func (*UsersRemoveCmd) Run ¶
func (c *UsersRemoveCmd) Run(cli *CLI) error
type UsersShowCmd ¶
type UsersShowCmd struct {
ID int64 `arg:"" help:"User ID"`
}
UsersShowCmd shows a single user by ID.
func (*UsersShowCmd) Run ¶
func (c *UsersShowCmd) Run(cli *CLI) error
type VersionCmd ¶
type VersionCmd struct{}
VersionCmd prints version info.
func (*VersionCmd) Run ¶
func (c *VersionCmd) Run() error