@knpkv/jira-clockify 0.5.0 → 1.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.
Files changed (39) hide show
  1. package/README.md +10 -10
  2. package/dist/package.json +1 -1
  3. package/dist/src/bin.js +1 -15
  4. package/dist/src/bin.js.map +1 -1
  5. package/dist/src/cli/layers.js +7 -2
  6. package/dist/src/cli/layers.js.map +1 -1
  7. package/dist/src/cli/list.js +1 -0
  8. package/dist/src/cli/list.js.map +1 -1
  9. package/dist/src/cli/reconcile.js +131 -0
  10. package/dist/src/cli/reconcile.js.map +1 -0
  11. package/dist/src/cli/root.js +25 -0
  12. package/dist/src/cli/root.js.map +1 -0
  13. package/dist/src/cli/setup.js +1 -1
  14. package/dist/src/cli/setup.js.map +1 -1
  15. package/dist/src/cli/timer/start.js +1 -1
  16. package/dist/src/cli/timer/start.js.map +1 -1
  17. package/dist/src/cli/timer/stop.js +26 -10
  18. package/dist/src/cli/timer/stop.js.map +1 -1
  19. package/dist/src/cli/timer.js +4 -0
  20. package/dist/src/cli/timer.js.map +1 -1
  21. package/dist/src/services/ReconcileService.js +0 -0
  22. package/dist/src/services/ReconcileService.js.map +1 -0
  23. package/dist/src/services/TimerService.js +45 -22
  24. package/dist/src/services/TimerService.js.map +1 -1
  25. package/dist/src/tui/App.js +41 -49
  26. package/dist/src/tui/App.js.map +1 -1
  27. package/dist/test/ReconcileService.test.js +146 -0
  28. package/dist/test/ReconcileService.test.js.map +1 -0
  29. package/dist/test/TimerService.test.js +64 -15
  30. package/dist/test/TimerService.test.js.map +1 -1
  31. package/dist/test/commandSurface.test.js +42 -0
  32. package/dist/test/commandSurface.test.js.map +1 -0
  33. package/dist/tsconfig.tsbuildinfo +1 -1
  34. package/nvim/lua/jcf/init.lua +8 -8
  35. package/nvim/lua/jcf/state.lua +3 -3
  36. package/nvim/lua/jcf/telescope.lua +3 -3
  37. package/package.json +5 -5
  38. package/skills/jcf/SKILL.md +23 -18
  39. package/skills/jcf/agents/openai.yaml +1 -1
@@ -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 → open jcf start in float (has built-in fuzzy selector)
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
@@ -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.5.0",
3
+ "version": "1.0.1",
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
- "@knpkv/atlassian-common": "^0.3.0",
26
+ "@knpkv/agent-skills": "^0.2.2",
27
+ "@knpkv/atlassian-common": "^0.4.0",
28
+ "@knpkv/clockify-api-client": "^0.3.0",
28
29
  "@knpkv/jira-api-client": "^0.3.0",
29
- "@knpkv/jira-cli": "^0.3.0",
30
- "@knpkv/clockify-api-client": "^0.3.0"
30
+ "@knpkv/jira-cli": "^1.1.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@effect/vitest": "4.0.0-beta.87",
@@ -11,8 +11,9 @@ Use the `jcf` binary to manage Jira-backed Clockify timers.
11
11
 
12
12
  - Configure both services before timer operations: Jira OAuth and Clockify API key.
13
13
  - Use `jcf auth status` to check readiness.
14
+ - `jcf` uses the shared Jira CLI auth profile store; for multi-site Jira accounts, use `jira auth profiles` and `jira auth use <profile>` before timer operations when the `jira` binary is available. When the `atlassian` binary is available, prefer `atlassian profiles doctor` to confirm that Jira Clockify is using the intended `jira-cli` auth store and `atlassian auth refresh` for expired Jira tokens.
14
15
  - 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.
16
+ - Use `jcf issue list --json` when an agent needs structured ticket data.
16
17
 
17
18
  ## Setup
18
19
 
@@ -22,6 +23,9 @@ jcf auth jira create
22
23
  jcf auth jira configure
23
24
  jcf auth jira login
24
25
  jcf auth clockify setup
26
+
27
+ atlassian profiles doctor
28
+ atlassian auth refresh
25
29
  ```
26
30
 
27
31
  Configure defaults:
@@ -46,44 +50,45 @@ jcf tui
46
50
  List available Jira tickets:
47
51
 
48
52
  ```bash
49
- jcf list
50
- jcf list --json
53
+ jcf issue list
54
+ jcf issue list --json
51
55
  ```
52
56
 
53
57
  Start work:
54
58
 
55
59
  ```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
60
+ jcf timer start PROJ-123
61
+ jcf timer start PROJ-123 --ago 15m
62
+ jcf timer start PROJ-123 --since 09:30
63
+ jcf timer start PROJ-123 --project <clockify-project-id> --billable
60
64
  ```
61
65
 
62
66
  Stop or discard current work:
63
67
 
64
68
  ```bash
65
- jcf status
66
- jcf stop
67
- jcf stop --project <clockify-project-id> --billable
68
- jcf discard
69
+ jcf timer status
70
+ jcf timer stop
71
+ jcf timer stop --project <clockify-project-id> --billable
72
+ jcf timer discard
69
73
  ```
70
74
 
71
75
  Log completed work manually:
72
76
 
73
77
  ```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"
78
+ jcf timer log PROJ-123 --time 1h30m
79
+ jcf timer log PROJ-123 --time 45m --date 2026-06-24 --at 09:00 --comment "Pairing on release notes"
76
80
  ```
77
81
 
78
82
  Edit the running timer:
79
83
 
80
84
  ```bash
81
- jcf edit
85
+ jcf timer edit
82
86
  ```
83
87
 
84
88
  ## Agent Workflow
85
89
 
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.
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.
90
+ 1. Run `jcf auth status` and `jcf timer status` before changing timer state.
91
+ 2. Use `jcf issue list --json` to resolve issue keys when the user gives a vague ticket description.
92
+ 3. Verify the active Jira profile when the user names a Jira site/account or before posting worklogs; `atlassian profiles doctor` shows Jira Clockify as a consumer of the `jira-cli` auth store.
93
+ 4. Prefer explicit flags for non-interactive work: issue key, duration, date, time, project id, billable flag, and comment.
94
+ 5. 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 start, stop, log, or inspect Jira Clockify timers."
4
+ default_prompt: "Use $jcf to run timer, issue, and sync commands for Jira-backed Clockify time tracking."