-
Notifications
You must be signed in to change notification settings - Fork 1
New Version #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Version #18
Changes from all commits
b7ad64a
4d7aaf2
1923c0a
685d770
16d7d36
9672c21
f0a9096
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| # CLAUDE.md | ||
|
|
||
| This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. | ||
|
|
||
| ## Build and Development Commands | ||
|
|
||
| ```bash | ||
| # Build the project | ||
| go build -o redmine | ||
|
|
||
| # Install dependencies and clean up | ||
| go mod tidy | ||
|
|
||
| # Test the built binary | ||
| ./redmine --help | ||
|
|
||
| # Run all tests (currently no tests exist) | ||
| go test -v ./... | ||
| ``` | ||
|
|
||
| ## Project Architecture | ||
|
|
||
| This is a Redmine CLI tool written in Go using the Cobra framework. The application follows a standard CLI architecture with clear separation of concerns: | ||
|
|
||
| ### Core Components | ||
|
|
||
| - **main.go**: Entry point that delegates to cmd.Execute() | ||
| - **cmd/**: Contains all CLI command definitions using Cobra framework | ||
| - **root.go**: Root command setup with global profile flag | ||
| - **issues.go**: Issue management commands (list, show) | ||
| - **profile.go**: Profile management commands (add, list, use, remove, show) | ||
| - **auth.go**: Authentication commands (legacy, prefer profile commands) | ||
| - **config/**: Configuration management with YAML persistence | ||
| - **config.go**: Profile-based configuration with ~/.redminecli/config storage | ||
| - **client/**: Redmine API client with HTTP communication | ||
| - **client.go**: HTTP client with complete Redmine API models (Issue, Project, User, etc.) | ||
|
|
||
| ### Configuration System | ||
|
|
||
| The application uses a profile-based configuration system: | ||
| - Configuration stored in `~/.redminecli/config` as YAML | ||
| - Each profile contains: name, Redmine URL, and API key | ||
| - Supports default profile and per-command profile override via `--profile` flag | ||
| - Profile management through `profile` commands (add, remove, use, list, show) | ||
|
|
||
| ### API Client Architecture | ||
|
|
||
| The HTTP client (`client/client.go`) provides: | ||
| - Structured Redmine API models (Issue, Journal, Project, User, etc.) | ||
| - Authentication via X-Redmine-API-Key header | ||
| - JSON response parsing with proper error handling | ||
| - Support for pagination and filtering parameters | ||
| - Include parameters for fetching related data (e.g., journals for comments) | ||
|
|
||
| ### Command Structure | ||
|
|
||
| Commands follow a hierarchical structure: | ||
| - `redmine issues list` - List issues with filtering options | ||
| - `redmine issues show <id>` - Show issue details with optional comments | ||
| - `redmine profile add/list/use/remove/show` - Profile management | ||
| - Global `--profile` flag for per-command profile selection | ||
|
|
||
| ### Dependencies | ||
|
|
||
| - **github.com/spf13/cobra**: CLI framework for command structure | ||
| - **gopkg.in/yaml.v3**: YAML configuration file handling | ||
| - Standard library for HTTP client and JSON processing | ||
| - Uses mise.toml for Go version management (latest) | ||
|
|
||
| ### Development Notes | ||
|
|
||
| - No test suite currently exists | ||
| - Binary excluded from git via .gitignore (redmine, redmine-*) | ||
| - Configuration files (.yaml/.yml) excluded from git for security | ||
| - API keys are masked in profile display output | ||
| - 30-second HTTP timeout for API requests |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,11 +69,19 @@ go build -o redmine | |
| - `--offset`: オフセット (デフォルト: 0) | ||
| - `--project`: プロジェクトIDでフィルタ | ||
| - `--status`: ステータスIDでフィルタ | ||
| - `--me`: 現在のユーザーが作成したIssueのみ表示 | ||
|
|
||
| 例: | ||
|
|
||
| ```bash | ||
| # 基本的な使用例 | ||
| ./redmine issues list --limit 50 --project 1 --status 1 | ||
|
|
||
| # 自分が作成したIssueのみ表示 | ||
| ./redmine issues list --me | ||
|
|
||
| # 自分が作成したIssueをプロジェクトでフィルタ | ||
| ./redmine issues list --me --project 1 | ||
|
Comment on lines
+80
to
+84
|
||
| ``` | ||
|
|
||
| #### Issue詳細の表示 | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -30,6 +30,7 @@ func init() { | |||||
| listIssuesCmd.Flags().String("offset", "0", "Offset for pagination") | ||||||
| listIssuesCmd.Flags().String("project", "", "Project ID to filter by") | ||||||
| listIssuesCmd.Flags().String("status", "", "Status ID to filter by") | ||||||
| listIssuesCmd.Flags().Bool("me", false, "Filter issues authored by current user") | ||||||
|
||||||
| listIssuesCmd.Flags().Bool("me", false, "Filter issues authored by current user") | |
| listIssuesCmd.Flags().Bool("me", false, "Filter issues assigned to current user") |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -63,6 +63,18 @@ var listIssuesCmd = &cobra.Command{ | |||||
| params["status_id"] = status | ||||||
| } | ||||||
|
|
||||||
| // Check if --mine flag is set to filter by current user | ||||||
|
||||||
| // Check if --mine flag is set to filter by current user | |
| // Check if --me flag is set to filter by current user |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description for the
--meflag is incorrect. Based on the code implementation, this flag filters issues assigned to the current user, not issues created by the current user. The description should be updated to reflect this.