Documentation
¶
Overview ¶
Package cmd implements all td CLI commands using cobra.
Index ¶
- func AddFeatureGatedCommand(featureName string, command *cobra.Command)
- func AutoSyncEnabled() bool
- func Execute()
- func RegisterSyncFeatureHooks(hooks SyncFeatureHooks)
- func SetVersion(v string)
- func ValidateIssueID(id string, cmdUsage string) error
- func ValidateIssueIDs(ids []string, cmdUsage string) error
- type RuntimeStats
- type SubmitReviewResult
- type SyncFeatureHooks
- type SyncStatusReport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddFeatureGatedCommand ¶ added in v0.30.0
AddFeatureGatedCommand registers a command only when its feature is enabled for the current process (env overrides + defaults).
func AutoSyncEnabled ¶ added in v0.30.0
func AutoSyncEnabled() bool
AutoSyncEnabled returns true if auto-sync is enabled via config.
func RegisterSyncFeatureHooks ¶ added in v0.30.0
func RegisterSyncFeatureHooks(hooks SyncFeatureHooks)
RegisterSyncFeatureHooks registers sync-related hooks.
func SetVersion ¶
func SetVersion(v string)
SetVersion sets the version string and enables --version flag
func ValidateIssueID ¶ added in v0.4.21
ValidateIssueID checks if an issue ID is valid (non-empty, non-whitespace) Returns an error with helpful usage info if invalid
func ValidateIssueIDs ¶ added in v0.4.21
ValidateIssueIDs validates multiple issue IDs
Types ¶
type RuntimeStats ¶ added in v0.30.0
type RuntimeStats struct {
AllocMB float64 `json:"alloc_mb"`
SysMB float64 `json:"sys_mb"`
NumGC uint32 `json:"num_gc"`
NumGoroutine int `json:"num_goroutine"`
HeapObjects uint64 `json:"heap_objects"`
HeapInuseMB float64 `json:"heap_inuse_mb"`
}
RuntimeStats contains runtime metrics for soak testing
type SubmitReviewResult ¶ added in v0.13.0
SubmitReviewResult holds the result of a review submission
type SyncFeatureHooks ¶ added in v0.30.0
type SyncFeatureHooks struct {
OnStartup func(commandName string)
OnAfterMutation func()
IsMutatingCommand func(commandName string) bool
}
SyncFeatureHooks exposes optional sync hooks that can be registered by sync-specific command files. These hooks are gated by feature flags.
type SyncStatusReport ¶ added in v0.52.0
type SyncStatusReport struct {
// Gate is the resolved autosync gate state: "ON", "OFF", or "KILLED".
// It mirrors the real decision (autosyncGateOpen + globalKillSwitchOff) so
// this never diverges from what autosync actually does.
Gate string `json:"gate"`
// GateSource explains WHERE the gate decision came from:
// "global-kill-switch" — global autosync override resolved to false
// "explicit-env" — sync_autosync set explicitly via env var
// "explicit-config" — sync_autosync set explicitly via project config
// "derived-per-project" — no explicit override; per-project config decides
GateSource string `json:"gate_source"`
// Configured reports whether the project has a usable sync_state row
// (present, non-empty ProjectID, not disabled).
Configured bool `json:"configured"`
ProjectID string `json:"project_id,omitempty"`
Authenticated bool `json:"authenticated"`
ServerURL string `json:"server_url"`
// PendingEvents is the count of unsynced action_log rows. -1 means the
// count could not be determined (e.g. no DB), distinct from a real 0.
PendingEvents int64 `json:"pending_events"`
LastSyncAt string `json:"last_sync_at,omitempty"`
// Notes carries non-fatal degradation messages (e.g. DB could not be opened)
// so the diagnostic never hard-errors but still surfaces the problem.
Notes []string `json:"notes,omitempty"`
}
SyncStatusReport is the machine-readable result of `td sync status`. It is a pure data struct so the gather logic can be unit-tested without a cobra command or terminal. The thin printer (printSyncStatusText / output.JSON) renders it.
Source Files
¶
- associate.go
- auth.go
- autosync.go
- block.go
- board.go
- config.go
- context.go
- create.go
- current_state.go
- debug_stats.go
- defer.go
- delete.go
- dependencies.go
- doctor.go
- doctor_fk.go
- due.go
- epic.go
- errors.go
- feature.go
- feature_gate.go
- focus.go
- handoff.go
- init.go
- link.go
- list.go
- log.go
- monitor.go
- note.go
- output_helpers.go
- project.go
- query.go
- review.go
- review_policy.go
- rich_text_input.go
- root.go
- search.go
- security.go
- serve.go
- show.go
- start.go
- stats.go
- stats_analytics.go
- stats_errors.go
- stats_security.go
- status.go
- sync.go
- sync_conflicts.go
- sync_init.go
- sync_status.go
- sync_tail.go
- system.go
- task.go
- tree.go
- undo.go
- unstart.go
- update.go
- workflow.go
- ws.go