huntr-cli 1.0.9

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.
Files changed (117) hide show
  1. package/.env.example +7 -0
  2. package/.github/ISSUE_TEMPLATE/bug_report.md +43 -0
  3. package/.github/ISSUE_TEMPLATE/config.yml +8 -0
  4. package/.github/ISSUE_TEMPLATE/feature_request.md +29 -0
  5. package/.github/labels.json +92 -0
  6. package/.github/pull_request_template.md +64 -0
  7. package/.github/workflows/ci.yml +87 -0
  8. package/.github/workflows/labels.yml +27 -0
  9. package/.github/workflows/manual-publish.yml +105 -0
  10. package/.github/workflows/publish.yml +57 -0
  11. package/.github/workflows/release.yml +124 -0
  12. package/.github/workflows/security-audit.yml +44 -0
  13. package/.husky/pre-commit +12 -0
  14. package/.husky/pre-push +27 -0
  15. package/.lintstagedrc.json +3 -0
  16. package/AGENTS.md +449 -0
  17. package/CHANGELOG.md +38 -0
  18. package/CHANGES.md +259 -0
  19. package/LICENSE +15 -0
  20. package/PUBLISHING.md +191 -0
  21. package/README.md +385 -0
  22. package/ROADMAP.md +158 -0
  23. package/SETUP-COMPLETE.md +446 -0
  24. package/WORKFLOW-SUMMARY.md +368 -0
  25. package/completions/_huntr +168 -0
  26. package/completions/huntr.1 +266 -0
  27. package/completions/huntr.bash +91 -0
  28. package/dist/api/client.d.ts +14 -0
  29. package/dist/api/client.d.ts.map +1 -0
  30. package/dist/api/client.js +74 -0
  31. package/dist/api/client.js.map +1 -0
  32. package/dist/api/personal/activities.d.ts +20 -0
  33. package/dist/api/personal/activities.d.ts.map +1 -0
  34. package/dist/api/personal/activities.js +50 -0
  35. package/dist/api/personal/activities.js.map +1 -0
  36. package/dist/api/personal/boards.d.ts +9 -0
  37. package/dist/api/personal/boards.d.ts.map +1 -0
  38. package/dist/api/personal/boards.js +16 -0
  39. package/dist/api/personal/boards.js.map +1 -0
  40. package/dist/api/personal/index.d.ts +17 -0
  41. package/dist/api/personal/index.d.ts.map +1 -0
  42. package/dist/api/personal/index.js +37 -0
  43. package/dist/api/personal/index.js.map +1 -0
  44. package/dist/api/personal/jobs.d.ts +13 -0
  45. package/dist/api/personal/jobs.d.ts.map +1 -0
  46. package/dist/api/personal/jobs.js +31 -0
  47. package/dist/api/personal/jobs.js.map +1 -0
  48. package/dist/api/personal/user.d.ts +8 -0
  49. package/dist/api/personal/user.d.ts.map +1 -0
  50. package/dist/api/personal/user.js +13 -0
  51. package/dist/api/personal/user.js.map +1 -0
  52. package/dist/cli.d.ts +3 -0
  53. package/dist/cli.d.ts.map +1 -0
  54. package/dist/cli.js +501 -0
  55. package/dist/cli.js.map +1 -0
  56. package/dist/commands/capture-session.d.ts +10 -0
  57. package/dist/commands/capture-session.d.ts.map +1 -0
  58. package/dist/commands/capture-session.js +478 -0
  59. package/dist/commands/capture-session.js.map +1 -0
  60. package/dist/config/clerk-session-manager.d.ts +44 -0
  61. package/dist/config/clerk-session-manager.d.ts.map +1 -0
  62. package/dist/config/clerk-session-manager.js +232 -0
  63. package/dist/config/clerk-session-manager.js.map +1 -0
  64. package/dist/config/config-manager.d.ts +15 -0
  65. package/dist/config/config-manager.d.ts.map +1 -0
  66. package/dist/config/config-manager.js +51 -0
  67. package/dist/config/config-manager.js.map +1 -0
  68. package/dist/config/keychain-manager.d.ts +6 -0
  69. package/dist/config/keychain-manager.d.ts.map +1 -0
  70. package/dist/config/keychain-manager.js +37 -0
  71. package/dist/config/keychain-manager.js.map +1 -0
  72. package/dist/config/token-capture.d.ts +11 -0
  73. package/dist/config/token-capture.d.ts.map +1 -0
  74. package/dist/config/token-capture.js +252 -0
  75. package/dist/config/token-capture.js.map +1 -0
  76. package/dist/config/token-manager.d.ts +38 -0
  77. package/dist/config/token-manager.d.ts.map +1 -0
  78. package/dist/config/token-manager.js +153 -0
  79. package/dist/config/token-manager.js.map +1 -0
  80. package/dist/lib/list-options.d.ts +69 -0
  81. package/dist/lib/list-options.d.ts.map +1 -0
  82. package/dist/lib/list-options.js +299 -0
  83. package/dist/lib/list-options.js.map +1 -0
  84. package/dist/types/personal.d.ts +113 -0
  85. package/dist/types/personal.d.ts.map +1 -0
  86. package/dist/types/personal.js +4 -0
  87. package/dist/types/personal.js.map +1 -0
  88. package/docs/AUTOMATIC-PUBLISHING.md +520 -0
  89. package/docs/CHANGELOG-AUTOMATION.md +418 -0
  90. package/docs/CI-CD-SETUP.md +582 -0
  91. package/docs/DEV-SETUP.md +512 -0
  92. package/docs/ENHANCEMENT-PLAN.md +204 -0
  93. package/docs/ENTITY-TYPES.md +462 -0
  94. package/docs/GITHUB-ACTIONS-GUIDE.md +367 -0
  95. package/docs/NPM-PUBLISHING.md +324 -0
  96. package/docs/OUTPUT-EXAMPLES.md +414 -0
  97. package/docs/OUTPUT-FORMATS.md +299 -0
  98. package/docs/TESTING.md +216 -0
  99. package/eslint.config.js +68 -0
  100. package/package.json +64 -0
  101. package/src/api/client.ts +88 -0
  102. package/src/api/personal/activities.ts +66 -0
  103. package/src/api/personal/boards.ts +14 -0
  104. package/src/api/personal/index.ts +25 -0
  105. package/src/api/personal/jobs.ts +33 -0
  106. package/src/api/personal/user.ts +10 -0
  107. package/src/cli.ts +487 -0
  108. package/src/commands/capture-session.ts +582 -0
  109. package/src/config/clerk-session-manager.ts +263 -0
  110. package/src/config/config-manager.ts +56 -0
  111. package/src/config/keychain-manager.ts +30 -0
  112. package/src/config/token-capture.ts +233 -0
  113. package/src/config/token-manager.ts +139 -0
  114. package/src/lib/list-options.ts +370 -0
  115. package/src/types/personal.ts +114 -0
  116. package/tests/example.test.ts +130 -0
  117. package/tsconfig.json +19 -0
package/CHANGES.md ADDED
@@ -0,0 +1,259 @@
1
+ # Version 1.1.0 — Output Formatting Enhancements
2
+
3
+ ## Summary
4
+
5
+ Implemented comprehensive output formatting enhancements including field selection (`--fields`), PDF export, and Excel export for all list commands. All changes are backward compatible.
6
+
7
+ ## New Features
8
+
9
+ ### 1. Field Selection (`--fields`)
10
+
11
+ All list commands now support selecting specific output fields:
12
+
13
+ ```bash
14
+ huntr boards list --fields ID,Name
15
+ huntr jobs list <board-id> --fields Title,URL
16
+ huntr activities list <board-id> --fields Date,Type,Company
17
+ ```
18
+
19
+ **Benefits:**
20
+ - Reduce output clutter with only needed columns
21
+ - Easier to pipe to downstream tools
22
+ - Works with all output formats (table, json, csv, pdf, excel)
23
+
24
+ **Implementation:**
25
+ - Added `--fields` parameter to: `boards list`, `jobs list`, `activities list`
26
+ - Field names are case-sensitive and validated
27
+ - Invalid field names produce helpful error messages
28
+ - If `--fields` not specified, all default fields included (backward compatible)
29
+
30
+ ### 2. PDF Export Format
31
+
32
+ All list commands now support `--format pdf`:
33
+
34
+ ```bash
35
+ huntr activities list <board-id> --days 7 --format pdf > report.pdf
36
+ huntr jobs list <board-id> --format pdf > jobs.pdf
37
+ huntr boards list --format pdf > boards.pdf
38
+ ```
39
+
40
+ **Features:**
41
+ - Professional PDF with table formatting
42
+ - Bold white headers on blue background
43
+ - Alternate row shading for readability
44
+ - Auto-sized columns
45
+ - Metadata (generation date)
46
+ - Supports field selection with `--fields`
47
+
48
+ **Dependencies:**
49
+ - Requires `pdfkit` (v0.13.0)
50
+ - Automatically installed with `npm install`
51
+
52
+ ### 3. Excel Export Format
53
+
54
+ All list commands now support `--format excel`:
55
+
56
+ ```bash
57
+ huntr jobs list <board-id> --format excel > jobs.xlsx
58
+ huntr activities list <board-id> --days 7 --format excel > report.xlsx
59
+ huntr boards list --format excel > boards.xlsx
60
+ ```
61
+
62
+ **Features:**
63
+ - Excel spreadsheet with professional formatting
64
+ - Bold blue header row
65
+ - Auto-adjusted column widths (max 50 chars)
66
+ - Landscape orientation
67
+ - Supports field selection with `--fields`
68
+
69
+ **Dependencies:**
70
+ - Requires `exceljs` (v4.4.0)
71
+ - Automatically installed with `npm install`
72
+
73
+ ## Updated Features
74
+
75
+ ### Output Format Validation
76
+
77
+ Enhanced format parameter validation:
78
+
79
+ **Before:**
80
+ ```
81
+ Valid formats: table, json, csv
82
+ ```
83
+
84
+ **After:**
85
+ ```
86
+ Valid formats: table, json, csv, pdf, excel
87
+ ```
88
+
89
+ ### Shell Completions
90
+
91
+ Updated bash and zsh completions:
92
+ - Added `pdf` and `excel` to format options
93
+ - Added `--fields` parameter to list command completions
94
+ - Added `--week` flag to activities list completions
95
+
96
+ ## Files Changed
97
+
98
+ ### Core Implementation
99
+
100
+ 1. **src/lib/list-options.ts** — Core formatting logic
101
+ - Added `OutputFormat` type with pdf/excel
102
+ - Added `ListOptions.fields` property
103
+ - Added `validateFields()` function
104
+ - Added `formatTableWithFields()` function
105
+ - Added `formatCsvWithFields()` function
106
+ - Added `formatJsonWithFields()` function
107
+ - Added `formatPdf()` function
108
+ - Added `formatExcel()` function
109
+
110
+ 2. **src/cli.ts** — Command implementations
111
+ - Updated `boards list` command with field selection and new formats
112
+ - Updated `jobs list` command with field selection and new formats
113
+ - Updated `activities list` command with field selection and new formats
114
+ - Imported new formatting functions
115
+
116
+ ### Dependencies
117
+
118
+ 3. **package.json** — Added dependencies
119
+ - `pdfkit` (v0.13.0)
120
+ - `exceljs` (v4.4.0)
121
+
122
+ ### Completions
123
+
124
+ 4. **completions/huntr.bash** — Bash completions
125
+ - Updated format options to include pdf, excel
126
+ - Added --fields parameter
127
+ - Ensured --week flag is available for activities
128
+
129
+ 5. **completions/_huntr** — Zsh completions
130
+ - Updated format options to include pdf, excel
131
+ - Added field_opts configuration
132
+ - Added --fields parameter to list_opts
133
+
134
+ ### Documentation
135
+
136
+ 6. **docs/OUTPUT-FORMATS.md** (NEW)
137
+ - Comprehensive reference of all output fields
138
+ - Field definitions for each entity type
139
+ - Planned enhancement documentation
140
+
141
+ 7. **docs/ENHANCEMENT-PLAN.md** (NEW)
142
+ - Detailed implementation plan
143
+ - Library selection rationale
144
+ - Rollout phases
145
+
146
+ 8. **docs/OUTPUT-EXAMPLES.md** (NEW)
147
+ - Practical examples for all features
148
+ - Field selection examples
149
+ - Format-specific usage examples
150
+ - Integration with other tools (jq, bash, etc.)
151
+
152
+ 9. **docs/NPM-PUBLISHING.md** (NEW)
153
+ - Where published packages live
154
+ - How to publish to npm
155
+ - GitHub Artifacts vs npm
156
+ - Distribution flow
157
+ - Publishing checklist
158
+
159
+ ## Backward Compatibility
160
+
161
+ All changes are fully backward compatible:
162
+
163
+ - **Default behavior unchanged:** Running commands without `--fields` produces same output as before
164
+ - **Format parameter unchanged:** `--format table` (default), `json`, `csv` work identically
165
+ - **No breaking changes:** All existing commands and options work as before
166
+ - **New features additive:** `--fields` and new formats are optional enhancements
167
+
168
+ ## Error Handling
169
+
170
+ Improved error messages:
171
+
172
+ ```bash
173
+ # Invalid field name
174
+ $ huntr jobs list <board-id> --fields Title,BadField
175
+ Error: Unknown field(s): BadField
176
+ Available fields: ID, Title, URL, Created
177
+
178
+ # Invalid format
179
+ $ huntr jobs list <board-id> --format doc
180
+ Error: Invalid format: doc. Must be table, json, csv, pdf, or excel.
181
+ ```
182
+
183
+ ## Testing
184
+
185
+ **Verified:**
186
+ - ✅ TypeScript compilation (no errors)
187
+ - ✅ Build process (all targets compile)
188
+ - ✅ Backward compatibility (existing usage unchanged)
189
+ - ✅ Field validation (invalid fields caught)
190
+ - ✅ Format parsing (new formats recognized)
191
+ - ✅ Dependency installation (pdfkit, exceljs added)
192
+
193
+ ## Examples
194
+
195
+ ### Quick Start with New Features
196
+
197
+ ```bash
198
+ # 1. Export jobs as Excel
199
+ huntr jobs list <board-id> --format excel > jobs.xlsx
200
+
201
+ # 2. Get only titles and URLs
202
+ huntr jobs list <board-id> --fields Title,URL
203
+
204
+ # 3. PDF report of this week's activities
205
+ huntr activities list <board-id> --days 7 --format pdf > report.pdf
206
+
207
+ # 4. JSON with specific fields for scripting
208
+ huntr activities list <board-id> --format json --fields Date,Type,Company
209
+ ```
210
+
211
+ ## Recommendations for Next Version (v1.2.0)
212
+
213
+ 1. **Fish shell completions** — Add completions/huntr.fish
214
+ 2. **Test suite** — Add unit tests for new formatting functions
215
+ 3. **CI/CD** — Add GitHub Actions for automated testing/building
216
+ 4. **Alternative formats** — Consider TSV, Markdown table, HTML
217
+ 5. **Custom headers** — Allow renaming columns in output
218
+ 6. **Filtering on output** — Add `--where` parameter for post-filter
219
+
220
+ ## Documentation Updates
221
+
222
+ Updated or created:
223
+ - [OUTPUT-FORMATS.md](./docs/OUTPUT-FORMATS.md) — Field reference
224
+ - [OUTPUT-EXAMPLES.md](./docs/OUTPUT-EXAMPLES.md) — Practical examples
225
+ - [ENHANCEMENT-PLAN.md](./docs/ENHANCEMENT-PLAN.md) — Implementation details
226
+ - [NPM-PUBLISHING.md](./docs/NPM-PUBLISHING.md) — Distribution guide
227
+ - [README.md](./README.md) — May need updates for new options
228
+ - [completions/huntr.bash](./completions/huntr.bash) — Updated
229
+ - [completions/_huntr](./completions/_huntr) — Updated
230
+
231
+ ## Version Info
232
+
233
+ - **Version:** 1.1.0
234
+ - **Release Date:** 2026-02-23
235
+ - **Node Requirement:** >=18.0.0
236
+ - **Status:** Ready for npm publish
237
+
238
+ ## How to Publish
239
+
240
+ ```bash
241
+ # Update version
242
+ npm version minor # 1.0.0 → 1.1.0
243
+
244
+ # Build (automatic with prepublishOnly)
245
+ npm publish
246
+
247
+ # Verify
248
+ npm view huntr-cli version
249
+ npm info huntr-cli
250
+
251
+ # Install globally to test
252
+ npm install -g huntr-cli@1.1.0
253
+ ```
254
+
255
+ Users can then install:
256
+ ```bash
257
+ npm install -g huntr-cli
258
+ huntr --version
259
+ ```
package/LICENSE ADDED
@@ -0,0 +1,15 @@
1
+ ISC License
2
+
3
+ Copyright (c) 2026, Matt McKnight
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted, provided that the above
7
+ copyright notice and this permission notice appear in all copies.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
package/PUBLISHING.md ADDED
@@ -0,0 +1,191 @@
1
+ # Publishing Huntr CLI to npm
2
+
3
+ This guide covers publishing huntr-cli to npm and how users can install it.
4
+
5
+ ## Prerequisites
6
+
7
+ 1. **npm account**: Create one at [npmjs.com](https://npmjs.com) if you don't have one
8
+ 2. **Verify git status**: Ensure your working directory is clean
9
+ 3. **Update version**: Bump `version` in `package.json`
10
+ 4. **Test build**: Run `npm run build` to verify everything compiles
11
+
12
+ ## Publishing Steps
13
+
14
+ ### 1. Prepare the Release
15
+
16
+ ```bash
17
+ # Verify clean working directory
18
+ git status
19
+
20
+ # Build to ensure no errors
21
+ npm run build
22
+
23
+ # Run tests (once tests are added)
24
+ npm test
25
+ ```
26
+
27
+ ### 2. Update Version
28
+
29
+ Use semantic versioning (major.minor.patch):
30
+
31
+ ```bash
32
+ # Patch release (bug fixes): 1.0.0 → 1.0.1
33
+ npm version patch
34
+
35
+ # Minor release (new features): 1.0.0 → 1.1.0
36
+ npm version minor
37
+
38
+ # Major release (breaking changes): 1.0.0 → 2.0.0
39
+ npm version major
40
+ ```
41
+
42
+ This automatically:
43
+ - Updates `package.json` version
44
+ - Creates a git commit
45
+ - Creates a git tag
46
+
47
+ ### 3. Push to GitHub
48
+
49
+ ```bash
50
+ # Push commits and tags
51
+ git push origin main --follow-tags
52
+ ```
53
+
54
+ ### 4. Publish to npm
55
+
56
+ ```bash
57
+ # Login to npm (one-time)
58
+ npm login
59
+
60
+ # Publish
61
+ npm publish
62
+
63
+ # Verify it's published
64
+ npm view huntr-cli
65
+ ```
66
+
67
+ ### 5. Create GitHub Release (Optional)
68
+
69
+ ```bash
70
+ # Create a release from the git tag
71
+ gh release create v1.0.0 --generate-notes
72
+ ```
73
+
74
+ ---
75
+
76
+ ## Installation for Users
77
+
78
+ ### Global Installation (Recommended)
79
+
80
+ ```bash
81
+ npm install -g huntr-cli
82
+
83
+ # Verify installation
84
+ huntr --help
85
+ ```
86
+
87
+ ### Local Installation
88
+
89
+ ```bash
90
+ npm install huntr-cli
91
+ npx huntr --help
92
+ ```
93
+
94
+ ### From GitHub (Development)
95
+
96
+ ```bash
97
+ # Clone repo
98
+ git clone https://github.com/mattmck/huntr-cli.git
99
+ cd huntr-cli
100
+
101
+ # Install and link
102
+ npm install
103
+ npm link
104
+
105
+ # Now 'huntr' command is available globally
106
+ huntr --help
107
+ ```
108
+
109
+ ---
110
+
111
+ ## Shell Completions
112
+
113
+ After global installation, users can enable shell completions:
114
+
115
+ ### Bash
116
+
117
+ ```bash
118
+ sudo cp completions/huntr.bash /usr/local/etc/bash_completion.d/huntr
119
+ source ~/.bashrc
120
+ ```
121
+
122
+ ### Zsh
123
+
124
+ ```bash
125
+ sudo cp completions/_huntr /usr/local/share/zsh/site-functions/_huntr
126
+ source ~/.zshrc
127
+ ```
128
+
129
+ ### Fish
130
+
131
+ ```bash
132
+ cp completions/huntr.fish ~/.config/fish/completions/
133
+ ```
134
+
135
+ ---
136
+
137
+ ## Troubleshooting
138
+
139
+ ### Not published to npm
140
+
141
+ ```bash
142
+ # Check if already published
143
+ npm view huntr-cli
144
+
145
+ # Check your npm access
146
+ npm access
147
+ ```
148
+
149
+ ### Version conflicts
150
+
151
+ ```bash
152
+ # Check what's already on npm
153
+ npm info huntr-cli versions
154
+
155
+ # You must use a higher version number to republish
156
+ ```
157
+
158
+ ### Authentication issues
159
+
160
+ ```bash
161
+ # Re-login to npm
162
+ npm logout
163
+ npm login
164
+ ```
165
+
166
+ ---
167
+
168
+ ## Version History
169
+
170
+ Track versions and changes:
171
+
172
+ | Version | Date | Notes |
173
+ |---------|------|-------|
174
+ | 1.0.0 | 2026-02-22 | Initial release with session-based auth, list commands, CSV/JSON output |
175
+
176
+ ---
177
+
178
+ ## Distribution Checklist
179
+
180
+ Before publishing a new version:
181
+
182
+ - [ ] Update version in `package.json`
183
+ - [ ] Update `CHANGELOG.md` (create if missing)
184
+ - [ ] Run `npm run build` successfully
185
+ - [ ] Run tests (when available)
186
+ - [ ] Update README if needed
187
+ - [ ] Test completions locally
188
+ - [ ] Push to GitHub
189
+ - [ ] Run `npm publish`
190
+ - [ ] Verify on npmjs.com
191
+ - [ ] Create GitHub release