@tamai/hub-cli 0.1.3 → 0.1.4

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 CHANGED
@@ -66,7 +66,7 @@ hub project help
66
66
  ```
67
67
 
68
68
  動詞は `task` が `new` / `add` / `claim` / `next` / `show` / `report` / `note` / `list` / `audit`、
69
- `project` が `list` / `show` / `create` / `update` / `move` / `sync-registry`。
69
+ `project` が `list` / `show` / `create` / `update` / `move`。
70
70
  **正確なオプションは常に `--help` を見る**(ここにも、スキルにも写経しない)。
71
71
  全動詞が `--json` を受ける。機械が読むときは必ず `--json` を使い、人向けの整形を parse しない。
72
72
 
package/lib/args.mjs CHANGED
@@ -57,7 +57,6 @@ export const PROJECT_USAGE = `使い方:
57
57
  [--remove-link "<ラベル>"]... [--remove-link-url <URL>]...
58
58
  [--clear-links] [--json]
59
59
  hub project move <slug> (--after <slug> | --top) [--json]
60
- hub project sync-registry [--json]
61
60
 
62
61
  create はslugを自動生成しない。既存に倣ってkebabの英字で指定する(例 pc-setup)。
63
62
  move はピン留めしたプロジェクトの並び替え。--top で先頭、--after で指定slugの直後。
@@ -80,7 +79,7 @@ export const PROJECT_USAGE = `使い方:
80
79
  export const USAGE = `使い方:
81
80
  hub task <verb> ... タスク操作(new / add / claim / next / show / report / note / list)
82
81
  hub task help
83
- hub project <verb> ... プロジェクト操作(list / show / create / update / move / sync-registry)
82
+ hub project <verb> ... プロジェクト操作(list / show / create / update / move)
84
83
  hub project help
85
84
  hub --version 入っているCLIの版を出す(hub version も同じ)
86
85
 
package/lib/cli.mjs CHANGED
@@ -3,7 +3,7 @@
3
3
  // ここを呼ぶだけの薄いラッパにし、ロジックを二重に持たないこと。
4
4
  //
5
5
  // hub task <verb> ... タスク操作(旧 tools/task.mjs と同機能)
6
- // hub project <verb> ... プロジェクト操作(読み取り + 作成・更新 + registry生成)
6
+ // hub project <verb> ... プロジェクト操作(読み取り + 作成・更新)
7
7
  //
8
8
  // 全サブコマンドが `--json` を受け付け、付けると生のAPI応答をそのまま出力する。
9
9
  //
@@ -33,7 +33,6 @@ import { projectCreateCommand } from "../commands/project-create.mjs";
33
33
  import { projectListCommand } from "../commands/project-list.mjs";
34
34
  import { projectMoveCommand } from "../commands/project-move.mjs";
35
35
  import { projectShowCommand } from "../commands/project-show.mjs";
36
- import { projectSyncRegistryCommand } from "../commands/project-sync-registry.mjs";
37
36
  import { projectUpdateCommand } from "../commands/project-update.mjs";
38
37
  import { taskAddCommand } from "../commands/task-add.mjs";
39
38
  import { taskAuditCommand } from "../commands/task-audit.mjs";
@@ -48,7 +47,7 @@ import { defaultRunGit } from "./git.mjs";
48
47
 
49
48
  export { configFromEnv, createHubApi } from "./api.mjs";
50
49
  export { defaultEnvFilePath, parseEnvFile } from "./api.mjs";
51
- export { projectLines, toRegistryYaml } from "./format.mjs";
50
+ export { projectLines } from "./format.mjs";
52
51
  export { auditDoneTasks, formatAuditReport, parseGitStatusPaths, readGitState } from "./git.mjs";
53
52
  export {
54
53
  DEFAULT_RECORD_DIR,
@@ -85,7 +84,6 @@ const COMMAND_GROUPS = {
85
84
  projectListCommand,
86
85
  projectMoveCommand,
87
86
  projectShowCommand,
88
- projectSyncRegistryCommand,
89
87
  projectUpdateCommand,
90
88
  ]),
91
89
  },
package/lib/format.mjs CHANGED
@@ -158,34 +158,3 @@ function formatEventValue(value) {
158
158
  if (typeof value === "boolean") return value ? "オン" : "オフ";
159
159
  return String(value) || "なし";
160
160
  }
161
-
162
- const REGISTRY_STATUS = { active: "active", paused: "dormant", closed: "archived" };
163
- const REGISTRY_HEADER = `# このファイルは hub の D1 \`projects\` から \`hub project sync-registry\` で生成した派生物。
164
- # 正本はD1(指示書v4)。手で編集せず、hub側を直してから再生成すること。
165
- #
166
- # 注意: D1が持たない項目(client / ローカルrepoパス / obsidian / drive / aliases)は
167
- # ここには出力されない。既存の project-registry.yml へ貼るときは、これらの行を消さずに
168
- # slug単位でマージすること(全文置換は情報を落とす)。
169
- `;
170
-
171
- function yamlScalar(value) {
172
- if (value === null || value === undefined || value === "") return "null";
173
- const text = String(value);
174
- return /^[\w./@-]+$/.test(text) ? text : JSON.stringify(text);
175
- }
176
-
177
- export function toRegistryYaml(items) {
178
- const blocks = [...items]
179
- .sort((a, b) => String(a.slug).localeCompare(String(b.slug)))
180
- .map((item) => {
181
- const lines = [
182
- `- slug: ${yamlScalar(item.slug)}`,
183
- ` name: ${yamlScalar(item.name)}`,
184
- ` status: ${REGISTRY_STATUS[item.status] ?? item.status}`,
185
- ` github: ${yamlScalar(item.repo)}`,
186
- ];
187
- if (item.note) lines.push(` note: ${yamlScalar(item.note)}`);
188
- return lines.join("\n");
189
- });
190
- return `${REGISTRY_HEADER}\n${blocks.join("\n\n")}\n`;
191
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamai/hub-cli",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "CLI for the hub personal dashboard: D1-backed task board and project registry.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -1,17 +0,0 @@
1
- import { usageError } from "../lib/args.mjs";
2
- import { toRegistryYaml } from "../lib/format.mjs";
3
-
4
- export const projectSyncRegistryCommand = {
5
- name: "sync-registry",
6
- options: {},
7
- async run({ options, positional, dependencies, api }) {
8
- if (positional.length !== 0) throw usageError("sync-registryに位置引数は指定できません");
9
- const payload = await api("/api/projects");
10
- const items = payload?.items ?? [];
11
- if (options.json) {
12
- dependencies.stdout.write(`${JSON.stringify({ items, yaml: toRegistryYaml(items) }, null, 2)}\n`);
13
- return;
14
- }
15
- dependencies.stdout.write(toRegistryYaml(items));
16
- },
17
- };