README.md update

This commit is contained in:
2026-03-13 17:04:25 +01:00
parent e763659b60
commit 1187be4d3c

View File

@@ -7,6 +7,7 @@ This Go application fetches issues from a Redmine instance for a specified proje
- Fetches issues from Redmine API for a given project and displays the project name.
- Organizes issues into a hierarchical tree based on parent-child relationships.
- Displays issue ID, subject, and status.
- **Filter issues by status** (include or exclude specific statuses).
- **Lists all available Redmine projects (ID and Name) if no `project-id` is provided.**
- Supports configuration via environment variables, a `.env` file, or a `~/.redmine-tree.json` configuration file.
@@ -21,25 +22,29 @@ This Go application fetches issues from a Redmine instance for a specified proje
The application retrieves configuration in the following order of precedence:
1. **Command-line arguments**: Primarily for `project-id`.
2. **Config file (`~/.redmine-tree.json`)**: For `host` and `token`.
1. **Command-line arguments**: Flags like `-status` and `-exclude-status` and the `project-id`.
2. **Config file (`~/.redmine-tree.json`)**: For `host`, `token`, and default status filters.
3. **Environment Variables**: `REDMINE_URL` and `REDMINE_TOKEN` (these will override values from the config file if set).
### Config File (`~/.redmine-tree.json`)
You can create a JSON configuration file named `.redmine-tree.json` in your home directory (`~`). This file can contain the `host` and `token` for your Redmine instance.
You can create a JSON configuration file named `.redmine-tree.json` in your home directory (`~`). This file can contain the `host`, `token`, and default filtering preferences.
Example `~/.redmine-tree.json`:
```json
{
"host": "https://your-redmine.example.com",
"token": "your_redmine_api_key"
"token": "your_redmine_api_key",
"include_statuses": ["In Progress", "Feedback"],
"exclude_statuses": ["Done", "Closed"]
}
```
- **`host`**: The base URL of your Redmine instance.
- **`token`**: Your Redmine API access key.
- **`include_statuses`**: Optional list of status names or IDs to include by default.
- **`exclude_statuses`**: Optional list of status names or IDs to exclude by default.
### Environment Variables
@@ -60,9 +65,44 @@ REDMINE_TOKEN=your_redmine_api_key
- **`REDMINE_URL`**: The base URL of your Redmine instance (e.g., `https://redmine.example.com`).
- **`REDMINE_TOKEN`**: Your Redmine API access key.
### Project ID
## Usage
The `project-id` is provided as a command-line argument. If no `project-id` is provided, the application will list all available projects.
After building (and optionally installing), you can run the application.
**IMPORTANT:** Flags must come **BEFORE** the project ID.
### Filtering by Status
You can filter issues by their status name or ID using comma-separated values.
- **`-status`**: Only include issues with these statuses.
- **`-exclude-status`**: Exclude issues with these statuses.
Examples:
```bash
# Exclude "Done" and "Closed" issues
redmine-tree -exclude-status="Done,Closed" my-project-id
# Only show "New" and "In Progress" issues
redmine-tree -status="New,In Progress" my-project-id
# Mix and match (IDs work too)
redmine-tree -status="In Progress" -exclude-status="5" my-project-id
```
### Basic Commands
- **To list all projects:**
```bash
redmine-tree
```
- **To show the issue tree for a specific project:**
```bash
redmine-tree my-project-id
```
## Obtaining your Redmine API Token
@@ -98,36 +138,6 @@ make install
- **On Linux/macOS:** This will install the `redmine-tree` executable to `~/.local/bin/`. Ensure `~/.local/bin/` is in your system's PATH to run the command directly from any directory.
- **On Windows:** The executable will be built to `build/redmine-tree.exe`. The `install` command will inform you of its location and advise you to manually add its directory to your system's PATH if you wish to run it from any location.
## Usage
After building (and optionally installing), you can run the application:
- **To list all projects:**
```bash
# Using the installed executable (Linux/macOS)
redmine-tree
# From the build directory (Linux/macOS)
./build/redmine-tree
# On Windows (from build directory)
.\build\redmine-tree.exe
```
- **To show the issue tree for a specific project:**
```bash
# Using the installed executable (Linux/macOS)
redmine-tree my-project-id
# From the build directory (Linux/macOS)
./build/redmine-tree my-project-id
# On Windows (from build directory)
.\build\redmine-tree.exe my-project-id
```
## Cleaning
To remove the `build/` directory and compiled executables: