@nozomiishii/pm 0.2.0 → 0.2.3

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.ja.md CHANGED
@@ -157,6 +157,20 @@ pm() {
157
157
 
158
158
  この仕組みにより、プロジェクト名のタブ補完もサポートしています。
159
159
 
160
+ ## Tips
161
+
162
+ ### Ghostty のキーバインドで一発起動
163
+
164
+ [Ghostty](https://ghostty.org) を使っている場合、設定ファイルに次の行を追加するとキーバインド一発で `pm` を起動できます。
165
+
166
+ ```
167
+ keybind = super+alt+j=text:pm\n
168
+ ```
169
+
170
+ `super+alt+j` を押すと現在のターミナルへ `pm` + Enter が送信され、fzf ピッカーが即座に開きます。
171
+
172
+ 設定ファイルのパスは OS によって異なるので、[Ghostty 公式ドキュメントの Configuration](https://ghostty.org/docs/config) を参照してください。
173
+
160
174
  ## 謝辞
161
175
 
162
176
  pm は以下のプロジェクトから大きな影響を受けています。僕の生産性を上げてくれて本当にありがとうございます
package/README.md CHANGED
@@ -157,6 +157,20 @@ pm() {
157
157
 
158
158
  This mechanism also provides tab completion for project names.
159
159
 
160
+ ## Tips
161
+
162
+ ### Launch with a Ghostty keybind
163
+
164
+ If you use [Ghostty](https://ghostty.org), add the following line to your config to launch `pm` with a single keybind.
165
+
166
+ ```
167
+ keybind = super+alt+j=text:pm\n
168
+ ```
169
+
170
+ Pressing `super+alt+j` sends `pm` + Enter to the current terminal, instantly opening the fzf picker.
171
+
172
+ The config file path differs by OS, so see the [Configuration page in the Ghostty docs](https://ghostty.org/docs/config) for the exact location.
173
+
160
174
  ## Acknowledgments
161
175
 
162
176
  pm is heavily inspired by these projects. Thank you so much for boosting my productivity.
package/dist/cli.js CHANGED
@@ -68,7 +68,7 @@ var logo_color_default = `\x1B[38;2;120;180;255m zzzzzzzzzzzzzzzzzzzzzzzzzz\x1B[
68
68
  // package.json
69
69
  var package_default = {
70
70
  name: "@nozomiishii/pm",
71
- version: "0.2.0",
71
+ version: "0.2.3",
72
72
  description: "Project manager CLI — jump to projects via fzf",
73
73
  type: "module",
74
74
  homepage: "https://github.com/nozomiishii/pm#readme",
@@ -91,6 +91,7 @@ var package_default = {
91
91
  scripts: {
92
92
  build: "bun build --compile src/cli.ts --outfile dist/pm",
93
93
  prepublishOnly: "bun build src/cli.ts --outfile dist/cli.js --target=node --banner '#!/usr/bin/env node'",
94
+ prepare: "lefthook install --force",
94
95
  typecheck: "tsc --noEmit",
95
96
  dev: "bun run src/cli.ts",
96
97
  demo: 'docker run --rm -v "$(pwd)":/vhs pm-vhs',
@@ -102,8 +103,11 @@ var package_default = {
102
103
  test: "vitest run"
103
104
  },
104
105
  devDependencies: {
105
- "@types/node": "25.6.0",
106
- vitest: "4.1.5"
106
+ "@nozomiishii/commitlint-config": "1.1.1",
107
+ "@nozomiishii/lefthook-config": "1.1.1",
108
+ "@types/node": "25.8.0",
109
+ lefthook: "2.1.6",
110
+ vitest: "4.1.6"
107
111
  },
108
112
  publishConfig: {
109
113
  access: "public",
@@ -174,15 +178,20 @@ function plainLabel(name) {
174
178
  }
175
179
  function fzfSelect(projects) {
176
180
  return new Promise((resolve, reject) => {
177
- const labels = projects.map((p) => plainLabel(p.name));
178
- const proc = spawn("fzf", [], {
181
+ const lines = projects.map((p) => `${plainLabel(p.name)} ${expandHome(p.rootPath)}`);
182
+ const proc = spawn("fzf", [
183
+ "--delimiter=\t",
184
+ "--with-nth=1",
185
+ "--preview",
186
+ "bat --color=always --style=header,grid --line-range :80 {2}/README.* 2>/dev/null || echo 'No README found'"
187
+ ], {
179
188
  stdio: ["pipe", "pipe", "inherit"]
180
189
  });
181
190
  let stdout = "";
182
191
  proc.stdout.on("data", (d) => {
183
192
  stdout += d.toString();
184
193
  });
185
- proc.stdin.write(labels.join(`
194
+ proc.stdin.write(lines.join(`
186
195
  `) + `
187
196
  `);
188
197
  proc.stdin.end();
@@ -192,7 +201,7 @@ function fzfSelect(projects) {
192
201
  return;
193
202
  }
194
203
  const selected = stdout.trim();
195
- const idx = labels.indexOf(selected);
204
+ const idx = lines.indexOf(selected);
196
205
  resolve(idx >= 0 ? projects[idx] : undefined);
197
206
  });
198
207
  proc.on("error", (err) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nozomiishii/pm",
3
- "version": "0.2.0",
3
+ "version": "0.2.3",
4
4
  "description": "Project manager CLI — jump to projects via fzf",
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/nozomiishii/pm#readme",
@@ -23,6 +23,7 @@
23
23
  "scripts": {
24
24
  "build": "bun build --compile src/cli.ts --outfile dist/pm",
25
25
  "prepublishOnly": "bun build src/cli.ts --outfile dist/cli.js --target=node --banner '#!/usr/bin/env node'",
26
+ "prepare": "lefthook install --force",
26
27
  "typecheck": "tsc --noEmit",
27
28
  "dev": "bun run src/cli.ts",
28
29
  "demo": "docker run --rm -v \"$(pwd)\":/vhs pm-vhs",
@@ -34,8 +35,11 @@
34
35
  "test": "vitest run"
35
36
  },
36
37
  "devDependencies": {
37
- "@types/node": "25.6.0",
38
- "vitest": "4.1.5"
38
+ "@nozomiishii/commitlint-config": "1.1.1",
39
+ "@nozomiishii/lefthook-config": "1.1.1",
40
+ "@types/node": "25.8.0",
41
+ "lefthook": "2.1.6",
42
+ "vitest": "4.1.6"
39
43
  },
40
44
  "publishConfig": {
41
45
  "access": "public",