Documentation
¶
Index ¶
- Constants
- Variables
- func Board() string
- func DryRun() bool
- func Execute() error
- func ExitCodeFromError(err error) int
- func FormatFileSize(bytes int64) string
- func IssueURL(baseURL, key string) string
- func JSONOutput() bool
- func NoColor() bool
- func PrintBatchResults(results []BatchResult) error
- func PrintDryRun(action string)
- func PrintDryRunBatch(keys []string, action string)
- func PrintSuccess(message string)
- func PrintSuccessJSON(v any)
- func Project() string
- func ProjectURL(baseURL, projectKey string) string
- func Quiet() bool
- func ReadKeysFromStdin() ([]string, error)
- func RenderMarkdown(markdown string) string
- func Verbose() bool
- type AttachmentAddResult
- type AttachmentDownloadResult
- type AttachmentInfo
- type AttachmentRemoveResult
- type BatchResult
- type BatchSummary
- type BoardInfo
- type CloneResult
- type CommentInfo
- type CommentResult
- type CreateResult
- type ExitError
- type FieldInfo
- type IssueDetail
- type IssueInfo
- type LinkInfo
- type LinkResult
- type ProjectInfo
- type ReleaseInfo
- type RemoteLinkResult
- type RemoveResult
- type SprintInfo
- type User
- type UserInfo
Constants ¶
const ( ExitSuccess = 0 // Successful execution ExitUserError = 1 // User/input error (invalid args, missing required values) ExitAPIError = 2 // API error (4xx/5xx responses, except auth) ExitNetError = 3 // Network/connection error ExitAuthError = 4 // Authentication error (401, 403) ExitPartial = 5 // Partial failure in batch operations )
Exit codes for the CLI.
Variables ¶
var (
// Version is set at build time via -ldflags.
Version = "dev"
)
Functions ¶
func ExitCodeFromError ¶
ExitCodeFromError determines the appropriate exit code for an error. Returns ExitSuccess (0) if err is nil.
func FormatFileSize ¶
FormatFileSize formats a file size in bytes to a human-readable string. Uses 1024-based units with SI prefixes (KB, MB, GB).
func PrintBatchResults ¶
func PrintBatchResults(results []BatchResult) error
PrintBatchResults prints batch operation results. Returns an ExitError with ExitPartial if there were any failures.
func PrintDryRun ¶
func PrintDryRun(action string)
PrintDryRun prints what would happen for a single operation.
func PrintDryRunBatch ¶
PrintDryRunBatch prints what would happen for a batch operation.
func PrintSuccess ¶
func PrintSuccess(message string)
PrintSuccess prints a success message unless quiet mode is enabled.
func PrintSuccessJSON ¶
func PrintSuccessJSON(v any)
PrintSuccessJSON prints JSON output unless quiet mode is enabled.
func ProjectURL ¶
ProjectURL returns the browse URL for a project key.
func ReadKeysFromStdin ¶
ReadKeysFromStdin reads issue keys from stdin (one per line).
func RenderMarkdown ¶
RenderMarkdown renders markdown with terminal styling. Falls back to plain text if rendering fails, output is not a TTY, or --no-color is set.
Types ¶
type AttachmentAddResult ¶
type AttachmentAddResult struct {
IssueKey string `json:"issueKey"`
Attachments []AttachmentInfo `json:"attachments"`
}
AttachmentAddResult represents the result of adding attachments.
type AttachmentDownloadResult ¶
type AttachmentDownloadResult struct {
ID string `json:"id"`
Filename string `json:"filename"`
Size int64 `json:"size"`
Output string `json:"output"`
}
AttachmentDownloadResult represents the result of downloading an attachment.
type AttachmentInfo ¶
type AttachmentInfo struct {
ID string `json:"id"`
Filename string `json:"filename"`
Size int64 `json:"size"`
MimeType string `json:"mimeType"`
Author string `json:"author"`
Created string `json:"created"`
Content string `json:"content,omitempty"`
}
AttachmentInfo represents an attachment for display.
type AttachmentRemoveResult ¶
type AttachmentRemoveResult struct {
IssueKey string `json:"issueKey"`
Removed []string `json:"removed"`
Count int `json:"count"`
}
AttachmentRemoveResult represents the result of removing attachments.
type BatchResult ¶
type BatchResult struct {
Key string `json:"key"`
Success bool `json:"success"`
Error string `json:"error,omitempty"`
}
BatchResult represents the outcome of a single batch operation.
type BatchSummary ¶
type BatchSummary struct {
Results []BatchResult `json:"results"`
Total int `json:"total"`
Succeeded int `json:"succeeded"`
Failed int `json:"failed"`
}
BatchSummary represents the overall batch operation outcome.
type BoardInfo ¶
type BoardInfo struct {
ID int `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
Project string `json:"project,omitempty"`
}
BoardInfo represents a Jira board for output.
type CloneResult ¶
type CloneResult struct {
OriginalKey string `json:"originalKey"`
ClonedKey string `json:"clonedKey"`
ClonedID string `json:"clonedId"`
Linked bool `json:"linked"`
LinkType string `json:"linkType,omitempty"`
}
CloneResult represents the result of cloning an issue.
type CommentInfo ¶
type CommentInfo struct {
ID string `json:"id"`
Author string `json:"author"`
Created string `json:"created"`
Body string `json:"body"`
}
CommentInfo represents a comment on an issue.
type CommentResult ¶
type CommentResult struct {
ID string `json:"id"`
Self string `json:"self"`
Created string `json:"created"`
}
CommentResult represents the result of adding a comment.
type CreateResult ¶
type CreateResult struct {
Key string `json:"key"`
ID string `json:"id"`
Self string `json:"self"`
}
CreateResult represents the result of creating an issue.
type ExitError ¶
ExitError wraps an error with an exit code.
func NewExitError ¶
NewExitError creates a new ExitError with the given code and error.
type FieldInfo ¶
type FieldInfo struct {
ID string `json:"id"`
Name string `json:"name"`
Custom bool `json:"custom"`
Type string `json:"type,omitempty"`
}
FieldInfo represents a Jira field.
type IssueDetail ¶
type IssueDetail struct {
Key string `json:"key"`
Summary string `json:"summary"`
Status string `json:"status"`
Type string `json:"type"`
Priority string `json:"priority"`
Assignee string `json:"assignee"`
Reporter string `json:"reporter"`
Created string `json:"created"`
Updated string `json:"updated"`
Description string `json:"description"`
Labels []string `json:"labels"`
Project string `json:"project"`
Links []LinkInfo `json:"links,omitempty"`
Attachments []AttachmentInfo `json:"attachments,omitempty"`
Comments []CommentInfo `json:"comments,omitempty"`
TotalComments int `json:"total_comments,omitempty"`
}
IssueDetail represents a full Jira issue for output.
type IssueInfo ¶
type IssueInfo struct {
Key string `json:"key"`
Summary string `json:"summary"`
Status string `json:"status"`
StatusCategory string `json:"statusCategory"`
Type string `json:"type"`
Priority string `json:"priority"`
Assignee string `json:"assignee"`
}
IssueInfo represents a Jira issue for output.
type LinkInfo ¶
type LinkInfo struct {
Direction string `json:"direction"`
Key string `json:"key"`
Status string `json:"status"`
Summary string `json:"summary"`
}
LinkInfo represents a linked issue for display.
type LinkResult ¶
type LinkResult struct {
OutwardIssue string `json:"outwardIssue"`
InwardIssue string `json:"inwardIssue"`
Type string `json:"type"`
}
LinkResult represents the result of creating a link.
type ProjectInfo ¶
type ProjectInfo struct {
ID string `json:"id"`
Key string `json:"key"`
Name string `json:"name"`
Lead string `json:"lead"`
Style string `json:"style"`
}
ProjectInfo represents a Jira project.
type ReleaseInfo ¶
type ReleaseInfo struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Released bool `json:"released"`
Archived bool `json:"archived"`
ReleaseDate string `json:"releaseDate,omitempty"`
StartDate string `json:"startDate,omitempty"`
}
ReleaseInfo represents a project version/release.
type RemoteLinkResult ¶
type RemoteLinkResult struct {
ID int `json:"id"`
Self string `json:"self"`
Issue string `json:"issue"`
URL string `json:"url"`
Title string `json:"title"`
}
RemoteLinkResult represents the result of adding a remote link.
type RemoveResult ¶
type RemoveResult struct {
Issue1 string `json:"issue1"`
Issue2 string `json:"issue2"`
LinksRemoved int `json:"linksRemoved"`
}
RemoveResult represents the result of removing links.
type SprintInfo ¶
type SprintInfo struct {
ID int `json:"id"`
Name string `json:"name"`
State string `json:"state"`
StartDate string `json:"startDate,omitempty"`
EndDate string `json:"endDate,omitempty"`
Goal string `json:"goal,omitempty"`
}
SprintInfo represents a Jira sprint for output.
Source Files
¶
- batch.go
- board.go
- completion.go
- epic.go
- epic_add.go
- epic_create.go
- epic_list.go
- epic_remove.go
- exitcodes.go
- field.go
- help.go
- input.go
- issue.go
- issue_assign.go
- issue_attachment.go
- issue_attachment_add.go
- issue_attachment_download.go
- issue_attachment_list.go
- issue_attachment_remove.go
- issue_clone.go
- issue_comment.go
- issue_comment_list.go
- issue_create.go
- issue_delete.go
- issue_edit.go
- issue_link.go
- issue_link_add.go
- issue_link_list.go
- issue_link_remove.go
- issue_link_types.go
- issue_link_url.go
- issue_list.go
- issue_move.go
- issue_priority.go
- issue_status.go
- issue_type.go
- issue_view.go
- issue_watch.go
- me.go
- open.go
- project.go
- release.go
- root.go
- sprint.go
- sprint_add.go
- sprint_list.go
- user.go