Documentation
¶
Index ¶
- func NewAPICmd(app *App) *cobra.Command
- func NewAuthCmd(app *App) *cobra.Command
- func NewCommentsCmd(app *App) *cobra.Command
- func NewCustomFieldsCmd(app *App) *cobra.Command
- func NewEventsCmd(app *App) *cobra.Command
- func NewFilesCmd(app *App) *cobra.Command
- func NewInvoicesCmd(app *App) *cobra.Command
- func NewLabelsCmd(app *App) *cobra.Command
- func NewNotesCmd(app *App) *cobra.Command
- func NewNotificationsCmd(app *App) *cobra.Command
- func NewOutOfOfficeCmd(app *App) *cobra.Command
- func NewPinnedCmd(app *App) *cobra.Command
- func NewProjectsCmd(app *App) *cobra.Command
- func NewReportsCmd(app *App) *cobra.Command
- func NewSearchCmd(app *App) *cobra.Command
- func NewSkillCmd(app *App) *cobra.Command
- func NewSubtasksCmd(app *App) *cobra.Command
- func NewTaskchecksCmd(app *App) *cobra.Command
- func NewTasklistsCmd(app *App) *cobra.Command
- func NewTasksCmd(app *App) *cobra.Command
- func NewTemplatesCmd(app *App) *cobra.Command
- func NewTrackingCmd(app *App) *cobra.Command
- func NewUsersCmd(app *App) *cobra.Command
- func NewVersionCmd(app *App) *cobra.Command
- func NewWorkersCmd(app *App) *cobra.Command
- type App
- type PaginatedResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAPICmd ¶
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 ¶
NewAuthCmd creates the 'auth' command group.
func NewCommentsCmd ¶
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 NewEventsCmd ¶
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 NewInvoicesCmd ¶
func NewLabelsCmd ¶
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 NewNotificationsCmd ¶
NewNotificationsCmd creates the 'notifications' command group.
Phase 3 migration: uses app.FreeloClient.
func NewOutOfOfficeCmd ¶
func NewPinnedCmd ¶
func NewProjectsCmd ¶
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 ¶
NewReportsCmd creates the 'reports' command group (work reports).
func NewSearchCmd ¶
NewSearchCmd creates the 'search' command.
Phase 3 migration: POST /search via app.FreeloClient.
func NewSkillCmd ¶
NewSkillCmd creates the 'skill' command for agent skill management.
func NewSubtasksCmd ¶
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
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 ¶
NewTasklistsCmd creates the 'tasklists' command group.
Phase 3 migration: all subcommands use app.FreeloClient via the raw *http.Response methods.
func NewTasksCmd ¶
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 NewTrackingCmd ¶
NewTrackingCmd creates the 'tracking' command group.
func NewUsersCmd ¶
NewUsersCmd creates the 'users' command group.
Phase 3 migration: uses app.FreeloClient.
func NewVersionCmd ¶
NewVersionCmd creates the 'version' command.
func NewWorkersCmd ¶
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 ¶
PaginatedResult holds parsed paginated API response metadata.