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.
- package/.env.example +7 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +43 -0
- package/.github/ISSUE_TEMPLATE/config.yml +8 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +29 -0
- package/.github/labels.json +92 -0
- package/.github/pull_request_template.md +64 -0
- package/.github/workflows/ci.yml +87 -0
- package/.github/workflows/labels.yml +27 -0
- package/.github/workflows/manual-publish.yml +105 -0
- package/.github/workflows/publish.yml +57 -0
- package/.github/workflows/release.yml +124 -0
- package/.github/workflows/security-audit.yml +44 -0
- package/.husky/pre-commit +12 -0
- package/.husky/pre-push +27 -0
- package/.lintstagedrc.json +3 -0
- package/AGENTS.md +449 -0
- package/CHANGELOG.md +38 -0
- package/CHANGES.md +259 -0
- package/LICENSE +15 -0
- package/PUBLISHING.md +191 -0
- package/README.md +385 -0
- package/ROADMAP.md +158 -0
- package/SETUP-COMPLETE.md +446 -0
- package/WORKFLOW-SUMMARY.md +368 -0
- package/completions/_huntr +168 -0
- package/completions/huntr.1 +266 -0
- package/completions/huntr.bash +91 -0
- package/dist/api/client.d.ts +14 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +74 -0
- package/dist/api/client.js.map +1 -0
- package/dist/api/personal/activities.d.ts +20 -0
- package/dist/api/personal/activities.d.ts.map +1 -0
- package/dist/api/personal/activities.js +50 -0
- package/dist/api/personal/activities.js.map +1 -0
- package/dist/api/personal/boards.d.ts +9 -0
- package/dist/api/personal/boards.d.ts.map +1 -0
- package/dist/api/personal/boards.js +16 -0
- package/dist/api/personal/boards.js.map +1 -0
- package/dist/api/personal/index.d.ts +17 -0
- package/dist/api/personal/index.d.ts.map +1 -0
- package/dist/api/personal/index.js +37 -0
- package/dist/api/personal/index.js.map +1 -0
- package/dist/api/personal/jobs.d.ts +13 -0
- package/dist/api/personal/jobs.d.ts.map +1 -0
- package/dist/api/personal/jobs.js +31 -0
- package/dist/api/personal/jobs.js.map +1 -0
- package/dist/api/personal/user.d.ts +8 -0
- package/dist/api/personal/user.d.ts.map +1 -0
- package/dist/api/personal/user.js +13 -0
- package/dist/api/personal/user.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +501 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/capture-session.d.ts +10 -0
- package/dist/commands/capture-session.d.ts.map +1 -0
- package/dist/commands/capture-session.js +478 -0
- package/dist/commands/capture-session.js.map +1 -0
- package/dist/config/clerk-session-manager.d.ts +44 -0
- package/dist/config/clerk-session-manager.d.ts.map +1 -0
- package/dist/config/clerk-session-manager.js +232 -0
- package/dist/config/clerk-session-manager.js.map +1 -0
- package/dist/config/config-manager.d.ts +15 -0
- package/dist/config/config-manager.d.ts.map +1 -0
- package/dist/config/config-manager.js +51 -0
- package/dist/config/config-manager.js.map +1 -0
- package/dist/config/keychain-manager.d.ts +6 -0
- package/dist/config/keychain-manager.d.ts.map +1 -0
- package/dist/config/keychain-manager.js +37 -0
- package/dist/config/keychain-manager.js.map +1 -0
- package/dist/config/token-capture.d.ts +11 -0
- package/dist/config/token-capture.d.ts.map +1 -0
- package/dist/config/token-capture.js +252 -0
- package/dist/config/token-capture.js.map +1 -0
- package/dist/config/token-manager.d.ts +38 -0
- package/dist/config/token-manager.d.ts.map +1 -0
- package/dist/config/token-manager.js +153 -0
- package/dist/config/token-manager.js.map +1 -0
- package/dist/lib/list-options.d.ts +69 -0
- package/dist/lib/list-options.d.ts.map +1 -0
- package/dist/lib/list-options.js +299 -0
- package/dist/lib/list-options.js.map +1 -0
- package/dist/types/personal.d.ts +113 -0
- package/dist/types/personal.d.ts.map +1 -0
- package/dist/types/personal.js +4 -0
- package/dist/types/personal.js.map +1 -0
- package/docs/AUTOMATIC-PUBLISHING.md +520 -0
- package/docs/CHANGELOG-AUTOMATION.md +418 -0
- package/docs/CI-CD-SETUP.md +582 -0
- package/docs/DEV-SETUP.md +512 -0
- package/docs/ENHANCEMENT-PLAN.md +204 -0
- package/docs/ENTITY-TYPES.md +462 -0
- package/docs/GITHUB-ACTIONS-GUIDE.md +367 -0
- package/docs/NPM-PUBLISHING.md +324 -0
- package/docs/OUTPUT-EXAMPLES.md +414 -0
- package/docs/OUTPUT-FORMATS.md +299 -0
- package/docs/TESTING.md +216 -0
- package/eslint.config.js +68 -0
- package/package.json +64 -0
- package/src/api/client.ts +88 -0
- package/src/api/personal/activities.ts +66 -0
- package/src/api/personal/boards.ts +14 -0
- package/src/api/personal/index.ts +25 -0
- package/src/api/personal/jobs.ts +33 -0
- package/src/api/personal/user.ts +10 -0
- package/src/cli.ts +487 -0
- package/src/commands/capture-session.ts +582 -0
- package/src/config/clerk-session-manager.ts +263 -0
- package/src/config/config-manager.ts +56 -0
- package/src/config/keychain-manager.ts +30 -0
- package/src/config/token-capture.ts +233 -0
- package/src/config/token-manager.ts +139 -0
- package/src/lib/list-options.ts +370 -0
- package/src/types/personal.ts +114 -0
- package/tests/example.test.ts +130 -0
- package/tsconfig.json +19 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
echo "🔍 Running pre-commit checks..."
|
|
2
|
+
|
|
3
|
+
# Run lint-staged for staged files
|
|
4
|
+
npx lint-staged
|
|
5
|
+
|
|
6
|
+
# Check if lint-staged passed
|
|
7
|
+
if [ $? -ne 0 ]; then
|
|
8
|
+
echo "❌ Linting failed. Please fix errors and try again."
|
|
9
|
+
exit 1
|
|
10
|
+
fi
|
|
11
|
+
|
|
12
|
+
echo "✓ Pre-commit checks passed"
|
package/.husky/pre-push
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
echo "🧪 Running pre-push checks..."
|
|
2
|
+
|
|
3
|
+
# Typecheck
|
|
4
|
+
echo "📋 Typechecking..."
|
|
5
|
+
npm run typecheck
|
|
6
|
+
if [ $? -ne 0 ]; then
|
|
7
|
+
echo "❌ TypeScript errors found"
|
|
8
|
+
exit 1
|
|
9
|
+
fi
|
|
10
|
+
|
|
11
|
+
# Lint all source files
|
|
12
|
+
echo "🔍 Linting all source files..."
|
|
13
|
+
npm run lint
|
|
14
|
+
if [ $? -ne 0 ]; then
|
|
15
|
+
echo "❌ Linting errors found"
|
|
16
|
+
exit 1
|
|
17
|
+
fi
|
|
18
|
+
|
|
19
|
+
# Build
|
|
20
|
+
echo "🔨 Building..."
|
|
21
|
+
npm run build
|
|
22
|
+
if [ $? -ne 0 ]; then
|
|
23
|
+
echo "❌ Build failed"
|
|
24
|
+
exit 1
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
echo "✓ All pre-push checks passed"
|
package/AGENTS.md
ADDED
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
# huntr-cli Agent Instructions
|
|
2
|
+
|
|
3
|
+
Agent context and best practices for working on the huntr-cli project.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
**huntr-cli** is a production-ready CLI tool for managing your Huntr job search board. It features:
|
|
8
|
+
- Complete API client for Huntr Personal API
|
|
9
|
+
- Multiple output formats (table, JSON, CSV, PDF, Excel)
|
|
10
|
+
- Field selection with `--fields` parameter
|
|
11
|
+
- Session-based and token-based authentication
|
|
12
|
+
- Full CI/CD pipeline with automatic publishing
|
|
13
|
+
- Comprehensive test suite and documentation
|
|
14
|
+
|
|
15
|
+
**Status:** ✅ Production ready (v1.0.0)
|
|
16
|
+
**License:** ISC (open source)
|
|
17
|
+
**Language:** TypeScript (strict mode)
|
|
18
|
+
|
|
19
|
+
## Architecture
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
huntr-cli/
|
|
23
|
+
├── src/
|
|
24
|
+
│ ├── cli.ts ← Main entry point
|
|
25
|
+
│ ├── commands/ ← Command handlers
|
|
26
|
+
│ ├── api/personal/ ← API client (boards, jobs, activities, users)
|
|
27
|
+
│ ├── config/ ← Token management, session capture
|
|
28
|
+
│ ├── lib/ ← Utilities (formatting, validation)
|
|
29
|
+
│ └── types/personal.ts ← TypeScript interfaces
|
|
30
|
+
├── dist/ ← Compiled output (git ignored)
|
|
31
|
+
├── tests/ ← Vitest test suite
|
|
32
|
+
├── docs/ ← Comprehensive guides
|
|
33
|
+
├── .github/
|
|
34
|
+
│ ├── workflows/ ← 6 GitHub Actions workflows
|
|
35
|
+
│ ├── ISSUE_TEMPLATE/ ← Issue templates
|
|
36
|
+
│ └── labels.json ← GitHub labels
|
|
37
|
+
├── .husky/ ← Git hooks (pre-commit, pre-push)
|
|
38
|
+
└── package.json ← Scripts and dependencies
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Key Files
|
|
42
|
+
|
|
43
|
+
| File | Purpose |
|
|
44
|
+
|------|---------|
|
|
45
|
+
| `src/cli.ts` | Main CLI entry, command registration |
|
|
46
|
+
| `src/api/personal/index.ts` | API client exports |
|
|
47
|
+
| `src/lib/list-options.ts` | Output formatting and field selection |
|
|
48
|
+
| `src/config/token-manager.ts` | Token/session management |
|
|
49
|
+
| `.github/workflows/release.yml` | Automatic release creation |
|
|
50
|
+
| `.github/workflows/publish.yml` | npm publishing |
|
|
51
|
+
| `docs/WORKFLOW-SUMMARY.md` | Complete workflow reference |
|
|
52
|
+
| `package.json` | All scripts and dependencies |
|
|
53
|
+
|
|
54
|
+
## Development Setup
|
|
55
|
+
|
|
56
|
+
### Installation
|
|
57
|
+
```bash
|
|
58
|
+
npm install # Automatically installs git hooks via husky
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Available Commands
|
|
62
|
+
```bash
|
|
63
|
+
npm run dev -- <command> # Run CLI in dev mode
|
|
64
|
+
npm run build # Compile TypeScript
|
|
65
|
+
npm run lint # Check code style
|
|
66
|
+
npm run lint:fix # Auto-fix style issues
|
|
67
|
+
npm run typecheck # Check TypeScript types
|
|
68
|
+
npm test # Run test suite
|
|
69
|
+
npm run test:watch # Watch mode for tests
|
|
70
|
+
npm run prepare # Reinstall git hooks
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Git Workflow
|
|
74
|
+
|
|
75
|
+
**Create feature:**
|
|
76
|
+
```bash
|
|
77
|
+
git checkout -b feat/my-feature
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**Develop:**
|
|
81
|
+
```bash
|
|
82
|
+
npm run dev -- boards list # Test changes
|
|
83
|
+
npm run lint:fix # Fix style
|
|
84
|
+
npm run build # Build
|
|
85
|
+
npm run typecheck # Type check
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**Commit (pre-commit hook runs):**
|
|
89
|
+
```bash
|
|
90
|
+
git commit -m "feat: add feature" # Lints staged files
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**Push (pre-push hook runs):**
|
|
94
|
+
```bash
|
|
95
|
+
git push origin feat/my-feature # Typecheck → Lint → Build
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**Create PR → Code review → Merge to main**
|
|
99
|
+
|
|
100
|
+
## Commit Conventions
|
|
101
|
+
|
|
102
|
+
Use [Conventional Commits](https://www.conventionalcommits.org/):
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
feat: New feature (appears in changelog)
|
|
106
|
+
fix: Bug fix (appears in changelog)
|
|
107
|
+
perf: Performance improvement (appears in changelog)
|
|
108
|
+
docs: Documentation only
|
|
109
|
+
chore: Build, dependencies, tooling (internal)
|
|
110
|
+
test: Test improvements (internal)
|
|
111
|
+
refactor: Code restructuring (internal)
|
|
112
|
+
ci: CI/CD changes (internal)
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**Examples:**
|
|
116
|
+
```bash
|
|
117
|
+
git commit -m "feat: add --fields parameter for field selection"
|
|
118
|
+
git commit -m "fix: handle missing company in activities"
|
|
119
|
+
git commit -m "perf: optimize table rendering"
|
|
120
|
+
git commit -m "chore: update dependencies"
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Code Standards
|
|
124
|
+
|
|
125
|
+
### TypeScript
|
|
126
|
+
- **Strict mode enabled** — No implicit `any`
|
|
127
|
+
- **ESLint with TypeScript support** — Modern flat config
|
|
128
|
+
- **Import style** — ES modules (`import`/`export`)
|
|
129
|
+
- **No `console.log` in production** — Use proper logging
|
|
130
|
+
|
|
131
|
+
### Formatting
|
|
132
|
+
- **Quotes:** Single quotes (`'`) preferred
|
|
133
|
+
- **Semicolons:** Always required
|
|
134
|
+
- **Trailing commas:** Always on multiline
|
|
135
|
+
- **Line length:** No hard limit, but keep readable
|
|
136
|
+
- **Auto-fixed by:** `npm run lint:fix`
|
|
137
|
+
|
|
138
|
+
### Patterns
|
|
139
|
+
|
|
140
|
+
**API Client Pattern:**
|
|
141
|
+
```typescript
|
|
142
|
+
// src/api/personal/my-feature.ts
|
|
143
|
+
export async function getMyFeature(token: string): Promise<MyData[]> {
|
|
144
|
+
const response = await fetch('https://api.huntr.co/...');
|
|
145
|
+
return response.json();
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// Re-export from index.ts
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**Command Pattern:**
|
|
152
|
+
```typescript
|
|
153
|
+
// In src/cli.ts
|
|
154
|
+
program
|
|
155
|
+
.command('my-command <id>')
|
|
156
|
+
.option('--format <format>', 'Output format')
|
|
157
|
+
.option('--fields <fields>', 'Field selection')
|
|
158
|
+
.action(async (id, options) => {
|
|
159
|
+
// Implementation
|
|
160
|
+
});
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
**Output Formatting:**
|
|
164
|
+
```typescript
|
|
165
|
+
// Use validateFields and format functions from src/lib/list-options.ts
|
|
166
|
+
const fields = validateFields(requested, availableFields);
|
|
167
|
+
const output = formatTableWithFields(data, fields);
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Testing
|
|
171
|
+
|
|
172
|
+
### Running Tests
|
|
173
|
+
```bash
|
|
174
|
+
npm test # Run all tests
|
|
175
|
+
npm test -- --watch # Watch mode
|
|
176
|
+
npm test -- --coverage # Coverage report
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Test Structure
|
|
180
|
+
- **Command Structure** — Verify CLI commands exist
|
|
181
|
+
- **Build & Compilation** — Document CI checks
|
|
182
|
+
- **Git Workflow** — Verify conventional commits
|
|
183
|
+
- **Publishing Workflow** — Document release process
|
|
184
|
+
- **Output Formatting** — Verify formats (table, JSON, CSV, PDF, Excel)
|
|
185
|
+
- **Documentation** — Confirm guides exist
|
|
186
|
+
|
|
187
|
+
### Adding Tests
|
|
188
|
+
Edit `tests/example.test.ts`:
|
|
189
|
+
```typescript
|
|
190
|
+
describe('Feature Area', () => {
|
|
191
|
+
it('should do something', () => {
|
|
192
|
+
expect(result).toBe(expected);
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## Git Hooks
|
|
198
|
+
|
|
199
|
+
### Pre-commit Hook
|
|
200
|
+
**File:** `.husky/pre-commit`
|
|
201
|
+
- Runs on: `git commit`
|
|
202
|
+
- Actions: Lints staged files, auto-fixes, blocks on errors
|
|
203
|
+
- Config: `.lintstagedrc.json`
|
|
204
|
+
|
|
205
|
+
### Pre-push Hook
|
|
206
|
+
**File:** `.husky/pre-push`
|
|
207
|
+
- Runs on: `git push`
|
|
208
|
+
- Actions: Typecheck → Lint → Build
|
|
209
|
+
- Blocks: If any check fails
|
|
210
|
+
|
|
211
|
+
**Bypass (emergency only):**
|
|
212
|
+
```bash
|
|
213
|
+
git push --no-verify # Not recommended!
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## GitHub Actions Workflows
|
|
217
|
+
|
|
218
|
+
| Workflow | Trigger | Purpose |
|
|
219
|
+
|----------|---------|---------|
|
|
220
|
+
| **ci.yml** | Every push + PR | Lint, typecheck, build, test (parallel) |
|
|
221
|
+
| **release.yml** | Version bump on main | Create artifacts + GitHub Release |
|
|
222
|
+
| **publish.yml** | GitHub Release published | npm publish |
|
|
223
|
+
| **manual-publish.yml** | Manual dispatch | Custom version + npm tag |
|
|
224
|
+
| **security-audit.yml** | Daily + push | npm audit vulnerability scan |
|
|
225
|
+
| **labels.yml** | labels.json change | Sync GitHub labels |
|
|
226
|
+
|
|
227
|
+
**File location:** `.github/workflows/`
|
|
228
|
+
|
|
229
|
+
## Publishing & Releases
|
|
230
|
+
|
|
231
|
+
### Automatic Publishing (Recommended)
|
|
232
|
+
```bash
|
|
233
|
+
npm version minor # 1.0.0 → 1.1.0
|
|
234
|
+
git push origin main --tags
|
|
235
|
+
# → release.yml creates artifacts + GitHub Release
|
|
236
|
+
# → publish.yml publishes to npm
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### Manual Publishing
|
|
240
|
+
GitHub Actions → Manual Publish → Run workflow with version + npm tag
|
|
241
|
+
|
|
242
|
+
### Changelog Generation
|
|
243
|
+
- **Format:** Keep a Changelog
|
|
244
|
+
- **Auto-generated:** From conventional commits
|
|
245
|
+
- **File:** `CHANGELOG.md`
|
|
246
|
+
- **Guide:** `docs/CHANGELOG-AUTOMATION.md`
|
|
247
|
+
|
|
248
|
+
## Types & Interfaces
|
|
249
|
+
|
|
250
|
+
**Key types in `src/types/personal.ts`:**
|
|
251
|
+
|
|
252
|
+
```typescript
|
|
253
|
+
export interface Board {
|
|
254
|
+
id: string;
|
|
255
|
+
name: string;
|
|
256
|
+
createdAt: string;
|
|
257
|
+
updatedAt: string;
|
|
258
|
+
lists: BoardList[];
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export interface PersonalJob {
|
|
262
|
+
id: string;
|
|
263
|
+
title: string;
|
|
264
|
+
url?: string;
|
|
265
|
+
salary?: Salary;
|
|
266
|
+
location?: Location;
|
|
267
|
+
// ... more fields
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
export interface PersonalAction {
|
|
271
|
+
id: string;
|
|
272
|
+
actionType: string;
|
|
273
|
+
date: string;
|
|
274
|
+
data: ActionData;
|
|
275
|
+
}
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
**Full reference:** `docs/ENTITY-TYPES.md`
|
|
279
|
+
|
|
280
|
+
## Output Formatting
|
|
281
|
+
|
|
282
|
+
**Supported formats:**
|
|
283
|
+
- `table` — Human-readable (default)
|
|
284
|
+
- `json` — Machine-readable
|
|
285
|
+
- `csv` — Spreadsheet import
|
|
286
|
+
- `pdf` — Document export (pdfkit)
|
|
287
|
+
- `excel` — Spreadsheet (.xlsx, exceljs)
|
|
288
|
+
|
|
289
|
+
**Field selection:**
|
|
290
|
+
```bash
|
|
291
|
+
huntr boards list --fields ID,Name
|
|
292
|
+
huntr jobs list <board-id> --fields Title,URL --format csv
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
**Implementation:** `src/lib/list-options.ts`
|
|
296
|
+
|
|
297
|
+
## Authentication
|
|
298
|
+
|
|
299
|
+
**Supported methods (priority order):**
|
|
300
|
+
1. CLI argument: `--token <token>`
|
|
301
|
+
2. Environment variable: `HUNTR_API_TOKEN`
|
|
302
|
+
3. Session-based: macOS Keychain (auto-refreshing)
|
|
303
|
+
4. Config file: `~/.huntr/config.json`
|
|
304
|
+
5. Interactive prompt
|
|
305
|
+
|
|
306
|
+
**Session management:** `src/config/clerk-session-manager.ts`
|
|
307
|
+
**Token management:** `src/config/token-manager.ts`
|
|
308
|
+
|
|
309
|
+
## Documentation
|
|
310
|
+
|
|
311
|
+
**Quick references:**
|
|
312
|
+
- `WORKFLOW-SUMMARY.md` — Complete workflow overview
|
|
313
|
+
- `DEV-SETUP.md` — Local development guide
|
|
314
|
+
- `AUTOMATIC-PUBLISHING.md` — Release workflow
|
|
315
|
+
- `CHANGELOG-AUTOMATION.md` — Changelog generation
|
|
316
|
+
- `TESTING.md` — Test suite guide
|
|
317
|
+
- `ENTITY-TYPES.md` — Type schemas with examples
|
|
318
|
+
- `OUTPUT-FORMATS.md` — Field reference
|
|
319
|
+
- `OUTPUT-EXAMPLES.md` — 30+ usage examples
|
|
320
|
+
|
|
321
|
+
**All docs:** `docs/` directory
|
|
322
|
+
|
|
323
|
+
## Common Tasks
|
|
324
|
+
|
|
325
|
+
### Add a New Command
|
|
326
|
+
1. Create handler in `src/commands/`
|
|
327
|
+
2. Register in `src/cli.ts` with `program.command()`
|
|
328
|
+
3. Update `completions/huntr.1` man page
|
|
329
|
+
4. Add tests to `tests/example.test.ts`
|
|
330
|
+
5. Commit with `feat: add new command`
|
|
331
|
+
|
|
332
|
+
### Add Output Format
|
|
333
|
+
1. Add formatter function to `src/lib/list-options.ts`
|
|
334
|
+
2. Update list commands in `src/cli.ts`
|
|
335
|
+
3. Test with `npm run dev -- <command> --format <format>`
|
|
336
|
+
4. Commit with `feat: add <format> export`
|
|
337
|
+
|
|
338
|
+
### Fix a Bug
|
|
339
|
+
1. Create branch: `git checkout -b fix/bug-description`
|
|
340
|
+
2. Fix issue
|
|
341
|
+
3. Add test case
|
|
342
|
+
4. Verify: `npm run build && npm run lint && npm run typecheck && npm test`
|
|
343
|
+
5. Commit: `fix: resolve bug description`
|
|
344
|
+
6. Create PR
|
|
345
|
+
|
|
346
|
+
### Update Documentation
|
|
347
|
+
1. Edit relevant `.md` file
|
|
348
|
+
2. Test commands if documenting features
|
|
349
|
+
3. Commit: `docs: update documentation`
|
|
350
|
+
|
|
351
|
+
## Troubleshooting
|
|
352
|
+
|
|
353
|
+
### Pre-commit Hook Failing
|
|
354
|
+
```bash
|
|
355
|
+
npm run lint:fix # Auto-fix issues
|
|
356
|
+
git add .
|
|
357
|
+
git commit -m "..."
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
### Pre-push Hook Failing
|
|
361
|
+
```bash
|
|
362
|
+
npm run typecheck # See type errors
|
|
363
|
+
npm run build # See build errors
|
|
364
|
+
# Fix issues, retry push
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
### Hooks Not Running
|
|
368
|
+
```bash
|
|
369
|
+
npm run prepare # Reinstall hooks
|
|
370
|
+
ls -la .husky/ # Verify files exist
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
### Tests Failing
|
|
374
|
+
```bash
|
|
375
|
+
npm test -- --reporter=verbose # Verbose output
|
|
376
|
+
npm test -- --watch # Watch mode
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
## Best Practices
|
|
380
|
+
|
|
381
|
+
✅ **DO**
|
|
382
|
+
- Write conventional commit messages
|
|
383
|
+
- Use TypeScript strict mode
|
|
384
|
+
- Run `npm run lint:fix` before committing
|
|
385
|
+
- Write tests for new features
|
|
386
|
+
- Update documentation when making changes
|
|
387
|
+
- Review GitHub Actions logs if workflows fail
|
|
388
|
+
|
|
389
|
+
❌ **DON'T**
|
|
390
|
+
- Use `any` type without good reason
|
|
391
|
+
- Bypass pre-commit/pre-push hooks regularly
|
|
392
|
+
- Mix internal and user-facing changes in one commit
|
|
393
|
+
- Commit without running `npm run build`
|
|
394
|
+
- Push to main without PR review
|
|
395
|
+
- Force push to main branch
|
|
396
|
+
|
|
397
|
+
## Performance Considerations
|
|
398
|
+
|
|
399
|
+
- **List commands:** Use field selection to reduce output
|
|
400
|
+
- **API calls:** Cache responses when appropriate
|
|
401
|
+
- **Formatting:** Lazy-load PDF/Excel formatters
|
|
402
|
+
- **Colors:** Keep table formatting efficient
|
|
403
|
+
|
|
404
|
+
## Security
|
|
405
|
+
|
|
406
|
+
- **Environment variables:** Use `HUNTR_API_TOKEN` instead of flags
|
|
407
|
+
- **Session storage:** macOS Keychain for local sessions
|
|
408
|
+
- **Token validation:** JWT-based via Clerk
|
|
409
|
+
- **No sensitive data in logs:** Use `DEBUG=huntr-cli:*`
|
|
410
|
+
|
|
411
|
+
## Resources
|
|
412
|
+
|
|
413
|
+
- **Huntr API:** https://huntr.co
|
|
414
|
+
- **GitHub:** https://github.com/mattmck/huntr-cli
|
|
415
|
+
- **npm:** https://www.npmjs.com/package/huntr-cli
|
|
416
|
+
- **Issues:** GitHub Issues with type/priority/scope labels
|
|
417
|
+
- **Discussions:** GitHub Discussions
|
|
418
|
+
|
|
419
|
+
## Agent-Specific Notes
|
|
420
|
+
|
|
421
|
+
### Claude Code / Cursor
|
|
422
|
+
- Full TypeScript support with strict mode
|
|
423
|
+
- ESLint auto-fixes available
|
|
424
|
+
- Test suite documents workflow
|
|
425
|
+
- All workflows in `.github/workflows/`
|
|
426
|
+
|
|
427
|
+
### GitHub Copilot
|
|
428
|
+
- Follows conventional commits
|
|
429
|
+
- Clear function signatures
|
|
430
|
+
- Comprehensive test examples
|
|
431
|
+
- API patterns well-documented
|
|
432
|
+
|
|
433
|
+
### Anthropic Claude
|
|
434
|
+
- Project has complete documentation
|
|
435
|
+
- Architecture clearly separated
|
|
436
|
+
- Types are explicit and strict
|
|
437
|
+
- Testing approach is documented
|
|
438
|
+
|
|
439
|
+
## Version Info
|
|
440
|
+
|
|
441
|
+
- **Current Version:** 1.0.0
|
|
442
|
+
- **Node.js Required:** >=18.0.0
|
|
443
|
+
- **TypeScript:** 5.9.3
|
|
444
|
+
- **Status:** ✅ Production ready
|
|
445
|
+
- **Last Updated:** February 23, 2026
|
|
446
|
+
|
|
447
|
+
---
|
|
448
|
+
|
|
449
|
+
**For detailed information, see the documentation in the `docs/` directory.**
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to huntr-cli will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Output format enhancements (PDF, Excel, field selection)
|
|
12
|
+
- Pre-commit and pre-push git hooks
|
|
13
|
+
- ESLint configuration for code quality
|
|
14
|
+
- GitHub Actions CI/CD pipeline
|
|
15
|
+
- Issue and PR templates
|
|
16
|
+
- Comprehensive documentation
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
- Enhanced completion scripts for bash and zsh
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
- Various linting and type safety issues
|
|
23
|
+
|
|
24
|
+
## [1.0.0] - 2026-02-23
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
- Initial release of huntr-cli
|
|
28
|
+
- Session-based authentication (macOS)
|
|
29
|
+
- Multiple authentication methods
|
|
30
|
+
- Board management (list, get)
|
|
31
|
+
- Job management (list, get)
|
|
32
|
+
- Activity tracking (list, week-csv)
|
|
33
|
+
- Multiple output formats (table, JSON, CSV)
|
|
34
|
+
- Shell completions (bash, zsh)
|
|
35
|
+
- Comprehensive documentation
|
|
36
|
+
|
|
37
|
+
[Unreleased]: https://github.com/mattmck/huntr-cli/compare/v1.0.0...HEAD
|
|
38
|
+
[1.0.0]: https://github.com/mattmck/huntr-cli/releases/tag/v1.0.0
|