Documentation
¶
Overview ¶
Package cli provides command-line interface functionality for Simple Easy Tasks.
Index ¶
- func AddProfile(profile Profile) error
- func Error(format string, args ...interface{})
- func Execute() error
- func GetConfigAsJSON() (string, error)
- func Info(format string, args ...interface{})
- func RemoveProfile(profileName string) error
- func RenderProjectDetails(project *domain.Project, includeTasks bool, client *APIClient, format string) error
- func RenderProjects(projects []domain.Project, defaultProjectID, format string) error
- func RenderTaskDetails(task interface{}, format string) error
- func RenderTasks(tasks []domain.Task, format string) error
- func SaveConfig(config *Config) error
- func SetCurrentProfile(profileName string) error
- func Success(format string, args ...interface{})
- func ValidateProfile(profile *Profile) error
- func Warning(format string, args ...interface{})
- type APIClient
- func (c *APIClient) CreateProject(req *CreateProjectRequest) (*domain.Project, error)
- func (c *APIClient) CreateTask(projectID string, req *CreateTaskRequest) (*domain.Task, error)
- func (c *APIClient) DeleteTask(projectID, taskID string) error
- func (c *APIClient) GetProject(projectID string) (*domain.Project, error)
- func (c *APIClient) GetProjects() ([]domain.Project, error)
- func (c *APIClient) GetTasks(projectID string, options *TaskListOptions) ([]domain.Task, error)
- func (c *APIClient) Health() error
- func (c *APIClient) Login(email, password string) (*LoginResponse, error)
- func (c *APIClient) TestConnection() error
- func (c *APIClient) UpdateTask(projectID, taskID string, req *UpdateTaskRequest) (*domain.Task, error)
- type APIError
- type Config
- type CreateProjectRequest
- type CreateTaskRequest
- type LoginResponse
- type Profile
- type TaskListOptions
- type UpdateTaskRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddProfile ¶
AddProfile adds a new profile to the configuration
func Execute ¶
func Execute() error
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func GetConfigAsJSON ¶
GetConfigAsJSON returns configuration as JSON string for debugging
func RemoveProfile ¶
RemoveProfile removes a profile from the configuration
func RenderProjectDetails ¶
func RenderProjectDetails(project *domain.Project, includeTasks bool, client *APIClient, format string) error
RenderProjectDetails renders detailed project information
func RenderProjects ¶
RenderProjects renders a list of projects in the specified format
func RenderTaskDetails ¶
RenderTaskDetails renders detailed task information
func RenderTasks ¶
RenderTasks renders a list of tasks in the specified format
func SetCurrentProfile ¶
SetCurrentProfile sets the default profile
func Success ¶
func Success(format string, args ...interface{})
Success prints a success message with a checkmark
func ValidateProfile ¶
ValidateProfile validates a profile configuration
Types ¶
type APIClient ¶
APIClient handles communication with the Simple Easy Tasks API
func NewAPIClient ¶
NewAPIClient creates a new API client
func NewAPIClientFromProfile ¶
NewAPIClientFromProfile creates an API client from a profile
func (*APIClient) CreateProject ¶
func (c *APIClient) CreateProject(req *CreateProjectRequest) (*domain.Project, error)
CreateProject creates a new project
func (*APIClient) CreateTask ¶
CreateTask creates a new task
func (*APIClient) DeleteTask ¶
DeleteTask deletes a task
func (*APIClient) GetProject ¶
GetProject retrieves a specific project
func (*APIClient) GetProjects ¶
GetProjects retrieves all projects
func (*APIClient) Login ¶
func (c *APIClient) Login(email, password string) (*LoginResponse, error)
Login authenticates with email and password
func (*APIClient) TestConnection ¶
TestConnection tests the connection to the API
func (*APIClient) UpdateTask ¶
func (c *APIClient) UpdateTask(projectID, taskID string, req *UpdateTaskRequest) (*domain.Task, error)
UpdateTask updates an existing task
type APIError ¶
type APIError struct { StatusCode int `json:"status_code"` Message string `json:"message"` Details string `json:"details"` }
APIError represents an API error response
type Config ¶
type Config struct { DefaultProfile string `json:"default_profile" yaml:"default_profile"` Profiles map[string]Profile `json:"profiles" yaml:"profiles"` }
Config represents the CLI configuration
type CreateProjectRequest ¶
type CreateProjectRequest struct { Title string `json:"title"` Description string `json:"description"` }
CreateProjectRequest represents a project creation request
type CreateTaskRequest ¶
type CreateTaskRequest struct { Title string `json:"title"` Description string `json:"description"` Priority string `json:"priority"` AssigneeID string `json:"assignee_id,omitempty"` Status string `json:"status,omitempty"` }
CreateTaskRequest represents a task creation request
type LoginResponse ¶
LoginResponse represents the response from login
type Profile ¶
type Profile struct { Name string `json:"name" yaml:"name"` ServerURL string `json:"server_url" yaml:"server_url"` Token string `json:"token" yaml:"token"` ProjectID string `json:"project_id" yaml:"project_id"` }
Profile represents a configuration profile for different environments
func GetCurrentProfile ¶
GetCurrentProfile returns the current active profile
func ListProfiles ¶
ListProfiles returns all available profiles
type TaskListOptions ¶
type TaskListOptions struct { Status []string Assignee string Priority []string Tags []string Search string Limit int }
TaskListOptions represents options for listing tasks
type UpdateTaskRequest ¶
type UpdateTaskRequest struct { Title *string `json:"title,omitempty"` Description *string `json:"description,omitempty"` Priority *string `json:"priority,omitempty"` Status *string `json:"status,omitempty"` AssigneeID *string `json:"assignee_id,omitempty"` }
UpdateTaskRequest represents a task update request