@knpkv/jira-clockify 0.5.0 → 1.0.0
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 +10 -10
- package/dist/package.json +1 -1
- package/dist/src/bin.js +1 -15
- package/dist/src/bin.js.map +1 -1
- package/dist/src/cli/layers.js +7 -2
- package/dist/src/cli/layers.js.map +1 -1
- package/dist/src/cli/list.js +1 -0
- package/dist/src/cli/list.js.map +1 -1
- package/dist/src/cli/reconcile.js +131 -0
- package/dist/src/cli/reconcile.js.map +1 -0
- package/dist/src/cli/root.js +25 -0
- package/dist/src/cli/root.js.map +1 -0
- package/dist/src/cli/setup.js +1 -1
- package/dist/src/cli/setup.js.map +1 -1
- package/dist/src/cli/timer/start.js +1 -1
- package/dist/src/cli/timer/start.js.map +1 -1
- package/dist/src/cli/timer/stop.js +26 -10
- package/dist/src/cli/timer/stop.js.map +1 -1
- package/dist/src/cli/timer.js +4 -0
- package/dist/src/cli/timer.js.map +1 -1
- package/dist/src/services/ReconcileService.js +0 -0
- package/dist/src/services/ReconcileService.js.map +1 -0
- package/dist/src/services/TimerService.js +45 -22
- package/dist/src/services/TimerService.js.map +1 -1
- package/dist/src/tui/App.js +41 -49
- package/dist/src/tui/App.js.map +1 -1
- package/dist/test/ReconcileService.test.js +146 -0
- package/dist/test/ReconcileService.test.js.map +1 -0
- package/dist/test/TimerService.test.js +56 -15
- package/dist/test/TimerService.test.js.map +1 -1
- package/dist/test/commandSurface.test.js +42 -0
- package/dist/test/commandSurface.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/nvim/lua/jcf/init.lua +8 -8
- package/nvim/lua/jcf/state.lua +3 -3
- package/nvim/lua/jcf/telescope.lua +3 -3
- package/package.json +4 -4
- package/skills/jcf/SKILL.md +17 -17
- package/skills/jcf/agents/openai.yaml +1 -1
package/nvim/lua/jcf/init.lua
CHANGED
|
@@ -23,25 +23,25 @@ function M.setup(opts)
|
|
|
23
23
|
key = require("jcf.branch").detect()
|
|
24
24
|
end
|
|
25
25
|
if key then
|
|
26
|
-
vim.fn.jobstart({ M.config.binary, "start", key }, { detach = true })
|
|
26
|
+
vim.fn.jobstart({ M.config.binary, "timer", "start", key }, { detach = true })
|
|
27
27
|
vim.notify("jcf: starting timer on " .. key, vim.log.levels.INFO)
|
|
28
28
|
else
|
|
29
|
-
-- No key and no branch match
|
|
30
|
-
require("jcf.float").run_command(M.config, "start")
|
|
29
|
+
-- No key and no branch match: open jcf timer start in float.
|
|
30
|
+
require("jcf.float").run_command(M.config, "timer", "start")
|
|
31
31
|
end
|
|
32
32
|
end, { nargs = "?", desc = "Start jcf timer" })
|
|
33
33
|
|
|
34
34
|
vim.api.nvim_create_user_command("JcfStop", function()
|
|
35
35
|
-- Open in float so the comment prompt is interactive
|
|
36
|
-
require("jcf.float").run_command(M.config, "stop")
|
|
36
|
+
require("jcf.float").run_command(M.config, "timer", "stop")
|
|
37
37
|
end, { desc = "Stop jcf timer" })
|
|
38
38
|
|
|
39
39
|
vim.api.nvim_create_user_command("JcfDiscard", function()
|
|
40
|
-
require("jcf.float").run_command(M.config, "discard")
|
|
40
|
+
require("jcf.float").run_command(M.config, "timer", "discard")
|
|
41
41
|
end, { desc = "Discard jcf timer (delete Clockify entry)" })
|
|
42
42
|
|
|
43
43
|
vim.api.nvim_create_user_command("JcfLog", function(args)
|
|
44
|
-
local cmd_args = { "log" }
|
|
44
|
+
local cmd_args = { "timer", "log" }
|
|
45
45
|
if args.args ~= "" then
|
|
46
46
|
for word in args.args:gmatch("%S+") do
|
|
47
47
|
table.insert(cmd_args, word)
|
|
@@ -51,11 +51,11 @@ function M.setup(opts)
|
|
|
51
51
|
end, { nargs = "*", desc = "Log past work manually" })
|
|
52
52
|
|
|
53
53
|
vim.api.nvim_create_user_command("JcfEdit", function()
|
|
54
|
-
require("jcf.float").run_command(M.config, "edit")
|
|
54
|
+
require("jcf.float").run_command(M.config, "timer", "edit")
|
|
55
55
|
end, { desc = "Edit running timer" })
|
|
56
56
|
|
|
57
57
|
vim.api.nvim_create_user_command("JcfStatus", function()
|
|
58
|
-
require("jcf.float").run_command(M.config, "status")
|
|
58
|
+
require("jcf.float").run_command(M.config, "timer", "status")
|
|
59
59
|
end, { desc = "Show timer status" })
|
|
60
60
|
|
|
61
61
|
-- Start polling for external timer changes
|
package/nvim/lua/jcf/state.lua
CHANGED
|
@@ -26,7 +26,7 @@ function M.read(state_path)
|
|
|
26
26
|
return cached
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
-
-- Periodically run `jcf status` to sync state file with Clockify
|
|
29
|
+
-- Periodically run `jcf timer status` to sync state file with Clockify
|
|
30
30
|
-- This detects externally stopped timers
|
|
31
31
|
function M.start_poll(config, interval_ms)
|
|
32
32
|
if poll_timer then
|
|
@@ -36,8 +36,8 @@ function M.start_poll(config, interval_ms)
|
|
|
36
36
|
|
|
37
37
|
poll_timer = uv.new_timer()
|
|
38
38
|
poll_timer:start(interval_ms, interval_ms, vim.schedule_wrap(function()
|
|
39
|
-
-- jcf status updates ~/.jcf/state.json and detects external stops
|
|
40
|
-
vim.fn.jobstart({ config.binary or "jcf", "status" }, {
|
|
39
|
+
-- jcf timer status updates ~/.jcf/state.json and detects external stops
|
|
40
|
+
vim.fn.jobstart({ config.binary or "jcf", "timer", "status" }, {
|
|
41
41
|
on_stdout = function() end,
|
|
42
42
|
on_stderr = function() end,
|
|
43
43
|
detach = true,
|
|
@@ -12,8 +12,8 @@ function M.pick(config)
|
|
|
12
12
|
local actions = require("telescope.actions")
|
|
13
13
|
local action_state = require("telescope.actions.state")
|
|
14
14
|
|
|
15
|
-
-- Get tickets via jcf list --json
|
|
16
|
-
local result = vim.fn.system({ config.binary, "list", "--json" })
|
|
15
|
+
-- Get tickets via jcf issue list --json
|
|
16
|
+
local result = vim.fn.system({ config.binary, "issue", "list", "--json" })
|
|
17
17
|
local tickets_ok, tickets = pcall(vim.json.decode, result)
|
|
18
18
|
if not tickets_ok or not tickets then
|
|
19
19
|
vim.notify("jcf: failed to get tickets", vim.log.levels.ERROR)
|
|
@@ -38,7 +38,7 @@ function M.pick(config)
|
|
|
38
38
|
actions.close(prompt_bufnr)
|
|
39
39
|
local selection = action_state.get_selected_entry()
|
|
40
40
|
if selection and selection.value and selection.value.key then
|
|
41
|
-
vim.fn.jobstart({ config.binary, "start", selection.value.key }, { detach = true })
|
|
41
|
+
vim.fn.jobstart({ config.binary, "timer", "start", selection.value.key }, { detach = true })
|
|
42
42
|
vim.notify("jcf: starting timer on " .. selection.value.key, vim.log.levels.INFO)
|
|
43
43
|
end
|
|
44
44
|
end)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knpkv/jira-clockify",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "TUI for Jira-Clockify time tracking, attachable to neovim",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "knpkv",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
"@opentui/react": "https://pkg.pr.new/anomalyco/opentui/@opentui/react@367a94087821b3b5feedd35bbb57df43b10a286e",
|
|
24
24
|
"effect": "4.0.0-beta.87",
|
|
25
25
|
"react": "^19.2.7",
|
|
26
|
-
"@knpkv/agent-skills": "^0.2.0",
|
|
27
26
|
"@knpkv/atlassian-common": "^0.3.0",
|
|
27
|
+
"@knpkv/clockify-api-client": "^0.3.0",
|
|
28
28
|
"@knpkv/jira-api-client": "^0.3.0",
|
|
29
|
-
"@knpkv/jira-cli": "^0.
|
|
30
|
-
"@knpkv/
|
|
29
|
+
"@knpkv/jira-cli": "^1.0.0",
|
|
30
|
+
"@knpkv/agent-skills": "^0.2.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@effect/vitest": "4.0.0-beta.87",
|
package/skills/jcf/SKILL.md
CHANGED
|
@@ -12,7 +12,7 @@ Use the `jcf` binary to manage Jira-backed Clockify timers.
|
|
|
12
12
|
- Configure both services before timer operations: Jira OAuth and Clockify API key.
|
|
13
13
|
- Use `jcf auth status` to check readiness.
|
|
14
14
|
- Timer operations write to Clockify and may write Jira worklogs; confirm ambiguous ticket keys, durations, dates, and comments before running them.
|
|
15
|
-
- Use `jcf list --json` when an agent needs structured ticket data.
|
|
15
|
+
- Use `jcf issue list --json` when an agent needs structured ticket data.
|
|
16
16
|
|
|
17
17
|
## Setup
|
|
18
18
|
|
|
@@ -46,44 +46,44 @@ jcf tui
|
|
|
46
46
|
List available Jira tickets:
|
|
47
47
|
|
|
48
48
|
```bash
|
|
49
|
-
jcf list
|
|
50
|
-
jcf list --json
|
|
49
|
+
jcf issue list
|
|
50
|
+
jcf issue list --json
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
Start work:
|
|
54
54
|
|
|
55
55
|
```bash
|
|
56
|
-
jcf start PROJ-123
|
|
57
|
-
jcf start PROJ-123 --ago 15m
|
|
58
|
-
jcf start PROJ-123 --since 09:30
|
|
59
|
-
jcf start PROJ-123 --project <clockify-project-id> --billable
|
|
56
|
+
jcf timer start PROJ-123
|
|
57
|
+
jcf timer start PROJ-123 --ago 15m
|
|
58
|
+
jcf timer start PROJ-123 --since 09:30
|
|
59
|
+
jcf timer start PROJ-123 --project <clockify-project-id> --billable
|
|
60
60
|
```
|
|
61
61
|
|
|
62
62
|
Stop or discard current work:
|
|
63
63
|
|
|
64
64
|
```bash
|
|
65
|
-
jcf status
|
|
66
|
-
jcf stop
|
|
67
|
-
jcf stop --project <clockify-project-id> --billable
|
|
68
|
-
jcf discard
|
|
65
|
+
jcf timer status
|
|
66
|
+
jcf timer stop
|
|
67
|
+
jcf timer stop --project <clockify-project-id> --billable
|
|
68
|
+
jcf timer discard
|
|
69
69
|
```
|
|
70
70
|
|
|
71
71
|
Log completed work manually:
|
|
72
72
|
|
|
73
73
|
```bash
|
|
74
|
-
jcf log PROJ-123 --time 1h30m
|
|
75
|
-
jcf log PROJ-123 --time 45m --date 2026-06-24 --at 09:00 --comment "Pairing on release notes"
|
|
74
|
+
jcf timer log PROJ-123 --time 1h30m
|
|
75
|
+
jcf timer log PROJ-123 --time 45m --date 2026-06-24 --at 09:00 --comment "Pairing on release notes"
|
|
76
76
|
```
|
|
77
77
|
|
|
78
78
|
Edit the running timer:
|
|
79
79
|
|
|
80
80
|
```bash
|
|
81
|
-
jcf edit
|
|
81
|
+
jcf timer edit
|
|
82
82
|
```
|
|
83
83
|
|
|
84
84
|
## Agent Workflow
|
|
85
85
|
|
|
86
|
-
1. Run `jcf auth status` and `jcf status` before changing timer state.
|
|
87
|
-
2. Use `jcf list --json` to resolve issue keys when the user gives a vague ticket description.
|
|
86
|
+
1. Run `jcf auth status` and `jcf timer status` before changing timer state.
|
|
87
|
+
2. Use `jcf issue list --json` to resolve issue keys when the user gives a vague ticket description.
|
|
88
88
|
3. Prefer explicit flags for non-interactive work: issue key, duration, date, time, project id, billable flag, and comment.
|
|
89
|
-
4. If no timer is running, `jcf stop` may offer an interactive correction interval; use `jcf log` for deterministic manual logging.
|
|
89
|
+
4. If no timer is running, `jcf timer stop` may offer an interactive correction interval; use `jcf timer log` for deterministic manual logging.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
interface:
|
|
2
2
|
display_name: "Jira Clockify CLI"
|
|
3
3
|
short_description: "Track Jira work in Clockify"
|
|
4
|
-
default_prompt: "Use $jcf to
|
|
4
|
+
default_prompt: "Use $jcf to run timer, issue, and sync commands for Jira-backed Clockify time tracking."
|