commands

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAPICmd

func NewAPICmd(app *App) *cobra.Command

NewAPICmd creates the 'api' command for raw API access.

This is the CLI's escape hatch for endpoints not yet covered by purpose-built subcommands. After Phase 3 the typed Freelo client covers the whole OpenAPI spec, but `api get/post/put/delete` is still useful for calling internal / undocumented endpoints or for quick debugging.

All four subcommands route through the SDK's Do, so they get the same auth + User-Agent + rate-limit + retry as the typed commands.

func NewAuthCmd

func NewAuthCmd(app *App) *cobra.Command

NewAuthCmd creates the 'auth' command group.

func NewCommentsCmd

func NewCommentsCmd(app *App) *cobra.Command

NewCommentsCmd creates the 'comments' command group.

Same dead-command situation as subtasks: the pre-v1.0.0 CLI exposed `delete` calling DELETE /comment/{id}, but the server returns 404 for that verb — probed live and the spec only documents POST /comment/{id} (edit). The Freelo API has no comment deletion. Dropped before v1.0.0 to avoid shipping a command that can never succeed.

func NewCustomFieldsCmd

func NewCustomFieldsCmd(app *App) *cobra.Command

func NewEventsCmd

func NewEventsCmd(app *App) *cobra.Command

NewEventsCmd creates the 'events' command group.

Phase 3 migration: single read-only listing endpoint (/events) via app.FreeloClient.GetAllEvents with typed filter params.

func NewFilesCmd

func NewFilesCmd(app *App) *cobra.Command

func NewInvoicesCmd

func NewInvoicesCmd(app *App) *cobra.Command

func NewLabelsCmd

func NewLabelsCmd(app *App) *cobra.Command

NewLabelsCmd creates the 'labels' command group.

Phase 3 migration: the two task-label mutation endpoints use oneOf request schemas (TaskLabelAddInput / TaskLabelRemoveInput), so the body is built via the From* helpers on the generated union types. Project- label operations are straightforward typed bodies.

func NewNotesCmd

func NewNotesCmd(app *App) *cobra.Command

func NewNotificationsCmd

func NewNotificationsCmd(app *App) *cobra.Command

NewNotificationsCmd creates the 'notifications' command group.

Phase 3 migration: uses app.FreeloClient.

func NewOutOfOfficeCmd

func NewOutOfOfficeCmd(app *App) *cobra.Command

func NewPinnedCmd

func NewPinnedCmd(app *App) *cobra.Command

func NewProjectsCmd

func NewProjectsCmd(app *App) *cobra.Command

NewProjectsCmd creates the 'projects' command group.

Phase 3 migration: subcommands use app.FreeloClient. See tasks.go for the overall approach (raw *http.Response methods, not *WithResponse).

func NewReportsCmd

func NewReportsCmd(app *App) *cobra.Command

NewReportsCmd creates the 'reports' command group (work reports).

func NewSearchCmd

func NewSearchCmd(app *App) *cobra.Command

NewSearchCmd creates the 'search' command.

Phase 3 migration: POST /search via app.FreeloClient.

func NewSkillCmd

func NewSkillCmd(app *App) *cobra.Command

NewSkillCmd creates the 'skill' command for agent skill management.

func NewSubtasksCmd

func NewSubtasksCmd(app *App) *cobra.Command

NewSubtasksCmd creates the 'subtasks' command group.

The Freelo API only supports listing and creating subtasks (endpoints /task/{id}/subtasks). The pre-v1.0.0 CLI exposed `show`, `finish`, `activate`, and `delete` subcommands calling /subtask/{id}{/finish,...}, but every one of those paths returns 404 from the server — even with a real subtask ID. They never worked. Dropped in Phase 3 to match the actual API surface documented in the OpenAPI spec.

func NewTaskchecksCmd added in v1.3.0

func NewTaskchecksCmd(app *App) *cobra.Command

NewTaskchecksCmd creates the 'taskchecks' command group.

Taskchecks are checklist-style items on a task. The Freelo API exposes only mutation endpoints under /taskcheck/{id} — there is no list/create endpoint (taskchecks are created via the subtasks API, subtask type "taskcheck"). So this group is edit/activate/finish/delete only.

func NewTasklistsCmd

func NewTasklistsCmd(app *App) *cobra.Command

NewTasklistsCmd creates the 'tasklists' command group.

Phase 3 migration: all subcommands use app.FreeloClient via the raw *http.Response methods.

func NewTasksCmd

func NewTasksCmd(app *App) *cobra.Command

NewTasksCmd creates the 'tasks' command group.

Phase 3 migration: all subcommands call the oapi-codegen-generated typed client via app.FreeloClient. We deliberately use the raw *http.Response methods (not the *WithResponse typed ones) and decode the body ourselves — see readRawBody in helpers.go for the rationale.

func NewTemplatesCmd

func NewTemplatesCmd(app *App) *cobra.Command

func NewTrackingCmd

func NewTrackingCmd(app *App) *cobra.Command

NewTrackingCmd creates the 'tracking' command group.

func NewUsersCmd

func NewUsersCmd(app *App) *cobra.Command

NewUsersCmd creates the 'users' command group.

Phase 3 migration: uses app.FreeloClient.

func NewVersionCmd

func NewVersionCmd(app *App) *cobra.Command

NewVersionCmd creates the 'version' command.

func NewWorkersCmd

func NewWorkersCmd(app *App) *cobra.Command

Types

type App

type App struct {
	Config       *config.Config
	Auth         *credstore.Store
	FreeloClient *freeloapi.ClientWithResponses
	SDK          *freelosdk.Client
	Output       func() *output.Writer
	Version      string
}

App is the shared dependency container passed to every command.

Cobra resolves the root persistent flags (--dev, --json, etc.) before dispatching to a leaf RunE; only at that point do we know which Freelo instance / credential store / output format to wire up. So root.go constructs a single empty *App at startup, hands the same pointer to every command builder, and mutates the struct in place from PersistentPreRunE. Leaf RunE callbacks then read app.* live — the pointer they captured at build time is the same pointer root.go just populated.

This deliberately keeps the dependency wiring boring: no lazy wrappers, no per-call command-tree rebuild, no Use-string-based lookups. A single *App, mutated once per process invocation, observed by every leaf.

type PaginatedResult

type PaginatedResult struct {
	Total int
	Count int
	Page  int
}

PaginatedResult holds parsed paginated API response metadata.

Jump to

Keyboard shortcuts

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