jiratui
repository·main·Indexed 21 days ago
https://github.com/whyisdifficult/jiratuiA Text User Interface (TUI) and CLI tool for interacting with Atlassian Jira Cloud and Data Center from the terminal. Built with Textual and Rich, it allows users to search, update, and delete work items, manage comments, and search for users. It features a comprehensive TUI with specialized widgets for Jira field types and a CLI for direct resource interaction.
What's inside jiratui
- JiraTUI is a Text User Interface (TUI) designed for interacting with Atlassian's Jira directly from your terminal/shell. It provides both a graphical TUI application and a CLI interface for managing Jira issues.
Understand the JiraTUI codebase structure
mainThe JiraTUI codebase is organized into several functional modules located under
src/jiratui/. Understanding this structure helps in locating specific logic for API interactions, UI components, or CLI commands:api: Contains the core Jira API implementation classes and functionality.api_controller: Manages classes and functionality related to the API controller.widgets: The primary module for UI components. It includes submodules for specific features likeattachments,comments,work_item_details, etc.widgets.commons: A collection of reusable widgets and functionality intended for use across multiple modules.commands: Defines the handler and render classes used by the CLI application.css: Contains.tcssfiles used for styling the UI components.utils: A collection of common utility classes and functions.jtsite: Contains the source files for the public website (jiratui.sh).
Use Search widgets in JiraTUI
mainThejiratui.widgets.searchmodule provides components for searching and displaying Jira issues within the application. It includes specialized widgets for inputting search queries, displaying results in a table format, and managing the overall search results container.Use Filter Widgets in JiraTUI
mainThejiratui.widgets.filtersmodule provides a collection of UI components designed to filter Jira issue searches. These widgets allow users to narrow down results by project, issue type, status, date ranges, and more. They are intended to be used within the JiraTUI interface to refine JQL queries dynamically.Use the Go-To feature to navigate related work items
mainThe Go-To feature allows you to quickly jump to items related to a currently selected work item (such as its parent or subtasks).
To access the Go-To screen, select a work item and press the
f6key. This shortcut is available in three locations:- The search results table.
- The Related tab (list of related tasks).
- The Subtasks tab.
Once the Go-To screen is open, it automatically fetches and populates data tables containing the item's details, its parent, and its subtasks.
How project, issue type, status, and user filters interact
mainThe four primary filters at the top of the application are linked to ensure valid selections:
- Projects: Selecting a project automatically updates the available Issue Types, Status Codes, and Users.
- Issue Types: If a project is selected, only types applicable to that project are shown. If no project is selected, all known types are shown (which may result in duplicate names across different projects).
- Status Codes: If a project is selected, only statuses applicable to that project's issue types are shown.
- Users (Assignee): Users are filtered by name or email. If a project is selected, the list is further restricted to users associated with that project's key.
Project Visibility: A project appears in the list only if the user has one of the following Jira permissions:
Browse ProjectsAdminister ProjectsAdminister Jira(global)
Configuration:
default_project_key_or_id: If set with a case-sensitive project key, JiraTUI will only fetch and load that specific project instead of all available projects.
Configure Jira permissions and scopes
mainJiraTUI requires specific permissions (known as "scopes" in Jira) to function. These permissions must be granted by your organization's Jira administrator to your user account. JiraTUI cannot set these permissions itself.Choose the correct Jira REST API version
mainJiraTUI supports three distinct API versions depending on your Jira environment and requirements.
- Jira Cloud Platform API v3: The recommended version for Jira Cloud. It supports Atlassian Document Format (ADF) for rich text formatting in descriptions and comments.
- Jira Cloud Platform API v2: A legacy option for Jira Cloud. It uses the same endpoints as v3 but lacks ADF support.
- Data Center v7.6.1: Used for on-premises (Jira DC) installations. Note that the endpoints and available operations differ significantly from the Cloud versions, and Atlassian is deprecating Data Center products.
Understand the JiraTUI UI component structure
mainJiraTUI is organized into several distinct functional screens and views. Understanding these views helps in navigating the application and knowing where specific work item data is located:
Navigation & Search
- Main Screen: The entry point of the application.
- Search Results: The view used to display the list of issues returned from a search query.
Work Item Views
When viewing a specific work item, the information is partitioned into several specialized tabs/components:
- Work Item Information: Displays text-based fields.
- Work Item Details: Displays key metadata and details.
- Work Item Comments: Displays the history of comments.
- Work Item Web Links: Displays associated web links.
- Work Item Related Tasks: Displays linked or related tasks.
- Work Item Subtasks: Displays child tasks/subtasks.
- Work Item Attachments: Displays files attached to the item.
Action Screens
Specific workflows are handled by dedicated screens:
- Create Work Item Screen: For generating new issues.
- Add Comment Screen: For adding new comments to an existing issue.
- Attach Files Screen: For uploading files to an issue.
- Relate Work Items: For establishing relationships between two existing work items.
Understand the JiraTUI UI Component Architecture
mainJiraTUI's UI is built using a hierarchical structure of widgets and screens, primarily leveraging the
textualframework. The architecture follows a pattern where specializedScreenobjects (likeAddWorkItemScreenorWorkItemWorkLogScreen) manage complex user flows, whileWidgetcomponents (likeIssueDetailsWidgetorRelatedIssuesWidget) handle specific data displays or input tasks.Key architectural patterns include:
- Screens for Workflows: High-level tasks (adding a comment, creating a work item, logging time) are encapsulated in dedicated
Screenclasses. - Widget Composition: Complex views like
IssueDetailsWidgetare composed of multiple specialized field widgets (e.g.,LabelsWidget,MultiSelectWidget,DateInputWidget). - Collapsible Components: For managing lists of related items (comments, links, subtasks), the UI uses collapsible patterns (e.g.,
CommentCollapsible,IssueRemoteLinkCollapsible) to manage vertical space.
- Screens for Workflows: High-level tasks (adding a comment, creating a work item, logging time) are encapsulated in dedicated
Important considerations for the docs directory
mainThe
docsdirectory contains a symlink tosrc/jiratui. This allows Sphinx to parse the codebase and generate documentation from Markdown syntax inside docstrings.Developer Precautions:
- IDE Indexing: Exclude the
docsdirectory from your IDE's indexing to prevent performance issues or indexing errors. - Module Imports: Do not import modules from the
docsdirectory when using IDE or AI code suggestions; always import from the actual source directory.
- IDE Indexing: Exclude the
Understand the JiraTUI architecture
mainJiraTUI is composed of two primary interfaces that interact with the Atlassian Jira API via a shared backend logic layer.
Core Components
- API Controller: The central logic layer that provides functionality for managing Jira resources.
- API: Implements the Jira REST API endpoints and handles communication with the Atlassian Jira API (Cloud or Data Center) via HTTPS.
Interface Modes
- CLI Application: A command-line interface built with
click. It is useful for interacting with specific resources (like comments and issues) or debugging Jira interactions by retrieving metadata required for work items. - UI Application: A Terminal User Interface (TUI) built using the
Textualframework,Rich, andasyncio. It provides a rich, widget-based interface for complex Jira workflows.