@ishaan812/devlog 0.0.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.
- package/README.md +497 -0
- package/bin/devlog-wrapper.js +31 -0
- package/install.js +92 -0
- package/package.json +45 -0
package/README.md
ADDED
|
@@ -0,0 +1,497 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
_ _
|
|
5
|
+
__| | _____ _| | ___ __ _
|
|
6
|
+
/ _` |/ _ \ \ / / |/ _ \ / _` |
|
|
7
|
+
| (_| | __/\ V /| | (_) | (_| |
|
|
8
|
+
\__,_|\___| \_/ |_|\___/ \__, |
|
|
9
|
+
|___/
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
### Stop forgetting what you shipped.
|
|
13
|
+
|
|
14
|
+
Open-source, local-first AI work logging for developers who juggle<br>too many repos, too many branches, and too many standups.
|
|
15
|
+
|
|
16
|
+
[](LICENSE)
|
|
17
|
+
[](https://go.dev)
|
|
18
|
+
[](https://github.com/ishaan812/devlog)
|
|
19
|
+
[](https://www.npmjs.com/package/@ishaan812/devlog)
|
|
20
|
+
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
You ship code across 5 repos, 12 branches, and 3 teams. Monday morning standup hits and you're scrolling through `git log` trying to remember what you did last Thursday.
|
|
24
|
+
|
|
25
|
+
**DevLog fixes that.** It ingests your git history across every repo and branch you work on, and turns it into smart, structured work logs — automatically. No more "I think I worked on the auth thing?" Ask DevLog and get an answer in seconds.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
### The 30-second pitch
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm install -g @ishaan812/devlog # Install
|
|
33
|
+
devlog onboard # Set up (works with free local Ollama)
|
|
34
|
+
devlog ingest # Point it at your repos
|
|
35
|
+
devlog worklog --days 7 # Get your week's work, organized by branch
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
That's it. Professional markdown work logs, generated from your actual commits. Multi-repo, multi-branch, zero effort.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Why Developers Love DevLog
|
|
43
|
+
|
|
44
|
+
### You context-switch constantly
|
|
45
|
+
You're on `feature/payments` in the morning, hotfixing `prod` after lunch, reviewing PRs on a backend service, then back to payments. DevLog tracks all of it — across repos and branches — so you don't have to.
|
|
46
|
+
|
|
47
|
+
### Your standups are painful
|
|
48
|
+
"What did I do yesterday?" shouldn't require 10 minutes of archaeology through git logs in 4 different terminals. DevLog generates a clean, branch-organized summary in one command.
|
|
49
|
+
|
|
50
|
+
### You work across multiple repos
|
|
51
|
+
Frontend, backend, shared libraries, infrastructure — DevLog ingests them all into one unified timeline. One command to see everything you shipped.
|
|
52
|
+
|
|
53
|
+
### You care about privacy (and your wallet)
|
|
54
|
+
DevLog is **local-first**. Run it with [Ollama](https://ollama.ai) and your data never leaves your machine. No subscriptions, no telemetry, no cloud dependency. Need better summaries? Plug in Anthropic, OpenAI, or OpenRouter for pennies per query.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Features
|
|
59
|
+
|
|
60
|
+
| Feature | Description |
|
|
61
|
+
|---------|-------------|
|
|
62
|
+
| **Smart Work Logs** | Auto-generated markdown summaries organized by branch, date, and repo — ready for standups, PRs, or performance reviews |
|
|
63
|
+
| **Multi-Repo Ingestion** | Ingest as many repos as you want into a single profile. See your full picture. |
|
|
64
|
+
| **Multi-Branch Tracking** | Branch-aware ingestion remembers your selections per repo. Track `main`, `develop`, and every feature branch. |
|
|
65
|
+
| **Local-First AI** | Works completely offline with Ollama. Your code and history stay on your machine. |
|
|
66
|
+
| **Cheap Cloud Fallback** | Optionally use Anthropic, OpenAI, OpenRouter, or AWS Bedrock — most queries cost fractions of a cent |
|
|
67
|
+
| **Natural Language Queries** | Ask questions about your git history in plain English |
|
|
68
|
+
| **Semantic Code Search** | Find code by describing what it does, not just grepping keywords |
|
|
69
|
+
| **Profile System** | Isolated databases for work vs. personal, or per-client contexts |
|
|
70
|
+
| **Incremental Updates** | Re-runs only process new commits. Fast even on large repos. |
|
|
71
|
+
| **Codebase Visualization** | Generate structure diagrams and collaboration graphs |
|
|
72
|
+
|
|
73
|
+
## Quick Start
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# 1. Install DevLog
|
|
77
|
+
npm install -g devlog
|
|
78
|
+
# or: go install github.com/ishaan812/devlog/cmd/devlog@latest
|
|
79
|
+
|
|
80
|
+
# 2. Run the setup wizard (picks up Ollama automatically)
|
|
81
|
+
devlog onboard
|
|
82
|
+
|
|
83
|
+
# 3. Ingest your repositories
|
|
84
|
+
devlog ingest ~/projects/frontend
|
|
85
|
+
devlog ingest ~/projects/backend
|
|
86
|
+
devlog ingest ~/projects/shared-lib
|
|
87
|
+
|
|
88
|
+
# 4. See what you actually shipped
|
|
89
|
+
devlog worklog --days 7
|
|
90
|
+
devlog ask "What did I work on this week?"
|
|
91
|
+
devlog search "error handling"
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Installation
|
|
95
|
+
|
|
96
|
+
### Using npm (Easiest)
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
npm install -g @ishaan812/devlog
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Using Go Install
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
go install github.com/ishaan812/devlog/cmd/devlog@latest
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### From Source
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
git clone https://github.com/ishaan812/devlog
|
|
112
|
+
cd devlog
|
|
113
|
+
make install
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Verify Installation
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
devlog --help
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Getting Started
|
|
123
|
+
|
|
124
|
+
### 1. Initial Setup
|
|
125
|
+
|
|
126
|
+
Run the onboarding wizard to configure your LLM provider:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
devlog onboard
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
This will:
|
|
133
|
+
- Set up your preferred LLM provider (Ollama recommended for privacy)
|
|
134
|
+
- Configure your user identity for commit tracking
|
|
135
|
+
- Create your default profile
|
|
136
|
+
|
|
137
|
+
### 2. Ingest a Repository
|
|
138
|
+
|
|
139
|
+
Navigate to your project and run:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
cd ~/projects/myapp
|
|
143
|
+
devlog ingest
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
On first run, you'll select which branches to track. DevLog remembers your selection:
|
|
147
|
+
```
|
|
148
|
+
Saved branch selection:
|
|
149
|
+
Main: main
|
|
150
|
+
Branches: main, develop, feature/auth
|
|
151
|
+
|
|
152
|
+
[Enter] Use current [m] Modify [r] Reselect all:
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### 3. Generate Work Logs
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
devlog worklog --days 7
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
One command. Every repo. Every branch. Organized and summarized:
|
|
162
|
+
|
|
163
|
+
```markdown
|
|
164
|
+
# Work Log - yourname
|
|
165
|
+
|
|
166
|
+
*Generated on February 4, 2026*
|
|
167
|
+
|
|
168
|
+
# Monday, February 3, 2026
|
|
169
|
+
|
|
170
|
+
## repo: frontend | Branch: feature/payments
|
|
171
|
+
|
|
172
|
+
### Updates
|
|
173
|
+
- Built the checkout flow with Stripe integration
|
|
174
|
+
- Added client-side form validation for card inputs
|
|
175
|
+
|
|
176
|
+
### Commits
|
|
177
|
+
- **16:45** `f8a9b0c` Add Stripe checkout component (+320/-15)
|
|
178
|
+
- **14:20** `c3d4e5f` Add card validation helpers (+95/-10)
|
|
179
|
+
|
|
180
|
+
## repo: backend | Branch: feature/auth
|
|
181
|
+
|
|
182
|
+
### Updates
|
|
183
|
+
- Implemented JWT-based authentication with refresh tokens
|
|
184
|
+
- Added role-based access control middleware
|
|
185
|
+
|
|
186
|
+
### Commits
|
|
187
|
+
- **11:30** `a1b2c3d` Add JWT authentication (+250/-30)
|
|
188
|
+
- **09:15** `d4e5f6g` Implement RBAC middleware (+180/-20)
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
That's your standup, done. Copy-paste it, email it, or drop it in Slack.
|
|
192
|
+
|
|
193
|
+
### 4. Query Your Activity
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
# Ask natural language questions
|
|
197
|
+
devlog ask "What features did I add this month?"
|
|
198
|
+
devlog ask "Show me commits related to the payment system"
|
|
199
|
+
devlog ask "Which files have I changed the most?"
|
|
200
|
+
|
|
201
|
+
# Semantic code search
|
|
202
|
+
devlog search "database connection pooling"
|
|
203
|
+
devlog search "user authentication flow"
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## Commands Reference
|
|
207
|
+
|
|
208
|
+
### `devlog ingest`
|
|
209
|
+
|
|
210
|
+
Ingest git history and index your codebase for search.
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
devlog ingest # Current directory
|
|
214
|
+
devlog ingest ~/projects/myapp # Specific path
|
|
215
|
+
devlog ingest --days 90 # Last 90 days (default: 30)
|
|
216
|
+
devlog ingest --all # Full git history
|
|
217
|
+
devlog ingest --git-only # Skip codebase indexing
|
|
218
|
+
devlog ingest --index-only # Skip git history
|
|
219
|
+
devlog ingest --reselect-branches # Re-select branches
|
|
220
|
+
devlog ingest --all-branches # Ingest all branches
|
|
221
|
+
devlog ingest --fill-summaries # Generate missing commit summaries
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### `devlog ask`
|
|
225
|
+
|
|
226
|
+
Query your development activity using natural language.
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
devlog ask "What did I work on this week?"
|
|
230
|
+
devlog ask "Show commits about authentication"
|
|
231
|
+
devlog ask "Which files changed the most in January?"
|
|
232
|
+
devlog ask --provider anthropic "Summarize my recent work"
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### `devlog search`
|
|
236
|
+
|
|
237
|
+
Semantic search across your indexed codebase.
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
devlog search "authentication logic"
|
|
241
|
+
devlog search "database queries"
|
|
242
|
+
devlog search -n 20 "error handling" # More results
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### `devlog worklog`
|
|
246
|
+
|
|
247
|
+
Generate formatted work logs from your commit history.
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
devlog worklog # Default: last 7 days
|
|
251
|
+
devlog worklog --days 30 # Last 30 days
|
|
252
|
+
devlog worklog -o report.md # Custom output file
|
|
253
|
+
devlog worklog --no-llm # Skip AI summaries
|
|
254
|
+
devlog worklog --group-by date # Group by date instead of branch
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### `devlog profile`
|
|
258
|
+
|
|
259
|
+
Manage isolated profiles for different work contexts.
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
devlog profile # Show current profile
|
|
263
|
+
devlog profile list # List all profiles
|
|
264
|
+
devlog profile create work "Work projects"
|
|
265
|
+
devlog profile use work # Switch profiles
|
|
266
|
+
devlog profile repos # List repos in profile
|
|
267
|
+
devlog profile delete old # Delete a profile
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
Use a profile temporarily:
|
|
271
|
+
```bash
|
|
272
|
+
devlog --profile work ingest ~/work/project
|
|
273
|
+
devlog --profile personal ask "What did I do this weekend?"
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### `devlog graph`
|
|
277
|
+
|
|
278
|
+
Visualize your codebase structure.
|
|
279
|
+
|
|
280
|
+
```bash
|
|
281
|
+
devlog graph # Folder structure
|
|
282
|
+
devlog graph --type commits # Commit activity
|
|
283
|
+
devlog graph --type files # File change heatmap
|
|
284
|
+
devlog graph --type collab # Developer collaboration
|
|
285
|
+
devlog graph -o diagram.md # Export as Mermaid markdown
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
### `devlog list`
|
|
289
|
+
|
|
290
|
+
List profiles and repositories.
|
|
291
|
+
|
|
292
|
+
```bash
|
|
293
|
+
devlog list # All profiles with stats
|
|
294
|
+
devlog list repos # Repos in current profile
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
### `devlog clear`
|
|
298
|
+
|
|
299
|
+
Clear database data for the current profile.
|
|
300
|
+
|
|
301
|
+
```bash
|
|
302
|
+
devlog clear # Interactive confirmation
|
|
303
|
+
devlog clear --force # Skip confirmation
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
## LLM Providers — Use What You Already Have
|
|
307
|
+
|
|
308
|
+
DevLog doesn't lock you into an expensive API. Start free and local, upgrade if you want.
|
|
309
|
+
|
|
310
|
+
| Provider | Privacy | Cost | Best For |
|
|
311
|
+
|----------|---------|------|----------|
|
|
312
|
+
| **Ollama** | 🟢 Fully local | Free | Default. Your data never leaves your machine. |
|
|
313
|
+
| **OpenRouter** | 🟡 Cloud | ~$0.001/query | Cheap access to dozens of models |
|
|
314
|
+
| **Anthropic** | 🟡 Cloud | Paid | Best quality summaries |
|
|
315
|
+
| **OpenAI** | 🟡 Cloud | Paid | Wide model selection |
|
|
316
|
+
| **Bedrock** | 🟡 Cloud | Paid | AWS-integrated workflows |
|
|
317
|
+
|
|
318
|
+
### Setting Up Ollama (Recommended — Free & Private)
|
|
319
|
+
|
|
320
|
+
```bash
|
|
321
|
+
# 1. Install Ollama (ollama.ai)
|
|
322
|
+
# 2. Pull a model
|
|
323
|
+
ollama pull llama3.2
|
|
324
|
+
|
|
325
|
+
# 3. Start the server
|
|
326
|
+
ollama serve
|
|
327
|
+
|
|
328
|
+
# 4. DevLog will detect it automatically
|
|
329
|
+
devlog onboard
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
No API keys. No accounts. No usage limits. Just your machine.
|
|
333
|
+
|
|
334
|
+
### Using Cloud Providers
|
|
335
|
+
|
|
336
|
+
Set your API key during onboarding or in `~/.devlog/config.json`:
|
|
337
|
+
|
|
338
|
+
```json
|
|
339
|
+
{
|
|
340
|
+
"default_provider": "anthropic",
|
|
341
|
+
"anthropic_api_key": "sk-ant-..."
|
|
342
|
+
}
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
Or use environment variables:
|
|
346
|
+
```bash
|
|
347
|
+
export ANTHROPIC_API_KEY="sk-ant-..."
|
|
348
|
+
export OPENAI_API_KEY="sk-..."
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
## Configuration
|
|
352
|
+
|
|
353
|
+
DevLog stores all data in `~/.devlog/`:
|
|
354
|
+
|
|
355
|
+
```
|
|
356
|
+
~/.devlog/
|
|
357
|
+
├── config.json # Settings, profiles, API keys
|
|
358
|
+
└── profiles/
|
|
359
|
+
├── default/
|
|
360
|
+
│ └── devlog.db # SQLite database
|
|
361
|
+
└── work/
|
|
362
|
+
└── devlog.db
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
### Config Options
|
|
366
|
+
|
|
367
|
+
| Setting | Description | Default |
|
|
368
|
+
|---------|-------------|---------|
|
|
369
|
+
| `default_provider` | LLM provider | `ollama` |
|
|
370
|
+
| `ollama_model` | Model for Ollama | `llama3.2` |
|
|
371
|
+
| `ollama_base_url` | Ollama server URL | `http://localhost:11434` |
|
|
372
|
+
| `user_email` | Your git email | Auto-detected |
|
|
373
|
+
| `github_username` | GitHub username | Optional |
|
|
374
|
+
|
|
375
|
+
## Tips & Tricks
|
|
376
|
+
|
|
377
|
+
### Faster Ingestion
|
|
378
|
+
|
|
379
|
+
Skip AI summaries for quick ingestion:
|
|
380
|
+
```bash
|
|
381
|
+
devlog ingest --skip-summaries --skip-commit-summaries
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
### Generate Summaries Later
|
|
385
|
+
|
|
386
|
+
Fill in missing summaries after fast ingestion:
|
|
387
|
+
```bash
|
|
388
|
+
devlog ingest --fill-summaries
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
### Multiple Repos, One Timeline
|
|
392
|
+
|
|
393
|
+
Ingest every repo you touch — DevLog unifies them:
|
|
394
|
+
```bash
|
|
395
|
+
devlog ingest ~/projects/frontend
|
|
396
|
+
devlog ingest ~/projects/backend
|
|
397
|
+
devlog ingest ~/projects/shared-lib
|
|
398
|
+
devlog worklog --days 7 # See everything in one report
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
### Work vs Personal — Completely Isolated
|
|
402
|
+
|
|
403
|
+
Profiles give you separate databases. No bleed between contexts:
|
|
404
|
+
```bash
|
|
405
|
+
devlog profile create work "Work projects"
|
|
406
|
+
devlog profile use work
|
|
407
|
+
devlog ingest ~/work/project1
|
|
408
|
+
|
|
409
|
+
devlog profile use default # Back to personal
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
## Shell Completion
|
|
413
|
+
|
|
414
|
+
Enable tab completion for your shell:
|
|
415
|
+
|
|
416
|
+
```bash
|
|
417
|
+
# Bash
|
|
418
|
+
devlog completion bash > /etc/bash_completion.d/devlog
|
|
419
|
+
|
|
420
|
+
# Zsh
|
|
421
|
+
devlog completion zsh > "${fpath[1]}/_devlog"
|
|
422
|
+
|
|
423
|
+
# Fish
|
|
424
|
+
devlog completion fish > ~/.config/fish/completions/devlog.fish
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
## Development
|
|
428
|
+
|
|
429
|
+
```bash
|
|
430
|
+
# Clone the repo
|
|
431
|
+
git clone https://github.com/ishaan812/devlog
|
|
432
|
+
cd devlog
|
|
433
|
+
|
|
434
|
+
# Build
|
|
435
|
+
make build
|
|
436
|
+
|
|
437
|
+
# Run tests
|
|
438
|
+
make test
|
|
439
|
+
|
|
440
|
+
# Install locally
|
|
441
|
+
make install
|
|
442
|
+
|
|
443
|
+
# Run development commands
|
|
444
|
+
make run-ingest
|
|
445
|
+
make run-ask
|
|
446
|
+
make run-worklog
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
## Documentation
|
|
450
|
+
|
|
451
|
+
- [Quick Start Guide](guides/quickstart.md)
|
|
452
|
+
- [LLM Provider Setup](guides/providers.md)
|
|
453
|
+
- [Ollama Setup Guide](guides/ollama-setup.md)
|
|
454
|
+
|
|
455
|
+
## Troubleshooting
|
|
456
|
+
|
|
457
|
+
### "No commits found"
|
|
458
|
+
Make sure you've run `devlog ingest` first:
|
|
459
|
+
```bash
|
|
460
|
+
devlog ingest
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
### "LLM not available"
|
|
464
|
+
Check your provider is configured:
|
|
465
|
+
```bash
|
|
466
|
+
devlog onboard # Re-run setup
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
For Ollama, ensure the server is running:
|
|
470
|
+
```bash
|
|
471
|
+
ollama serve
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
### Slow ingestion
|
|
475
|
+
Skip AI summaries for faster initial ingestion:
|
|
476
|
+
```bash
|
|
477
|
+
devlog ingest --skip-summaries
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
## Who Is This For?
|
|
481
|
+
|
|
482
|
+
- **Individual developers** who work across multiple repos and branches and need clean work logs for standups, weekly reports, or performance reviews
|
|
483
|
+
- **Freelancers & contractors** who bill by the hour and need to show clients what was delivered
|
|
484
|
+
- **Open source maintainers** who want to generate changelogs and activity summaries
|
|
485
|
+
- **Anyone tired of `git log --oneline | head -50`** as a standup prep strategy
|
|
486
|
+
|
|
487
|
+
## Contributing
|
|
488
|
+
|
|
489
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
490
|
+
|
|
491
|
+
## License
|
|
492
|
+
|
|
493
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
|
494
|
+
|
|
495
|
+
---
|
|
496
|
+
|
|
497
|
+
**Built for developers who ship faster than they can remember.** Star the repo if DevLog saves your next standup.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { execFileSync } = require("child_process");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
const fs = require("fs");
|
|
6
|
+
|
|
7
|
+
const isWindows = process.platform === "win32";
|
|
8
|
+
const binaryName = isWindows ? "devlog.exe" : "devlog";
|
|
9
|
+
const binaryPath = path.join(__dirname, binaryName);
|
|
10
|
+
|
|
11
|
+
if (!fs.existsSync(binaryPath)) {
|
|
12
|
+
console.error(
|
|
13
|
+
"Error: devlog binary not found. Try reinstalling:\n" +
|
|
14
|
+
" npm install -g @ishaan812/devlog\n" +
|
|
15
|
+
"\nOr install via Go:\n" +
|
|
16
|
+
" go install github.com/ishaan812/devlog/cmd/devlog@latest"
|
|
17
|
+
);
|
|
18
|
+
process.exit(1);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
try {
|
|
22
|
+
const result = execFileSync(binaryPath, process.argv.slice(2), {
|
|
23
|
+
stdio: "inherit",
|
|
24
|
+
env: process.env,
|
|
25
|
+
});
|
|
26
|
+
} catch (error) {
|
|
27
|
+
if (error.status !== null) {
|
|
28
|
+
process.exit(error.status);
|
|
29
|
+
}
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
package/install.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const https = require('https');
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
const { execSync } = require('child_process');
|
|
7
|
+
|
|
8
|
+
const VERSION = require('./package.json').version;
|
|
9
|
+
|
|
10
|
+
// Map Node.js platform/arch to Go build names
|
|
11
|
+
const PLATFORM_MAP = {
|
|
12
|
+
'darwin-x64': 'darwin-amd64',
|
|
13
|
+
'darwin-arm64': 'darwin-arm64',
|
|
14
|
+
'linux-x64': 'linux-amd64',
|
|
15
|
+
'linux-arm64': 'linux-arm64',
|
|
16
|
+
'win32-x64': 'windows-amd64'
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
function getPlatform() {
|
|
20
|
+
const platform = process.platform;
|
|
21
|
+
const arch = process.arch;
|
|
22
|
+
const key = `${platform}-${arch}`;
|
|
23
|
+
|
|
24
|
+
const goPlatform = PLATFORM_MAP[key];
|
|
25
|
+
if (!goPlatform) {
|
|
26
|
+
throw new Error(`Unsupported platform: ${platform}-${arch}`);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return goPlatform;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function download(url, dest) {
|
|
33
|
+
return new Promise((resolve, reject) => {
|
|
34
|
+
console.log(`Downloading devlog binary from ${url}...`);
|
|
35
|
+
|
|
36
|
+
const file = fs.createWriteStream(dest);
|
|
37
|
+
https.get(url, (response) => {
|
|
38
|
+
if (response.statusCode === 302 || response.statusCode === 301) {
|
|
39
|
+
// Follow redirect
|
|
40
|
+
return download(response.headers.location, dest).then(resolve).catch(reject);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (response.statusCode !== 200) {
|
|
44
|
+
reject(new Error(`Failed to download: ${response.statusCode}`));
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
response.pipe(file);
|
|
49
|
+
file.on('finish', () => {
|
|
50
|
+
file.close();
|
|
51
|
+
resolve();
|
|
52
|
+
});
|
|
53
|
+
}).on('error', (err) => {
|
|
54
|
+
fs.unlink(dest, () => {});
|
|
55
|
+
reject(err);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async function install() {
|
|
61
|
+
try {
|
|
62
|
+
const platform = getPlatform();
|
|
63
|
+
const isWindows = platform.includes('windows');
|
|
64
|
+
const binaryName = isWindows ? 'devlog.exe' : 'devlog';
|
|
65
|
+
const binDir = path.join(__dirname, 'bin');
|
|
66
|
+
const binaryPath = path.join(binDir, binaryName);
|
|
67
|
+
|
|
68
|
+
// Create bin directory if it doesn't exist
|
|
69
|
+
if (!fs.existsSync(binDir)) {
|
|
70
|
+
fs.mkdirSync(binDir, { recursive: true });
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Download URL - adjust this based on where you host binaries
|
|
74
|
+
const downloadUrl = `https://github.com/ishaan812/devlog/releases/download/v${VERSION}/devlog-${platform}${isWindows ? '.exe' : ''}`;
|
|
75
|
+
|
|
76
|
+
await download(downloadUrl, binaryPath);
|
|
77
|
+
|
|
78
|
+
// Make executable on Unix systems
|
|
79
|
+
if (!isWindows) {
|
|
80
|
+
fs.chmodSync(binaryPath, 0o755);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
console.log('✓ devlog installed successfully!');
|
|
84
|
+
} catch (error) {
|
|
85
|
+
console.error('Failed to install devlog:', error.message);
|
|
86
|
+
console.error('\nYou can install devlog using Go instead:');
|
|
87
|
+
console.error(' go install github.com/ishaan812/devlog/cmd/devlog@latest');
|
|
88
|
+
process.exit(1);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
install();
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ishaan812/devlog",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "AI-powered development activity tracker and code intelligence tool. Local-first work logging for developers who juggle too many repos.",
|
|
5
|
+
"bin": {
|
|
6
|
+
"devlog": "./bin/devlog-wrapper.js"
|
|
7
|
+
},
|
|
8
|
+
"scripts": {
|
|
9
|
+
"postinstall": "node install.js"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/ishaan812/devlog.git"
|
|
14
|
+
},
|
|
15
|
+
"homepage": "https://github.com/ishaan812/devlog#readme",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/ishaan812/devlog/issues"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"git",
|
|
21
|
+
"cli",
|
|
22
|
+
"devlog",
|
|
23
|
+
"developer-tools",
|
|
24
|
+
"activity-tracker",
|
|
25
|
+
"work-log",
|
|
26
|
+
"standup",
|
|
27
|
+
"ai",
|
|
28
|
+
"llm",
|
|
29
|
+
"ollama",
|
|
30
|
+
"productivity"
|
|
31
|
+
],
|
|
32
|
+
"author": "ishaan812",
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"files": [
|
|
35
|
+
"bin/devlog-wrapper.js",
|
|
36
|
+
"install.js",
|
|
37
|
+
"README.md"
|
|
38
|
+
],
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=14"
|
|
41
|
+
},
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
44
|
+
}
|
|
45
|
+
}
|