@ondrej-svec/hog 1.17.0 → 1.19.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/dist/cli.js CHANGED
@@ -175,7 +175,8 @@ var init_config = __esm({
175
175
  localPath: z.string().refine((p) => isAbsolute(p), { message: "localPath must be an absolute path" }).refine((p) => normalize(p) === p, {
176
176
  message: "localPath must be normalized (no .. segments)"
177
177
  }).refine((p) => !p.includes("\0"), { message: "localPath must not contain null bytes" }).optional(),
178
- claudeStartCommand: CLAUDE_START_COMMAND_SCHEMA.optional()
178
+ claudeStartCommand: CLAUDE_START_COMMAND_SCHEMA.optional(),
179
+ claudePrompt: z.string().optional()
179
180
  });
180
181
  BOARD_CONFIG_SCHEMA = z.object({
181
182
  refreshInterval: z.number().int().min(10).default(60),
@@ -183,6 +184,7 @@ var init_config = __esm({
183
184
  assignee: z.string().min(1),
184
185
  focusDuration: z.number().int().min(60).default(1500),
185
186
  claudeStartCommand: CLAUDE_START_COMMAND_SCHEMA.optional(),
187
+ claudePrompt: z.string().optional(),
186
188
  claudeLaunchMode: z.enum(["auto", "tmux", "terminal"]).optional(),
187
189
  claudeTerminalApp: z.enum(["Terminal", "iTerm", "Ghostty", "WezTerm", "Kitty", "Alacritty"]).optional()
188
190
  });
@@ -2187,6 +2189,10 @@ function useKeyboard({
2187
2189
  handleLaunchClaude();
2188
2190
  return;
2189
2191
  }
2192
+ if (input2 === "g") {
2193
+ handleOpen();
2194
+ return;
2195
+ }
2190
2196
  }
2191
2197
  if (ui.canAct) {
2192
2198
  const digit = parseInt(input2, 10);
@@ -2282,7 +2288,11 @@ function useKeyboard({
2282
2288
  onStatusEnter();
2283
2289
  break;
2284
2290
  case 3:
2285
- handleOpen();
2291
+ if (showDetailPanel) {
2292
+ panelFocus.focusPanel(0);
2293
+ } else {
2294
+ ui.enterDetail();
2295
+ }
2286
2296
  break;
2287
2297
  case 4:
2288
2298
  onActivityEnter();
@@ -2859,9 +2869,12 @@ __export(launch_claude_exports, {
2859
2869
  });
2860
2870
  import { spawn, spawnSync } from "child_process";
2861
2871
  import { existsSync as existsSync5 } from "fs";
2862
- function buildPrompt(issue) {
2863
- return `Issue #${issue.number}: ${issue.title}
2872
+ function buildPrompt(issue, template) {
2873
+ if (!template) {
2874
+ return `Issue #${issue.number}: ${issue.title}
2864
2875
  URL: ${issue.url}`;
2876
+ }
2877
+ return template.replace(/\{number\}/g, String(issue.number)).replace(/\{title\}/g, issue.title).replace(/\{url\}/g, issue.url);
2865
2878
  }
2866
2879
  function isClaudeInPath() {
2867
2880
  const result = spawnSync("which", ["claude"], { stdio: "pipe" });
@@ -2883,7 +2896,7 @@ function resolveCommand(opts) {
2883
2896
  function launchViaTmux(opts) {
2884
2897
  const { localPath, issue, repoFullName } = opts;
2885
2898
  const { command, extraArgs } = resolveCommand(opts);
2886
- const prompt = buildPrompt(issue);
2899
+ const prompt = buildPrompt(issue, opts.promptTemplate);
2887
2900
  const windowName = `claude-${issue.number}`;
2888
2901
  const tmuxArgs = [
2889
2902
  "new-window",
@@ -2906,7 +2919,7 @@ function launchViaTmux(opts) {
2906
2919
  function launchViaTerminalApp(terminalApp, opts) {
2907
2920
  const { localPath, issue } = opts;
2908
2921
  const { command, extraArgs } = resolveCommand(opts);
2909
- const prompt = buildPrompt(issue);
2922
+ const prompt = buildPrompt(issue, opts.promptTemplate);
2910
2923
  const fullCmd = [command, ...extraArgs, "--", prompt].join(" ");
2911
2924
  switch (terminalApp) {
2912
2925
  case "iTerm": {
@@ -3007,7 +3020,7 @@ function launchViaDetectedTerminal(opts) {
3007
3020
  }
3008
3021
  const { localPath, issue } = opts;
3009
3022
  const { command, extraArgs } = resolveCommand(opts);
3010
- const prompt = buildPrompt(issue);
3023
+ const prompt = buildPrompt(issue, opts.promptTemplate);
3011
3024
  const child = spawn(
3012
3025
  "xdg-terminal-exec",
3013
3026
  ["bash", "-c", `cd ${localPath} && ${[command, ...extraArgs, "--", prompt].join(" ")}`],
@@ -3383,7 +3396,7 @@ function HintBar({
3383
3396
  if (uiMode === "overlay:detail") {
3384
3397
  return /* @__PURE__ */ jsxs5(Box5, { children: [
3385
3398
  /* @__PURE__ */ jsx5(Text5, { color: "cyan", bold: true, children: "[DETAIL]" }),
3386
- /* @__PURE__ */ jsx5(Text5, { color: "gray", children: " Esc:close e:edit c:comment y:copy-link C:claude ? help" })
3399
+ /* @__PURE__ */ jsx5(Text5, { color: "gray", children: " Esc:close e:edit c:comment g:open y:copy-link C:claude ? help" })
3387
3400
  ] });
3388
3401
  }
3389
3402
  if (uiMode.startsWith("overlay:")) {
@@ -3393,7 +3406,7 @@ function HintBar({
3393
3406
  0: "j/k:scroll Esc:close ? help",
3394
3407
  1: "j/k:move Enter:filter 0-4:panel ? help",
3395
3408
  2: "j/k:move Enter:filter Esc:clear 0-4:panel ? help",
3396
- 3: `j/k:move p:pick m:status c:comment C:claude /:search n:new 0-4:panel${hasUndoable ? " u:undo" : ""} ? help q:quit`,
3409
+ 3: `j/k:move Enter:detail g:open p:pick m:status c:comment C:claude /:search n:new 0-4:panel${hasUndoable ? " u:undo" : ""} ? help q:quit`,
3397
3410
  4: "j/k:scroll Enter:jump r:refresh 0-4:panel ? help"
3398
3411
  };
3399
3412
  return /* @__PURE__ */ jsxs5(Box5, { children: [
@@ -4452,7 +4465,7 @@ var init_help_overlay = __esm({
4452
4465
  {
4453
4466
  category: "View",
4454
4467
  items: [
4455
- { key: "Enter", desc: "Open issue in browser" },
4468
+ { key: "Enter", desc: "Open detail panel" },
4456
4469
  { key: "0", desc: "Detail panel (full-screen on narrow terminals)" },
4457
4470
  { key: "Space", desc: "Multi-select item" },
4458
4471
  { key: "/", desc: "Search (inline filter)" },
@@ -4472,7 +4485,7 @@ var init_help_overlay = __esm({
4472
4485
  { key: "e", desc: "Edit issue in $EDITOR (title, assignee, status, labels)" },
4473
4486
  { key: "c", desc: "Comment on issue" },
4474
4487
  { key: "m", desc: "Move status" },
4475
- { key: "e", desc: "Edit issue in $EDITOR" },
4488
+ { key: "g", desc: "Open issue in browser" },
4476
4489
  { key: "o", desc: "Open Slack thread" },
4477
4490
  { key: "y", desc: "Copy issue link to clipboard" },
4478
4491
  { key: "n", desc: "Create new issue" },
@@ -5985,10 +5998,12 @@ function Dashboard({ config: config2, options, activeProfile }) {
5985
5998
  return;
5986
5999
  }
5987
6000
  const resolvedStartCommand = rc.claudeStartCommand ?? config2.board.claudeStartCommand;
6001
+ const resolvedPromptTemplate = rc.claudePrompt ?? config2.board.claudePrompt;
5988
6002
  const result = launchClaude({
5989
6003
  localPath: rc.localPath,
5990
6004
  issue: { number: found.issue.number, title: found.issue.title, url: found.issue.url },
5991
6005
  ...resolvedStartCommand ? { startCommand: resolvedStartCommand } : {},
6006
+ ...resolvedPromptTemplate ? { promptTemplate: resolvedPromptTemplate } : {},
5992
6007
  launchMode: config2.board.claudeLaunchMode ?? "auto",
5993
6008
  ...config2.board.claudeTerminalApp ? { terminalApp: config2.board.claudeTerminalApp } : {},
5994
6009
  repoFullName: found.repoName
@@ -7679,7 +7694,7 @@ function resolveProjectId(projectId) {
7679
7694
  process.exit(1);
7680
7695
  }
7681
7696
  var program = new Command();
7682
- program.name("hog").description("Personal command deck \u2014 unified task dashboard for GitHub Projects + TickTick").version("1.17.0").option("--json", "Force JSON output").option("--human", "Force human-readable output").hook("preAction", (thisCommand) => {
7697
+ program.name("hog").description("Personal command deck \u2014 unified task dashboard for GitHub Projects + TickTick").version("1.19.0").option("--json", "Force JSON output").option("--human", "Force human-readable output").hook("preAction", (thisCommand) => {
7683
7698
  const opts = thisCommand.opts();
7684
7699
  if (opts.json) setFormat("json");
7685
7700
  if (opts.human) setFormat("human");