diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/404.html b/404.html new file mode 100644 index 0000000..c1b735f --- /dev/null +++ b/404.html @@ -0,0 +1,708 @@ + + + +
+ + + + + + + + + + + + + + + + + + +This section documents the command-line interface components of JiraGen. These components provide the user-facing functionality for ticket generation, metadata handling, and JIRA integration.
+Overview
+The Generate command creates JIRA tickets using AI, with support for interactive editing and metadata modification.
+Usage Example
+from jiragen.cli.generate import generate_issue
+from jiragen.core.client import VectorStoreClient
+
+# Initialize vector store
+store = VectorStoreClient()
+
+# Generate a ticket
+result = generate_issue(
+ store=store,
+ message="Add dark mode support",
+ model="openai/gpt-4o",
+ upload=True,
+ yes=False, # Enable interactive mode
+)
+
generate_issue(store: VectorStoreClient, message: str, template_path: str, model: str = 'openai/gpt-4o', temperature: float = 0.7, max_tokens: int = 2000, upload: bool = False, yes: bool = False) -> Optional[Dict[str, Any]]
+
Generate JIRA issue content and metadata using AI.
+ +Editor Integration
+The open_in_neovim
function provides seamless integration with Neovim for content editing. Make sure Neovim is installed and configured properly.
Open content in Neovim with markdown preview if available.
+ + +Parameters:
+content
+ (str
)
+ –
+ Initial content to edit
+Returns:
+Optional[str]
+ –
+ Optional[str]: Modified content if saved, None if canceled
+Overview
+The Add command indexes your codebase into the vector store for context-aware ticket generation.
+Large Codebases
+For large codebases, the indexing process may take some time. The command shows a progress bar and provides detailed statistics upon completion.
+Add files to the vector database, respecting .gitignore patterns.
+ +Overview
+The Init command sets up JiraGen's configuration and creates necessary directories.
+Configuration
+The init process will:
+1. Create the .jiragen
directory
+2. Initialize the configuration file
+3. Set up the vector store
+4. Configure JIRA credentials
Initialize jiragen configuration.
+ + +Parameters:
+config_path
+ (Path
)
+ –
+ Path to the configuration file. If not provided, + defaults to ~/.jiragen/config.ini
+Overview
+The Upload command handles the creation of JIRA issues with proper metadata and content formatting.
+Usage Example
+from jiragen.cli.upload import upload_command
+
+# Upload a new feature request
+issue_key = upload_command(
+ title="Add Dark Mode Support",
+ description="# Feature Request\n\nImplement dark mode...",
+ issue_type="Story",
+ priority="High",
+ labels="frontend,ui,dark-mode",
+ component_name="UI",
+)
+print(f"Created issue: {issue_key}")
+
upload_command(title: str, description: Optional[str] = None, issue_type: str = 'Story', epic_key: Optional[str] = None, component_name: Optional[str] = None, priority: Optional[str] = None, labels: Optional[str] = None, assignee: Optional[str] = None, reporter: Optional[str] = None, custom_fields: Optional[Dict[str, Any]] = None) -> Optional[str]
+
Upload a Jira issue with the provided content and options.
+ + +Parameters:
+title
+ (str
)
+ –
+ Issue summary/title
+description
+ (Optional[str]
, default:
+ None
+)
+ –
+ Issue description (can be in markdown format)
+issue_type
+ (str
, default:
+ 'Story'
+)
+ –
+ Type of issue (Story, Bug, Task, Epic, etc.)
+epic_key
+ (Optional[str]
, default:
+ None
+)
+ –
+ Key of the epic to link the issue to (not applicable for epics)
+component_name
+ (Optional[str]
, default:
+ None
+)
+ –
+ Name of the component to assign
+priority
+ (Optional[str]
, default:
+ None
+)
+ –
+ Priority level (Highest, High, Medium, Low, Lowest)
+labels
+ (Optional[str]
, default:
+ None
+)
+ –
+ Comma-separated list of labels
+assignee
+ (Optional[str]
, default:
+ None
+)
+ –
+ Username of the assignee
+reporter
+ (Optional[str]
, default:
+ None
+)
+ –
+ Username of the reporter
+custom_fields
+ (Optional[Dict[str, Any]]
, default:
+ None
+)
+ –
+ Dictionary of custom field IDs and values
+Returns:
+str
( Optional[str]
+) –
+ The key of the created issue, or None if creation failed
+Helper Functions
+The following functions help validate and format data for JIRA:
+Read Jira configuration from config file.
+ +Get project key from project name.
+ +Validate component exists and return its ID.
+ +Validate epic exists and return its key.
+ +Validate priority exists and return its name.
+ +Validate and format labels.
+ +Convert markdown text to Jira markup.
+ +This section documents the core components of JiraGen. These components form the foundation of the application and provide essential functionality for ticket generation, metadata handling, and JIRA integration.
+Overview
+The Vector Store module handles the storage and retrieval of code embeddings, enabling semantic search over your codebase.
+
+ Bases: BaseModel
Configuration for the vector store client and service.
+ + +Attributes:
+collection_name
+ (str
)
+ –
+ Default collection name
+embedding_model
+ (str
)
+ –
+ Name of the sentence transformer model to use
+device
+ (str
)
+ –
+ Device to run embeddings on ('cpu' or 'cuda')
+socket_path
+ (Optional[Path]
)
+ –
+ Unix socket path for client-service communication
+db_path
+ (Optional[Path]
)
+ –
+ Path to the vector store database
+Ensure the vector store service is running
+ +Start the vector store service
+ +send_command(command: str, params: Dict[str, Any] = None, timeout: int = SOCKET_TIMEOUT, retries: int = MAX_RETRIES) -> Dict[str, Any]
+
Send command to service with retries
+ +Initialize the vector store with initialization state verification.
+The initialization process: +1. Send initialize command with config +2. Verify store accessibility through get_stored_files +3. Confirm data structure integrity
+ +Get stored files with robust validation and error handling.
+ + +Returns:
+Dict[str, Set[Path]]
+ –
+ Dict[str, Set[Path]]: Dictionary containing: +- 'files': Set of file paths +- 'directories': Set of directory paths
+Add files to vector store
+ +Remove files from vector store
+ +Query similar documents
+ +Initialize the vector store with the given configuration
+ +Handle adding files to the vector store
+ +Handle removing files from the vector store
+ +Handle retrieving stored files information
+ +Handle querying similar documents
+ +Handle a client connection
+ +Handle shutdown signal
+ +Overview
+The Generator module is responsible for generating ticket content using AI models and managing the generation process.
+Generator for creating JIRA tickets using both JIRA and codebase context.
+Uses RAG (Retrieval Augmented Generation) to find relevant context from both +JIRA history and codebase, then generates a ticket following a template.
+ + +Attributes:
+vector_store
+ –
+ Vector store client for retrieving similar documents
+config
+ –
+ Generator configuration
+Generate a JIRA ticket using RAG and template-guided generation.
+Retrieves relevant context from both JIRA history and codebase, +then uses an LLM to generate a ticket following the template.
+ + +Parameters:
+message
+ (str
)
+ –
+ User's request for the ticket
+Returns:
+str
+ –
+ Generated ticket content following the template
+Raises:
+RuntimeError
+ –
+ If ticket generation fails
+Overview
+The Metadata module handles JIRA issue metadata, including issue types, priorities, and field validation.
+Usage Example
+ +
+ Bases: str
, Enum
+ Bases: str
, Enum
+ Bases: BaseModel
Represents the metadata extracted from an issue's content.
+ + + + + + + + + +Extracts metadata from issue content using LLM analysis.
+ + + + + + + + + +Analyzes the issue content and extracts relevant metadata.
+ + +Parameters:
+content
+ (str
)
+ –
+ The generated issue content to analyze
+Returns:
+IssueMetadata
+ –
+ IssueMetadata object containing the extracted metadata
+Overview
+The Config module manages application configuration, including JIRA credentials and default settings.
+Environment Variables
+Configuration can also be set using environment variables: +
+Manages jiragen configuration.
+ + + +Parameters:
+config_path
+ (Optional[Path]
, default:
+ None
+)
+ –
+ Optional path to config file. If not provided, + defaults to standard config location based on OS.
+Welcome to JiraGen's API documentation. This section provides detailed information about JiraGen's components and how to use them programmatically.
+graph TD
+ A[CLI Commands] --> B[Core Components]
+ B --> C[Vector Store]
+ B --> D[Generator]
+ B --> E[Metadata]
+ B --> F[Config]
+ C --> G[Embeddings DB]
+ D --> H[LLM Service]
+ E --> I[JIRA API]
+Core Components
+CLI Components
+Here's a simple example of using JiraGen's API to generate and upload a ticket:
+from jiragen.core.client import VectorStoreClient
+from jiragen.cli.generate import generate_issue
+from jiragen.cli.upload import upload_command
+
+# Initialize vector store
+store = VectorStoreClient()
+
+# Generate ticket content
+result = generate_issue(
+ store=store, message="Add dark mode support", model="openai/gpt-4o", upload=True
+)
+
+if result:
+ print("✨ Ticket generated and uploaded successfully!")
+
Versioning
+JiraGen follows semantic versioning. The API is considered stable for all releases with version >= 1.0.0.
+Beta Features
+Features marked as beta may change in minor releases. They are marked with a (beta)
tag in the documentation.
Icons sourced from IconDuck, a comprehensive open-source icon library.
+ + + + + + + + + + + + + + + + + + + + + + +