clocktopus 1.0.1 → 1.0.2
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 +172 -197
- package/dist/index.js +49 -1
- package/dist/lib/atlassian.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -4,294 +4,269 @@
|
|
|
4
4
|
<img src="assets/logo.png" alt="Clocktopus Logo" width="300px" />
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
CLI-based time-tracking automation for Clockify with idle monitoring, Jira integration, Google Calendar sync, and a web dashboard.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## Quick Start (Dashboard User)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Most users only need the dashboard — a web UI to manage timers, connect integrations, and monitor idle time.
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
- **Jira Integration:** Seamlessly link your time entries to Jira tickets, fetching and prepending ticket titles to descriptions.
|
|
15
|
-
- **Google Calendar Integration:** Log your Google Calendar events directly as Clockify time entries, with intelligent project caching for recurring events.
|
|
16
|
-
- **Local Project Filtering:** Curate a personalized list of projects for quick selection, reducing clutter.
|
|
17
|
-
- **Session Management:** Start, stop, and check the status of your time entries directly from the terminal.
|
|
18
|
-
- **Database Cleanup:** Easily manage and clean up old session logs from the local SQLite database.
|
|
13
|
+
### Install
|
|
19
14
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
1. **Clone the repository:**
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
git clone <repository_url>
|
|
28
|
-
cd clocktopus
|
|
29
|
-
```
|
|
15
|
+
```bash
|
|
16
|
+
npm i -g clocktopus
|
|
17
|
+
```
|
|
30
18
|
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
bun install
|
|
34
|
-
```
|
|
19
|
+
Requires [Bun](https://bun.sh) runtime:
|
|
35
20
|
|
|
36
|
-
|
|
21
|
+
```bash
|
|
22
|
+
curl -fsSL https://bun.sh/install | bash
|
|
23
|
+
```
|
|
37
24
|
|
|
38
|
-
###
|
|
25
|
+
### Run
|
|
39
26
|
|
|
40
|
-
|
|
27
|
+
```bash
|
|
28
|
+
# Start dashboard in foreground
|
|
29
|
+
clocktopus dash
|
|
41
30
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
ATLASSIAN_CLIENT_ID="your_atlassian_oauth_client_id"
|
|
45
|
-
ATLASSIAN_CLIENT_SECRET="your_atlassian_oauth_client_secret"
|
|
46
|
-
GOOGLE_CLIENT_ID="google_client_id"
|
|
47
|
-
GOOGLE_CLIENT_SECRET="google_client_secret"
|
|
31
|
+
# Or as a background daemon
|
|
32
|
+
clocktopus serve
|
|
48
33
|
```
|
|
49
34
|
|
|
50
|
-
|
|
35
|
+
Open [http://localhost:4001](http://localhost:4001) in your browser.
|
|
51
36
|
|
|
52
|
-
###
|
|
37
|
+
### Setup
|
|
53
38
|
|
|
54
|
-
|
|
39
|
+
1. Go to **Settings** tab
|
|
40
|
+
2. Enter your **Clockify API key** ([get one here](https://app.clockify.me/manage-api-keys))
|
|
41
|
+
3. Click **Pull from Clockify** in the Projects tab
|
|
42
|
+
4. Optionally connect **Jira** and **Google Calendar** with one click
|
|
55
43
|
|
|
56
|
-
|
|
44
|
+
That's it. Start/stop timers from the Home tab.
|
|
57
45
|
|
|
58
|
-
|
|
59
|
-
2. Under **Authorization**, set the callback URL to:
|
|
60
|
-
```
|
|
61
|
-
http://localhost:4001/api/jira/callback
|
|
62
|
-
```
|
|
63
|
-
3. Under **Permissions**, add the following scopes:
|
|
64
|
-
- **Jira API**: `read:jira-work`, `write:jira-work`
|
|
65
|
-
- **User identity API**: `read:me`
|
|
66
|
-
4. Copy the **Client ID** and **Client Secret** from the app's **Settings** page
|
|
67
|
-
5. Add them to your `.env` file as `ATLASSIAN_CLIENT_ID` and `ATLASSIAN_CLIENT_SECRET`
|
|
68
|
-
6. Start the dashboard (`bun run dashboard`) and click **Connect Atlassian**
|
|
46
|
+
### Dashboard Commands
|
|
69
47
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
> ```
|
|
48
|
+
| Command | Description |
|
|
49
|
+
| ----------------------- | ------------------------------------ |
|
|
50
|
+
| `clocktopus dash` | Start dashboard (foreground) |
|
|
51
|
+
| `clocktopus serve` | Start dashboard as background daemon |
|
|
52
|
+
| `clocktopus serve:stop` | Stop the dashboard daemon |
|
|
53
|
+
| `clocktopus serve:logs` | View dashboard daemon logs |
|
|
77
54
|
|
|
78
|
-
###
|
|
55
|
+
### Desktop App
|
|
79
56
|
|
|
80
|
-
|
|
57
|
+
A macOS menu bar app is available — see [desktop/README.md](desktop/README.md) for setup. It wraps the dashboard with a system tray icon that shows timer status.
|
|
81
58
|
|
|
82
|
-
|
|
59
|
+
---
|
|
83
60
|
|
|
84
|
-
|
|
85
|
-
[
|
|
86
|
-
{
|
|
87
|
-
"id": "671b783fbd91bc5e5ddcb944",
|
|
88
|
-
"name": "2024 Project Management Traineeship"
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
"id": "another_project_id",
|
|
92
|
-
"name": "Another Project Name"
|
|
93
|
-
}
|
|
94
|
-
]
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
Remove any project objects (both `id` and `name`) that you don't want to appear in the project selection list.
|
|
98
|
-
|
|
99
|
-
## Usage
|
|
61
|
+
## Power User Guide
|
|
100
62
|
|
|
101
|
-
|
|
63
|
+
For CLI-based workflows, scripting, and advanced features.
|
|
102
64
|
|
|
103
|
-
|
|
65
|
+
### Install from Source
|
|
104
66
|
|
|
105
67
|
```bash
|
|
68
|
+
git clone https://github.com/sajxraj/clocktopus.git
|
|
69
|
+
cd clocktopus
|
|
70
|
+
bun install
|
|
106
71
|
bun run build
|
|
107
72
|
```
|
|
108
73
|
|
|
109
|
-
###
|
|
74
|
+
### Local Development
|
|
110
75
|
|
|
111
|
-
|
|
76
|
+
When running from source, use `bun run clock` instead of `clocktopus`:
|
|
112
77
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
bun run monitor
|
|
117
|
-
```
|
|
78
|
+
```bash
|
|
79
|
+
# Build first
|
|
80
|
+
bun run build
|
|
118
81
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
- When you become active again (move the mouse, press a key, etc.), if your last session was auto-completed due to idleness, a new timer will automatically be created for the last used project.
|
|
122
|
-
- All session events (start, stop, auto-complete, resume) are logged locally in the SQLite database, including project and description.
|
|
82
|
+
# Dashboard
|
|
83
|
+
bun run dashboard # Start dashboard (foreground)
|
|
123
84
|
|
|
124
|
-
|
|
85
|
+
# Timer
|
|
86
|
+
bun run clock start "Task" # Start a timer
|
|
87
|
+
bun run clock start -j PROJ-1 # Start with Jira ticket
|
|
88
|
+
bun run clock stop # Stop timer
|
|
89
|
+
bun run clock status # Check timer status
|
|
125
90
|
|
|
126
|
-
|
|
127
|
-
|
|
91
|
+
# Monitor
|
|
92
|
+
bun run monitor # Start idle monitor (PM2 daemon)
|
|
93
|
+
bun run monitor:stop # Stop monitor
|
|
94
|
+
bun run monitor:restart # Restart monitor
|
|
95
|
+
bun run monitor:status # Check monitor status
|
|
96
|
+
bun run monitor:logs # View monitor logs
|
|
128
97
|
|
|
129
|
-
|
|
98
|
+
# Google Calendar
|
|
99
|
+
bun run google-auth # Authenticate Google account
|
|
100
|
+
bun run log-calendar -t # Log today's events
|
|
130
101
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
102
|
+
# Database
|
|
103
|
+
bun run db:cleanup # Clean old session logs
|
|
104
|
+
```
|
|
134
105
|
|
|
135
|
-
|
|
106
|
+
### CLI Commands
|
|
136
107
|
|
|
137
|
-
|
|
108
|
+
#### Timer Management
|
|
138
109
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
110
|
+
```bash
|
|
111
|
+
# Start a timer (interactive project selection)
|
|
112
|
+
clocktopus start "Task description"
|
|
142
113
|
|
|
143
|
-
|
|
114
|
+
# Start with a Jira ticket (auto-fetches ticket title)
|
|
115
|
+
clocktopus start -j TICKET-123
|
|
144
116
|
|
|
145
|
-
|
|
117
|
+
# Stop the current timer
|
|
118
|
+
clocktopus stop
|
|
146
119
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
120
|
+
# Check timer status
|
|
121
|
+
clocktopus status
|
|
122
|
+
```
|
|
150
123
|
|
|
151
|
-
|
|
152
|
-
```bash
|
|
153
|
-
bun run clock status
|
|
154
|
-
```
|
|
124
|
+
#### Idle Monitor
|
|
155
125
|
|
|
156
|
-
|
|
126
|
+
Automatically stops timers when you're idle (5 min) or lock your screen, and restarts when you're back.
|
|
157
127
|
|
|
158
|
-
|
|
128
|
+
```bash
|
|
129
|
+
# Run in foreground
|
|
130
|
+
clocktopus monitor
|
|
159
131
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
```
|
|
132
|
+
# Or manage via dashboard UI (Start/Stop/Restart buttons)
|
|
133
|
+
```
|
|
163
134
|
|
|
164
|
-
|
|
135
|
+
The dashboard's Idle Monitor buttons use PM2 under the hood:
|
|
165
136
|
|
|
166
|
-
|
|
137
|
+
| Action | What it does |
|
|
138
|
+
| ----------- | ------------------------------ |
|
|
139
|
+
| **Start** | Launches monitor as PM2 daemon |
|
|
140
|
+
| **Stop** | Stops the monitor daemon |
|
|
141
|
+
| **Restart** | Restarts after code changes |
|
|
167
142
|
|
|
168
|
-
|
|
169
|
-
bun run monitor:stop
|
|
170
|
-
```
|
|
143
|
+
#### Google Calendar Integration
|
|
171
144
|
|
|
172
|
-
|
|
145
|
+
Log Google Calendar events as Clockify time entries.
|
|
173
146
|
|
|
174
|
-
|
|
147
|
+
```bash
|
|
148
|
+
# Authenticate (one-time)
|
|
149
|
+
clocktopus google-auth
|
|
175
150
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
```
|
|
151
|
+
# Log events for a date range
|
|
152
|
+
clocktopus log-calendar -s 2025-07-21 -e 2025-07-22
|
|
179
153
|
|
|
180
|
-
|
|
154
|
+
# Log today's events
|
|
155
|
+
clocktopus log-calendar -t
|
|
156
|
+
```
|
|
181
157
|
|
|
182
|
-
|
|
158
|
+
For each event, you'll be prompted to select a Clockify project. Selections are cached by event name for recurring meetings.
|
|
183
159
|
|
|
184
|
-
|
|
160
|
+
#### Database Cleanup
|
|
185
161
|
|
|
186
162
|
```bash
|
|
187
|
-
|
|
188
|
-
|
|
163
|
+
# Delete session logs older than 5 days (default)
|
|
164
|
+
clocktopus db:cleanup
|
|
189
165
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
166
|
+
# Delete logs older than N days
|
|
167
|
+
clocktopus db:cleanup 10
|
|
168
|
+
```
|
|
193
169
|
|
|
194
|
-
|
|
170
|
+
### Configuration
|
|
195
171
|
|
|
196
|
-
|
|
197
|
-
bun run db:cleanup
|
|
198
|
-
```
|
|
172
|
+
All configuration is stored in a local SQLite database (`data/sessions.db`) and managed through the dashboard Settings tab. No `.env` file is needed.
|
|
199
173
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
174
|
+
| Setting | How to configure |
|
|
175
|
+
| ---------------- | ------------------------------------------------ |
|
|
176
|
+
| Clockify API Key | Dashboard > Settings > Clockify |
|
|
177
|
+
| Jira (OAuth) | Dashboard > Settings > Click "Connect Atlassian" |
|
|
178
|
+
| Jira (API token) | Dashboard > Settings > "or use API token" |
|
|
179
|
+
| Google Calendar | Dashboard > Settings > Click "Connect Google" |
|
|
204
180
|
|
|
205
|
-
|
|
181
|
+
#### OAuth Architecture
|
|
206
182
|
|
|
207
|
-
|
|
183
|
+
- **Jira**: OAuth tokens are exchanged through a [Cloudflare Worker proxy](docs/atlassian-proxy-flow.md) that holds the client secret securely. Users just click Connect.
|
|
184
|
+
- **Google**: Uses a Desktop-type OAuth client. Credentials are handled transparently.
|
|
185
|
+
- **Clockify**: Each user provides their own API key.
|
|
208
186
|
|
|
209
|
-
####
|
|
187
|
+
#### Environment Variables (Optional Override)
|
|
210
188
|
|
|
211
|
-
|
|
189
|
+
Power users can override credentials via environment variables or a `.env` file:
|
|
212
190
|
|
|
213
|
-
```
|
|
214
|
-
|
|
191
|
+
```
|
|
192
|
+
CLOCKIFY_API_KEY="your_key"
|
|
193
|
+
ATLASSIAN_CLIENT_ID="your_id"
|
|
194
|
+
ATLASSIAN_CLIENT_SECRET="your_secret"
|
|
195
|
+
GOOGLE_CLIENT_ID="your_id"
|
|
196
|
+
GOOGLE_CLIENT_SECRET="your_secret"
|
|
215
197
|
```
|
|
216
198
|
|
|
217
|
-
|
|
199
|
+
The app checks the database first, then falls back to environment variables.
|
|
218
200
|
|
|
219
|
-
|
|
201
|
+
### Local Project Filtering (CLI only)
|
|
220
202
|
|
|
221
|
-
|
|
203
|
+
On first `clocktopus start`, all projects are saved to `data/local-projects.json`. Edit this file to keep only your frequently used projects:
|
|
222
204
|
|
|
223
|
-
```
|
|
224
|
-
|
|
205
|
+
```json
|
|
206
|
+
[
|
|
207
|
+
{ "id": "671b783fbd91bc5e5ddcb944", "name": "Project A" },
|
|
208
|
+
{ "id": "another_id", "name": "Project B" }
|
|
209
|
+
]
|
|
225
210
|
```
|
|
226
211
|
|
|
227
|
-
|
|
228
|
-
- `<end-date>`: The end date for fetching calendar events (e.g., `2025-07-22`).
|
|
212
|
+
### Shell Aliases
|
|
229
213
|
|
|
230
|
-
|
|
214
|
+
For quick access, add to `~/.zshrc`:
|
|
231
215
|
|
|
232
216
|
```bash
|
|
233
|
-
|
|
234
|
-
```
|
|
235
|
-
|
|
236
|
-
For each calendar event, the tool will prompt you to select a Clockify project. Your selection will be cached based on the event's summary (name), so if you have recurring events with the same name, you will only be asked once for the project. If you provide a `project-id` using the `-p` flag, all events will be logged to that project without prompting.
|
|
217
|
+
CLOCKTOPUS_PATH="$HOME/Projects/Personal/clocktopus"
|
|
237
218
|
|
|
238
|
-
|
|
219
|
+
clocktopus() {
|
|
220
|
+
cd "$CLOCKTOPUS_PATH" || return
|
|
221
|
+
bun run "$@"
|
|
222
|
+
}
|
|
239
223
|
|
|
240
|
-
|
|
241
|
-
|
|
224
|
+
alias cbuild="clocktopus build"
|
|
225
|
+
alias cstart="clocktopus clock start"
|
|
226
|
+
alias cstop="clocktopus clock stop"
|
|
227
|
+
alias mstart="clocktopus monitor"
|
|
228
|
+
alias mstop="clocktopus monitor:stop"
|
|
229
|
+
alias mrestart="clocktopus monitor:restart"
|
|
230
|
+
alias mlogs="clocktopus monitor:logs"
|
|
242
231
|
```
|
|
243
232
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
```bash
|
|
247
|
-
bun run log-calendar -s 2025-07-21 -e 2025-07-22 -p your_clockify_project_id
|
|
248
|
-
```
|
|
233
|
+
---
|
|
249
234
|
|
|
250
235
|
## Troubleshooting
|
|
251
236
|
|
|
252
237
|
### No notifications on macOS
|
|
253
238
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
- **Check System Settings for Notifications:**
|
|
257
|
-
- Go to **System Settings > Notifications**.
|
|
258
|
-
- Look for **Terminal** (or your specific terminal application if you use another one like iTerm).
|
|
259
|
-
- Make sure that **Allow Notifications** is turned on for it.
|
|
260
|
-
- If you see an entry for **Node**, ensure it also has permissions.
|
|
239
|
+
Go to **System Settings > Notifications** and ensure **terminal-notifier** (or your terminal app) has notifications enabled.
|
|
261
240
|
|
|
262
|
-
|
|
241
|
+
### Monitor not detecting display off
|
|
263
242
|
|
|
264
|
-
|
|
243
|
+
The idle monitor detects screen lock and system idle (5 min). If your Mac's display turns off without locking, enable **Require password immediately** in System Settings > Lock Screen.
|
|
265
244
|
|
|
266
|
-
|
|
245
|
+
### Linux Requirements
|
|
267
246
|
|
|
268
|
-
```
|
|
247
|
+
```bash
|
|
269
248
|
apt install libxss-dev pkg-config build-essential
|
|
270
249
|
```
|
|
271
250
|
|
|
272
|
-
|
|
251
|
+
---
|
|
273
252
|
|
|
274
|
-
|
|
253
|
+
## Project Structure
|
|
275
254
|
|
|
276
|
-
```bash
|
|
277
|
-
# Clocktopus
|
|
278
|
-
CLOCKTOPUS_PATH="$HOME/Projects/Personal/clocktopus"
|
|
279
|
-
|
|
280
|
-
clocktopus() {
|
|
281
|
-
cd "$CLOCKTOPUS_PATH" || return
|
|
282
|
-
bun run "$@"
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
alias cbuild="clocktopus build"
|
|
286
|
-
alias cstart="clocktopus clock start"
|
|
287
|
-
alias cstop="clocktopus clock stop"
|
|
288
|
-
alias mstart="clocktopus monitor"
|
|
289
|
-
alias mstop="clocktopus monitor:stop"
|
|
290
|
-
alias mrestart="clocktopus monitor:restart"
|
|
291
|
-
alias mstatus="clocktopus monitor:status"
|
|
292
|
-
alias mlogs="clocktopus monitor:logs"
|
|
293
|
-
alias cgcalauth="clocktopus google-auth"
|
|
294
|
-
alias cgcal="clocktopus log-calendar"
|
|
295
255
|
```
|
|
256
|
+
clocktopus/
|
|
257
|
+
├── index.ts # CLI entry point (Commander)
|
|
258
|
+
├── clockify.ts # Clockify API client
|
|
259
|
+
├── lib/ # Core libraries (db, auth, credentials)
|
|
260
|
+
├── dashboard/ # Web dashboard (Hono server)
|
|
261
|
+
│ ├── server.ts # Dashboard server
|
|
262
|
+
│ ├── views.ts # HTML/CSS/JS (single-page app)
|
|
263
|
+
│ └── routes/ # API routes
|
|
264
|
+
├── desktop/ # Tauri macOS menu bar app
|
|
265
|
+
├── proxy/ # Cloudflare Worker (OAuth proxy)
|
|
266
|
+
├── scripts/ # Google auth & calendar scripts
|
|
267
|
+
└── data/ # SQLite DB & config (gitignored)
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
## License
|
|
296
271
|
|
|
297
|
-
|
|
272
|
+
MIT
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
2
|
import { Command } from 'commander';
|
|
3
3
|
import inquirer from 'inquirer';
|
|
4
4
|
import chalk from 'chalk';
|
|
@@ -274,4 +274,52 @@ program
|
|
|
274
274
|
.action(() => {
|
|
275
275
|
startDashboard();
|
|
276
276
|
});
|
|
277
|
+
program
|
|
278
|
+
.command('serve')
|
|
279
|
+
.description('Start dashboard as a background daemon (PM2).')
|
|
280
|
+
.action(async () => {
|
|
281
|
+
const { execSync } = await import('child_process');
|
|
282
|
+
const bunPath = execSync('which bun', { encoding: 'utf-8' }).trim();
|
|
283
|
+
const scriptPath = path.join(__dirname, 'index.js');
|
|
284
|
+
try {
|
|
285
|
+
// Stop existing if running
|
|
286
|
+
try {
|
|
287
|
+
execSync('bunx pm2 delete clocktopus-dash', { stdio: 'ignore' });
|
|
288
|
+
}
|
|
289
|
+
catch { }
|
|
290
|
+
execSync(`bunx pm2 start ${scriptPath} --name clocktopus-dash --interpreter ${bunPath} -- dash`, {
|
|
291
|
+
stdio: 'inherit',
|
|
292
|
+
});
|
|
293
|
+
console.log(chalk.green('Dashboard running at http://localhost:4001'));
|
|
294
|
+
console.log(chalk.gray(' Stop: clocktopus serve:stop'));
|
|
295
|
+
console.log(chalk.gray(' Logs: clocktopus serve:logs'));
|
|
296
|
+
}
|
|
297
|
+
catch {
|
|
298
|
+
console.error(chalk.red('Failed to start dashboard daemon.'));
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
program
|
|
302
|
+
.command('serve:stop')
|
|
303
|
+
.description('Stop the dashboard daemon.')
|
|
304
|
+
.action(async () => {
|
|
305
|
+
const { execSync } = await import('child_process');
|
|
306
|
+
try {
|
|
307
|
+
execSync('bunx pm2 stop clocktopus-dash', { stdio: 'inherit' });
|
|
308
|
+
}
|
|
309
|
+
catch {
|
|
310
|
+
console.log(chalk.yellow('Dashboard is not running.'));
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
program
|
|
314
|
+
.command('serve:logs')
|
|
315
|
+
.description('Show dashboard daemon logs.')
|
|
316
|
+
.action(async () => {
|
|
317
|
+
const { execSync } = await import('child_process');
|
|
318
|
+
try {
|
|
319
|
+
execSync('bunx pm2 logs clocktopus-dash --lines 50', { stdio: 'inherit' });
|
|
320
|
+
}
|
|
321
|
+
catch {
|
|
322
|
+
console.log(chalk.yellow('Dashboard is not running.'));
|
|
323
|
+
}
|
|
324
|
+
});
|
|
277
325
|
program.parse(process.argv);
|
package/dist/lib/atlassian.js
CHANGED
|
@@ -2,7 +2,7 @@ import axios from 'axios';
|
|
|
2
2
|
import { resolveCredential } from './credentials.js';
|
|
3
3
|
import { getAtlassianToken, updateAtlassianAccessToken } from './db.js';
|
|
4
4
|
// Cloudflare Worker proxy that holds the client secret
|
|
5
|
-
const AUTH_PROXY_URL = 'https://clocktopus-auth.clocktopus.workers.dev
|
|
5
|
+
const AUTH_PROXY_URL = 'https://clocktopus-auth.clocktopus.workers.dev';
|
|
6
6
|
// Fallback: direct Atlassian API (when user provides their own credentials)
|
|
7
7
|
const ATLASSIAN_TOKEN_URL = 'https://auth.atlassian.com/oauth/token';
|
|
8
8
|
const ATLASSIAN_RESOURCES_URL = 'https://api.atlassian.com/oauth/token/accessible-resources';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clocktopus",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -42,7 +42,8 @@
|
|
|
42
42
|
"macos-notification-state": "^3.0.0",
|
|
43
43
|
"node-notifier": "^10.0.1",
|
|
44
44
|
"uuid": "^11.1.0",
|
|
45
|
-
"zod": "^3.25.76"
|
|
45
|
+
"zod": "^3.25.76",
|
|
46
|
+
"pm2": "^6.0.8"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
49
|
"@types/bun": "^1.3.11",
|
|
@@ -55,7 +56,6 @@
|
|
|
55
56
|
"eslint-config-prettier": "^10.1.5",
|
|
56
57
|
"eslint-plugin-prettier": "^5.5.1",
|
|
57
58
|
"husky": "^9.1.7",
|
|
58
|
-
"pm2": "^6.0.8",
|
|
59
59
|
"prettier": "^3.6.2",
|
|
60
60
|
"ts-node": "^10.9.2",
|
|
61
61
|
"typescript": "^5.8.3",
|