githuh 0.3.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: githuh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Gredeskoul
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2020-09-11 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: activesupport
@@ -39,21 +38,21 @@ dependencies:
39
38
  - !ruby/object:Gem::Version
40
39
  version: '3'
41
40
  - !ruby/object:Gem::Dependency
42
- name: dry-cli
41
+ name: csv
43
42
  requirement: !ruby/object:Gem::Requirement
44
43
  requirements:
45
- - - "~>"
44
+ - - ">="
46
45
  - !ruby/object:Gem::Version
47
- version: '0.6'
46
+ version: '0'
48
47
  type: :runtime
49
48
  prerelease: false
50
49
  version_requirements: !ruby/object:Gem::Requirement
51
50
  requirements:
52
- - - "~>"
51
+ - - ">="
53
52
  - !ruby/object:Gem::Version
54
- version: '0.6'
53
+ version: '0'
55
54
  - !ruby/object:Gem::Dependency
56
- name: hashie
55
+ name: dry-cli
57
56
  requirement: !ruby/object:Gem::Requirement
58
57
  requirements:
59
58
  - - ">="
@@ -67,21 +66,21 @@ dependencies:
67
66
  - !ruby/object:Gem::Version
68
67
  version: '0'
69
68
  - !ruby/object:Gem::Dependency
70
- name: octokit
69
+ name: faraday
71
70
  requirement: !ruby/object:Gem::Requirement
72
71
  requirements:
73
- - - "~>"
72
+ - - ">="
74
73
  - !ruby/object:Gem::Version
75
- version: '4'
74
+ version: '0'
76
75
  type: :runtime
77
76
  prerelease: false
78
77
  version_requirements: !ruby/object:Gem::Requirement
79
78
  requirements:
80
- - - "~>"
79
+ - - ">="
81
80
  - !ruby/object:Gem::Version
82
- version: '4'
81
+ version: '0'
83
82
  - !ruby/object:Gem::Dependency
84
- name: tty-box
83
+ name: faraday-retry
85
84
  requirement: !ruby/object:Gem::Requirement
86
85
  requirements:
87
86
  - - ">="
@@ -95,7 +94,7 @@ dependencies:
95
94
  - !ruby/object:Gem::Version
96
95
  version: '0'
97
96
  - !ruby/object:Gem::Dependency
98
- name: tty-progressbar
97
+ name: hashie
99
98
  requirement: !ruby/object:Gem::Requirement
100
99
  requirements:
101
100
  - - ">="
@@ -109,7 +108,7 @@ dependencies:
109
108
  - !ruby/object:Gem::Version
110
109
  version: '0'
111
110
  - !ruby/object:Gem::Dependency
112
- name: tty-screen
111
+ name: octokit
113
112
  requirement: !ruby/object:Gem::Requirement
114
113
  requirements:
115
114
  - - ">="
@@ -123,97 +122,13 @@ dependencies:
123
122
  - !ruby/object:Gem::Version
124
123
  version: '0'
125
124
  - !ruby/object:Gem::Dependency
126
- name: aruba
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - '='
130
- - !ruby/object:Gem::Version
131
- version: 1.0.0
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - '='
137
- - !ruby/object:Gem::Version
138
- version: 1.0.0
139
- - !ruby/object:Gem::Dependency
140
- name: awesome_print
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - "~>"
144
- - !ruby/object:Gem::Version
145
- version: '1'
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - "~>"
151
- - !ruby/object:Gem::Version
152
- version: '1'
153
- - !ruby/object:Gem::Dependency
154
- name: bundler
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - "~>"
158
- - !ruby/object:Gem::Version
159
- version: '2'
160
- type: :development
161
- prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - "~>"
165
- - !ruby/object:Gem::Version
166
- version: '2'
167
- - !ruby/object:Gem::Dependency
168
- name: rake
169
- requirement: !ruby/object:Gem::Requirement
170
- requirements:
171
- - - "~>"
172
- - !ruby/object:Gem::Version
173
- version: '13'
174
- type: :development
175
- prerelease: false
176
- version_requirements: !ruby/object:Gem::Requirement
177
- requirements:
178
- - - "~>"
179
- - !ruby/object:Gem::Version
180
- version: '13'
181
- - !ruby/object:Gem::Dependency
182
- name: rspec
183
- requirement: !ruby/object:Gem::Requirement
184
- requirements:
185
- - - "~>"
186
- - !ruby/object:Gem::Version
187
- version: '3'
188
- type: :development
189
- prerelease: false
190
- version_requirements: !ruby/object:Gem::Requirement
191
- requirements:
192
- - - "~>"
193
- - !ruby/object:Gem::Version
194
- version: '3'
195
- - !ruby/object:Gem::Dependency
196
- name: rspec-its
197
- requirement: !ruby/object:Gem::Requirement
198
- requirements:
199
- - - "~>"
200
- - !ruby/object:Gem::Version
201
- version: '1'
202
- type: :development
203
- prerelease: false
204
- version_requirements: !ruby/object:Gem::Requirement
205
- requirements:
206
- - - "~>"
207
- - !ruby/object:Gem::Version
208
- version: '1'
209
- - !ruby/object:Gem::Dependency
210
- name: rubocop
125
+ name: tty-box
211
126
  requirement: !ruby/object:Gem::Requirement
212
127
  requirements:
213
128
  - - ">="
214
129
  - !ruby/object:Gem::Version
215
130
  version: '0'
216
- type: :development
131
+ type: :runtime
217
132
  prerelease: false
218
133
  version_requirements: !ruby/object:Gem::Requirement
219
134
  requirements:
@@ -221,13 +136,13 @@ dependencies:
221
136
  - !ruby/object:Gem::Version
222
137
  version: '0'
223
138
  - !ruby/object:Gem::Dependency
224
- name: simplecov
139
+ name: tty-progressbar
225
140
  requirement: !ruby/object:Gem::Requirement
226
141
  requirements:
227
142
  - - ">="
228
143
  - !ruby/object:Gem::Version
229
144
  version: '0'
230
- type: :development
145
+ type: :runtime
231
146
  prerelease: false
232
147
  version_requirements: !ruby/object:Gem::Requirement
233
148
  requirements:
@@ -235,13 +150,13 @@ dependencies:
235
150
  - !ruby/object:Gem::Version
236
151
  version: '0'
237
152
  - !ruby/object:Gem::Dependency
238
- name: simplecov-formatter-badge
153
+ name: tty-screen
239
154
  requirement: !ruby/object:Gem::Requirement
240
155
  requirements:
241
156
  - - ">="
242
157
  - !ruby/object:Gem::Version
243
158
  version: '0'
244
- type: :development
159
+ type: :runtime
245
160
  prerelease: false
246
161
  version_requirements: !ruby/object:Gem::Requirement
247
162
  requirements:
@@ -263,19 +178,25 @@ files:
263
178
  - ".rspec"
264
179
  - ".rubocop.yml"
265
180
  - ".rubocop_todo.yml"
181
+ - ".ruby-version"
182
+ - ".secrets.baseline"
183
+ - CHANGELOG.md
266
184
  - Gemfile
267
185
  - Gemfile.lock
268
- - LICENSE
269
- - README.adoc
186
+ - LICENSE.txt
187
+ - README.md
270
188
  - Rakefile
271
189
  - WARRANTY.md
272
190
  - codecov.yml
273
191
  - config/label-mapping.yml
192
+ - docs/img/badge.svg
193
+ - docs/img/coverage.png
274
194
  - docs/img/coverage.svg
275
195
  - docs/img/githuh-issue-export.png
276
196
  - exe/githuh
277
197
  - githuh.gemspec
278
- - issues.json
198
+ - justfile
199
+ - lefthook.yml
279
200
  - lib/githuh.rb
280
201
  - lib/githuh/cli/commands/base.rb
281
202
  - lib/githuh/cli/commands/issue/export.rb
@@ -284,28 +205,32 @@ files:
284
205
  - lib/githuh/cli/commands/user/info.rb
285
206
  - lib/githuh/cli/commands/version.rb
286
207
  - lib/githuh/cli/launcher.rb
208
+ - lib/githuh/env_loader.rb
209
+ - lib/githuh/llm.rb
210
+ - lib/githuh/llm/anthropic.rb
211
+ - lib/githuh/llm/base.rb
212
+ - lib/githuh/llm/openai.rb
287
213
  - lib/githuh/version.rb
288
214
  homepage: https://github.com/kigster/githuh
289
215
  licenses:
290
216
  - MIT
291
- metadata: {}
292
- post_install_message:
217
+ metadata:
218
+ rubygems_mfa_required: 'true'
293
219
  rdoc_options: []
294
220
  require_paths:
295
221
  - lib
296
222
  required_ruby_version: !ruby/object:Gem::Requirement
297
223
  requirements:
298
- - - ">="
224
+ - - "~>"
299
225
  - !ruby/object:Gem::Version
300
- version: '2.3'
226
+ version: '4.0'
301
227
  required_rubygems_version: !ruby/object:Gem::Requirement
302
228
  requirements:
303
229
  - - ">="
304
230
  - !ruby/object:Gem::Version
305
231
  version: '0'
306
232
  requirements: []
307
- rubygems_version: 3.1.4
308
- signing_key:
233
+ rubygems_version: 4.0.10
309
234
  specification_version: 4
310
235
  summary: Extensible CLI helper client for Github, for automating various tasks, such
311
236
  as — generating a list of org's repos and converting it into a pretty markdown,
data/README.adoc DELETED
@@ -1,181 +0,0 @@
1
- :doctype: book
2
- :toc:
3
- :toclevels: 4
4
- :sectnums:
5
- image:https://github.com/kigster/githuh/workflows/Ruby/badge.svg[Ruby,link=https://github.com/kigster/githuh/actions?query=workflow%3ARuby]
6
- image:docs/img/coverage.svg[Coverage]
7
-
8
- = Githuh -- GitHub API client
9
-
10
- As in... *git? huh?*.
11
-
12
- Github API client wrapper on top of Octokit, that provides extensible command pattern for wrapping Github functionality.
13
-
14
- At the moment two features are implemented:
15
-
16
- * Generating a list of org's (or personal) repositories and rending in either markdown or JSON
17
- * Printing info of the logged in user.
18
-
19
- == Using `githuh`
20
-
21
- Add your Github Token to the global config:
22
-
23
- [source,bash]
24
- ----
25
- git config --global --set user.token <token>
26
- ----
27
-
28
- After that:
29
-
30
- [source,bash]
31
- ----
32
- ❯ be exe/githuh -h
33
-
34
- Githuh CLI 0.2.1 — API client for Github.com.
35
- © 2020 Konstantin Gredeskoul, All rights reserved. MIT License.
36
-
37
- Commands:
38
- githuh issue [SUBCOMMAND]
39
- githuh repo [SUBCOMMAND]
40
- githuh user [SUBCOMMAND]
41
- githuh version # Print version, no subcommands
42
- ----
43
-
44
- Githuh is invoked by using one of its commands and sub-commands.
45
-
46
-
47
- === `issue export`
48
-
49
- Use this command to export all issues for a given repo into either a raw JSON format (using `--format=json`) or into a https://www.pivotaltracker.com/help/articles/csv_import_export[Pivotal Tracker-compatible CSV format] (the default output format).
50
-
51
- [source,bash]
52
- ----
53
- ❯ be exe/githuh issue export -h
54
-
55
- Githuh CLI 0.2.1 — API client for Github.com.
56
- © 2020 Konstantin Gredeskoul, All rights reserved. MIT License.
57
-
58
- Command:
59
- githuh issue export
60
-
61
- Usage:
62
- githuh issue export REPO
63
-
64
- Description:
65
- Export Repo issues into a CSV or JSON format
66
- Default output file is <username>.<repo>.issues.<format>
67
-
68
- Arguments:
69
- REPO # REQUIRED Name of the repo, eg "rails/rails"
70
-
71
- Options:
72
- --api-token=VALUE # Github API token; if not given, user.token is read from ~/.gitconfig
73
- --per-page=VALUE # Pagination page size for Github API, default: 20
74
- --[no-]info # Print UI elements, like a the progress bar, default: true
75
- --[no-]verbose # Print additional debugging info, default: false
76
- --file=VALUE # Output file, overrides <username>.<repo>.issues.<format>
77
- --format=VALUE # Output format: (json/csv), default: "csv"
78
- --mapping=VALUE # YAML file with label to estimates mapping
79
- --help, -h # Print this help
80
- ----
81
-
82
- ==== Label Mappings
83
-
84
- The export suppots a configurable mapping of Github labels to Pivotal Tracker points. To use this feature, create a YAML file similar to the xref:config/label-mapping.yml[config/label-mapping.yml] provided:
85
-
86
- [source,yaml]
87
- ----
88
- ---
89
- label-to-estimates:
90
- Large: 5
91
- Medium: 3
92
- Small: 1
93
- ----
94
-
95
- Then add `--mapping=<filename>` argument to the export command.
96
-
97
- ==== Example
98
-
99
- Eg, to export all issues of this repo into Pivotal Tracker compatibel CSV:
100
-
101
- [source,bash]
102
- ----
103
- # export into Pivotal Tracker CSV format
104
- githuh issue export kigster/githuh -v -i --api-token=XXXX
105
- ----
106
-
107
- You should see an output similar to the following:
108
-
109
- image::docs/img/githuh-issue-export.png[issue export,width=60%,border=1]
110
-
111
-
112
- === `repo list`
113
-
114
- ==== Motivation
115
-
116
- This functionality was born out of the need to generate a brief but comprehensive, well-formatted list of prior inventions for a typical employment contract.
117
-
118
- NOTE: nothing in this library constitutes a legal advice. Use it at your own risk. For more information, please see xref:WARANTY.adoc[WARRANTY].
119
-
120
- Please watch the following Ascii Screen cast to see this command in action:
121
-
122
- image::https://asciinema.org/a/CW8NbYfu9RsifQJVU6tKRtRkU.svg[asciicast,link=https://asciinema.org/a/CW8NbYfu9RsifQJVU6tKRtRkU]
123
-
124
- ==== Usage
125
-
126
- [source,bash]
127
- ----
128
- ❯ githuh repo list --help
129
-
130
- Githuh CLI 0.1.2 — API client for Github.com.
131
- © 2020 Konstantin Gredeskoul, All rights reserved. MIT License.
132
-
133
- Usage:
134
- githuh repo list
135
-
136
- Description:
137
- List owned repositories and render the output in markdown or JSON
138
- Default output file is <username>.repositories.<format>
139
-
140
- Options:
141
- --api-token=VALUE # Github API token; if not given, user.token is read from ~/.gitconfig
142
- --per-page=VALUE # Pagination page size for Github API, default: 20
143
- --[no-]info # Print UI elements, like a the progress bar, default: true
144
- --[no-]verbose # Print additional debugging info, default: false
145
- --file=VALUE # Output file, overrides <username>.repositories.<format>
146
- --format=VALUE # Output format: (markdown/json), default: "markdown"
147
- --forks=VALUE # Include or exclude forks: (exclude/include/only), default: "exclude"
148
- --[no-]private # If specified, returns only private repos for true, public for false
149
- --help, -h # Print this help
150
- ----
151
-
152
- ==== Example
153
-
154
- For instance, to generate a markdown list of all of your *public* repos that are also *not forks*, run the following:
155
-
156
- [source,bash]
157
- ----
158
- $ githuh repo list --format=markdown --no-private --forks=exclude --file=repos.md
159
- ----
160
-
161
- === `user info`
162
-
163
- This command prints the info about currently authenticated user.
164
-
165
- [source,bash]
166
- ----
167
- ❯ githuh user info
168
- {
169
- :login => "kigster",
170
- :url => "https://api.github.com/users/kigster",
171
- :html_url => "https://github.com/kigster",
172
- ..............
173
- ----
174
-
175
- == Contributing
176
-
177
- Please submit a pull request at https://github.com/kigster/githuh/pulls
178
-
179
- == License
180
-
181
- &copy; 2020 Konstantin Gredeskoul, link:LICENSE[MIT License]