@aaa_iii/fzv 0.1.1 → 0.2.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.ja.md +162 -0
- package/README.md +115 -72
- package/dist/client/assets/{c-pw5cNQ6f.js → c-BrjaNpVh.js} +1 -1
- package/dist/client/assets/{cpp-BzP2DU1a.js → cpp-BIxKXcra.js} +1 -1
- package/dist/client/assets/{highlight-m6b6lqez.js → highlight-hBTJsM0d.js} +3 -3
- package/dist/client/assets/{index-DZRy_kMM.js → index-DmtUQAD5.js} +3 -3
- package/dist/client/assets/{java-D112xljv.js → java-D_0z2NwT.js} +1 -1
- package/dist/client/assets/{jsx-Czjwr3X8.js → jsx-Dyxbavxn.js} +1 -1
- package/dist/client/assets/{latex-DyPjLw3u.js → latex-D_hv-EHy.js} +1 -1
- package/dist/client/assets/{lua-C7IYe9JZ.js → lua-BkwxsP7-.js} +1 -1
- package/dist/client/assets/{pdf-APdaxgPI.js → pdf-CIufTche.js} +2 -2
- package/dist/client/assets/{r-9GJvLLqN.js → r-B-o4EwkG.js} +1 -1
- package/dist/client/assets/{ruby-BcWFKqsj.js → ruby-C11HOYlt.js} +1 -1
- package/dist/client/assets/{tsx-COvetw7Z.js → tsx-BIbTecDf.js} +1 -1
- package/dist/client/assets/{typescript-D48Br3Og.js → typescript-BMg-mt7U.js} +1 -1
- package/dist/client/assets/{xml-_pY6RLHw.js → xml-BQ9PLRGp.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/catalog.js +6 -0
- package/dist/server/cli.js +34 -9
- package/dist/server/network.js +4 -0
- package/dist/server/office.js +244 -0
- package/dist/server/server.js +41 -3
- package/dist/shared.js +1 -1
- package/package.json +1 -1
package/README.ja.md
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# fzv
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@aaa_iii/fzv)
|
|
4
|
+
[](https://github.com/iiii1224/fzv/actions/workflows/ci.yml)
|
|
5
|
+
[](https://github.com/iiii1224/fzv/blob/main/LICENSE)
|
|
6
|
+
|
|
7
|
+
[English](https://github.com/iiii1224/fzv/blob/main/README.md) | 日本語
|
|
8
|
+
|
|
9
|
+
コーディングエージェントに作らせたファイルを、IDE を開かずにブラウザで探して読むための読み取り専用ビューアです。PDF、HTML、画像、ソースコード、Office 文書を、同じタブと分割画面で切り替えながら確認できます。
|
|
10
|
+
|
|
11
|
+
```console
|
|
12
|
+
$ npx --yes @aaa_iii/fzv@latest --watch
|
|
13
|
+
|
|
14
|
+
fzv 0.2.0
|
|
15
|
+
Project ~/dev/fzv
|
|
16
|
+
Viewer http://127.0.0.1:29814/
|
|
17
|
+
Office ibisOffice (~/.local/bin/ibisOffice)
|
|
18
|
+
|
|
19
|
+
Press Ctrl+C to stop.
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
表示された URL をブラウザで開き、`/` でファイルを検索します。
|
|
23
|
+
|
|
24
|
+
## 特徴
|
|
25
|
+
|
|
26
|
+
ターミナルでエージェントに指示を出しながら、生成された成果物だけを横で確かめる、という使い方を想定しています。
|
|
27
|
+
|
|
28
|
+
- **`npx` 一行で起動**: 実行時に依存パッケージを取得しません。UI、PDF.js、フォントは配布パッケージに含まれており、インストール時のビルドもありません。
|
|
29
|
+
- **形式が違っても操作は同じ**: PDF も Markdown も画像も、同じタブ、分割、キー操作で扱います。
|
|
30
|
+
- **キーボードで完結**: `/` であいまい検索、`hjkl` でスクロール、`f` で画面上のリンクやボタンへジャンプします。
|
|
31
|
+
- **ファイルを書き換えない**: 書き込み機能はなく、プロジェクトのルートより外へのアクセスは拒否します。
|
|
32
|
+
|
|
33
|
+
**できないこと**: ファイルの編集、ファイル内容の全文検索、`.gitignore` の解釈、旧形式の Office 文書(`.doc`、`.xls`、`.ppt`)の表示、認証付きの公開。編集や全文検索には、エディタや `rg` を併用してください。
|
|
34
|
+
|
|
35
|
+
## 必要なもの
|
|
36
|
+
|
|
37
|
+
- Node.js 24 以降
|
|
38
|
+
- 現行のデスクトップブラウザ
|
|
39
|
+
- Office 文書を表示する場合: [ibisOffice](https://github.com/ibisjp/ibis-office) または [LibreOffice](https://www.libreoffice.org/)
|
|
40
|
+
|
|
41
|
+
## 起動する
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# カレントディレクトリを開く
|
|
45
|
+
npx --yes @aaa_iii/fzv@latest
|
|
46
|
+
|
|
47
|
+
# ファイルの変更を検知して、検索対象と開いているタブを更新する
|
|
48
|
+
npx --yes @aaa_iii/fzv@latest --watch
|
|
49
|
+
|
|
50
|
+
# 別のディレクトリを開く
|
|
51
|
+
npx --yes @aaa_iii/fzv@latest --root ~/projects/example
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
`Ctrl+C` で終了します。
|
|
55
|
+
|
|
56
|
+
ポートは、プロジェクトのパスから 20000〜29999 番の中で決まります。同じプロジェクトなら毎回同じ URL になるので、ブラウザに保存されたタブ、分割、テーマが次の起動時にも戻ります。そのポートが使用中のときは空いているポートで起動し、ターミナルに警告を出します。この場合は URL が変わるため、前回の状態は戻りません。
|
|
57
|
+
|
|
58
|
+
## 使い方
|
|
59
|
+
|
|
60
|
+
### ファイルを探す
|
|
61
|
+
|
|
62
|
+
`/` を押すか「Find a file」をクリックすると検索が開きます。何も入力していないときは、ルート直下のファイルとディレクトリが並びます。ディレクトリを選ぶとその中に移動し、文字を入力するとパスをあいまい検索します。スペースで区切った語は、すべて含むパスだけに絞り込みます。
|
|
63
|
+
|
|
64
|
+
ファイル一覧は検索を開くたびに裏で読み直すため、ページを開いた後に作られたファイルも見つかります。読み直している間も、直前の一覧でそのまま検索できます。
|
|
65
|
+
|
|
66
|
+
隠しファイルと隠しディレクトリ、`node_modules`、`__pycache__` は一覧に出ません。
|
|
67
|
+
|
|
68
|
+
### タブと分割
|
|
69
|
+
|
|
70
|
+
ファイルはタブで開きます。タブはドラッグして並べ替えたり、上下左右にドロップして画面を分割したりできます。`Ctrl` を押しながら(macOS では `Option`)ドラッグすると、移動ではなく複製になります。分割は最大 32 個で、境界をドラッグして大きさを変えられます。
|
|
71
|
+
|
|
72
|
+
開いているタブ、分割の配置、表示モードはブラウザに保存され、再読み込みしても戻ります。
|
|
73
|
+
|
|
74
|
+
### プレビューできる形式
|
|
75
|
+
|
|
76
|
+
| 形式 | 拡張子 | 表示 |
|
|
77
|
+
| -------- | ------------------------------------------------------------------------------------------------- | ---------------------------------------------- |
|
|
78
|
+
| PDF | `.pdf` | 文字選択、文書内検索、ズーム |
|
|
79
|
+
| HTML | `.html` `.htm` | sandbox 内で描画。ソース表示に切り替え可能 |
|
|
80
|
+
| Markdown | `.md` | 整形表示。ソース表示に切り替え可能 |
|
|
81
|
+
| 画像 | `.png` `.jpg` `.jpeg` `.gif` `.webp` `.avif` `.bmp` `.svg` `.ico` | 拡大、縮小、移動 |
|
|
82
|
+
| Office | `.docx` `.xlsx` `.pptx` | PDF に変換して表示 |
|
|
83
|
+
| テキスト | `.ts` `.js` `.py` `.rs` `.go` `.json` `.yaml` `.toml` `.tex` `.csv` など、`Makefile` `Dockerfile` | 行番号とシンタックスハイライト付きのソース表示 |
|
|
84
|
+
|
|
85
|
+
1 ファイルあたり 20 MiB までです。表示中のファイルは「Download」から元の形式で保存できます。
|
|
86
|
+
|
|
87
|
+
## キー操作
|
|
88
|
+
|
|
89
|
+
| キー | 操作 |
|
|
90
|
+
| ------------------------ | -------------------------------------------- |
|
|
91
|
+
| `/` | ファイル検索を開く |
|
|
92
|
+
| `?` | キー操作の一覧を表示 |
|
|
93
|
+
| `f` | リンクやボタンにラベルを出し、入力でジャンプ |
|
|
94
|
+
| `h` `j` `k` `l` | プレビューをスクロール |
|
|
95
|
+
| `gg` / `G` | 先頭 / 末尾へ移動 |
|
|
96
|
+
| `r` | 表示中のファイルを読み直す |
|
|
97
|
+
| `Alt+J` / `Alt+K` | 同じ分割内で次 / 前のタブへ |
|
|
98
|
+
| `Ctrl/Cmd+\` | 右に分割 |
|
|
99
|
+
| `Ctrl/Cmd+Shift+\` | 下に分割 |
|
|
100
|
+
| `Ctrl/Cmd+1`〜`9` | 分割領域にフォーカス |
|
|
101
|
+
| `Ctrl/Cmd+F` | PDF 内を検索 |
|
|
102
|
+
| `Ctrl/Cmd` + `+` `-` `0` | 画像と PDF のズーム(`0` で画面に合わせる) |
|
|
103
|
+
| `Escape` | 検索、ヘルプ、ラベル表示を閉じる |
|
|
104
|
+
|
|
105
|
+
入力欄では文字入力が優先されます。ブラウザが予約しているショートカットは、ブラウザの動作が優先されます。
|
|
106
|
+
|
|
107
|
+
## Office 文書のプレビュー
|
|
108
|
+
|
|
109
|
+
`.docx`、`.xlsx`、`.pptx` は、手元の ibisOffice か LibreOffice で PDF に変換してから表示します。fzv は起動時に `PATH` から `ibisOffice`、`soffice`、`libreoffice` の順で探し、macOS では `/Applications` 内のアプリも探します。見つかった変換ソフトは起動メッセージの `Office` 行に表示されます。
|
|
110
|
+
|
|
111
|
+
見つからない場所にある場合は、`--office-converter` でパスを指定します。
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
npx --yes @aaa_iii/fzv@latest --office-converter ~/Applications/ibisOffice-0.8.4-Linux.AppImage
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
実行ファイル名が `soffice` または `libreoffice` で始まる場合は LibreOffice として、それ以外は ibisOffice として呼び出します。変換結果はファイルの内容ごとにキャッシュされ、内容が変わると変換し直します。
|
|
118
|
+
|
|
119
|
+
## オプション
|
|
120
|
+
|
|
121
|
+
| オプション | 既定値 | 説明 |
|
|
122
|
+
| ------------------------- | -------------------------- | -------------------------------------------------------------------- |
|
|
123
|
+
| `--root PATH` | カレントディレクトリ | 開くプロジェクトのルート |
|
|
124
|
+
| `--host HOST` | `127.0.0.1` | 待ち受けるアドレス |
|
|
125
|
+
| `--port PORT` | プロジェクトのパスから決定 | `0` で空きポート。明示したポートが使用中なら起動しない |
|
|
126
|
+
| `--watch` | 無効 | ファイルの変更を検知して、検索対象と開いているタブを更新 |
|
|
127
|
+
| `--allow-html-network` | 無効 | HTML プレビューに外部スクリプトの読み込みとネットワーク通信を許可 |
|
|
128
|
+
| `--office-converter PATH` | `PATH` から自動検出 | Office 文書の変換に使う ibisOffice または LibreOffice の実行ファイル |
|
|
129
|
+
| `-h`, `--help` | | ヘルプを表示 |
|
|
130
|
+
| `-v`, `--version` | | バージョンを表示 |
|
|
131
|
+
|
|
132
|
+
## セキュリティ
|
|
133
|
+
|
|
134
|
+
既定では `127.0.0.1` だけで待ち受け、このマシンからしか開けません。LAN 内の別の端末から開くには、待ち受けアドレスを明示します。
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
npx --yes @aaa_iii/fzv@latest --host 0.0.0.0 --port 8000
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
**注意**: 認証も TLS もありません。接続できる人は誰でも、プロジェクト内の表示対象ファイルを読めます。信頼できるネットワークでだけ使ってください。
|
|
141
|
+
|
|
142
|
+
- サーバーは GET と HEAD だけを受け付け、別オリジンからの API リクエストを拒否します。
|
|
143
|
+
- HTML プレビューは sandbox 内で動き、fzv 本体のページやストレージには触れません。インラインスクリプトは動きますが、外部スクリプトと API 通信は既定で遮断します。画像、CSS、フォントは読み込まれる場合があります。`--allow-html-network` は、中身を信頼できる HTML にだけ使ってください。
|
|
144
|
+
- Office 文書は、検証したファイルの内容を一時ディレクトリにコピーしてから変換ソフトに渡します。変換ソフトがプロジェクトのパスを直接読むことはありません。一時ディレクトリは終了時に削除します。
|
|
145
|
+
|
|
146
|
+
## 開発状況
|
|
147
|
+
|
|
148
|
+
0.x 系で開発中です。オプションやキー操作は、マイナーバージョンの更新でも変わることがあります。
|
|
149
|
+
|
|
150
|
+
## ソースから動かす
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
npm ci
|
|
154
|
+
npm run build
|
|
155
|
+
node dist/server/cli.js --watch
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
UI を変更しながら確認するときは、サーバーを起動したまま別のターミナルで `npm run dev:ui` を実行し、Vite が表示する URL を開きます。テストは `npm test` と `npm run test:browser` です。
|
|
159
|
+
|
|
160
|
+
## ライセンス
|
|
161
|
+
|
|
162
|
+
[MIT](https://github.com/iiii1224/fzv/blob/main/LICENSE)。同梱しているコンポーネントのライセンスと、あいまい検索の実装の出典は [THIRD_PARTY_NOTICES.md](https://github.com/iiii1224/fzv/blob/main/THIRD_PARTY_NOTICES.md) にあります。
|
package/README.md
CHANGED
|
@@ -1,119 +1,162 @@
|
|
|
1
1
|
# fzv
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@aaa_iii/fzv)
|
|
4
|
+
[](https://github.com/iiii1224/fzv/actions/workflows/ci.yml)
|
|
5
|
+
[](https://github.com/iiii1224/fzv/blob/main/LICENSE)
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
English | [日本語](https://github.com/iiii1224/fzv/blob/main/README.ja.md)
|
|
6
8
|
|
|
7
|
-
-
|
|
8
|
-
- 現行のデスクトップブラウザ
|
|
9
|
+
A read-only browser viewer for finding and reading the files your coding agent produces, without opening an IDE. Switch between PDFs, HTML, images, source code, and Office documents in the same tabs and split panes.
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
```console
|
|
12
|
+
$ npx --yes @aaa_iii/fzv@latest --watch
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
fzv 0.2.0
|
|
15
|
+
Project ~/dev/fzv
|
|
16
|
+
Viewer http://127.0.0.1:29814/
|
|
17
|
+
Office ibisOffice (~/.local/bin/ibisOffice)
|
|
13
18
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
npx --yes @aaa_iii/fzv@latest --root .
|
|
19
|
+
Press Ctrl+C to stop.
|
|
18
20
|
```
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
Open the printed URL in your browser and press `/` to find a file.
|
|
21
23
|
|
|
22
|
-
|
|
23
|
-
npx --yes @aaa_iii/fzv@latest --root . --watch
|
|
24
|
-
```
|
|
24
|
+
## Why fzv
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
fzv is built for keeping an eye on generated output while you keep directing an agent from the terminal.
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
- **One `npx` command**: nothing is downloaded at runtime. The UI, PDF.js, and fonts ship inside the package, and there is no install-time build.
|
|
29
|
+
- **One workflow for every format**: PDFs, Markdown, and images all use the same tabs, splits, and keys.
|
|
30
|
+
- **Keyboard-driven**: `/` for fuzzy search, `hjkl` to scroll, `f` to jump to any link or button on screen.
|
|
31
|
+
- **Never modifies files**: there is no write path, and requests outside the project root are rejected.
|
|
29
32
|
|
|
30
|
-
|
|
31
|
-
| ---------------------- | -------------------- | ------------------------------------------------------ |
|
|
32
|
-
| `--root PATH` | カレントディレクトリ | 閲覧するプロジェクトのルート |
|
|
33
|
-
| `--host HOST` | `127.0.0.1` | 待ち受けアドレス |
|
|
34
|
-
| `--port PORT` | `8000` | ポート番号。`0` を指定すると空きポートを使う |
|
|
35
|
-
| `--watch` | 無効 | プロジェクト内の変更後に検索対象と表示を更新 |
|
|
36
|
-
| `--allow-html-network` | 無効 | HTMLプレビューで外部スクリプトとネットワーク通信を許可 |
|
|
37
|
-
| `-h`, `--help` | — | ヘルプを表示 |
|
|
38
|
-
| `-v`, `--version` | — | バージョンを表示 |
|
|
33
|
+
**What it does not do**: edit files, search file contents, honor `.gitignore`, preview legacy Office formats (`.doc`, `.xls`, `.ppt`), or serve with authentication. Pair it with an editor or `rg` for editing and full-text search.
|
|
39
34
|
|
|
40
|
-
|
|
35
|
+
## Requirements
|
|
36
|
+
|
|
37
|
+
- Node.js 24 or later
|
|
38
|
+
- A current desktop browser
|
|
39
|
+
- For Office documents only: [ibisOffice](https://github.com/ibisjp/ibis-office) or [LibreOffice](https://www.libreoffice.org/)
|
|
40
|
+
|
|
41
|
+
## Start
|
|
41
42
|
|
|
42
43
|
```bash
|
|
43
|
-
|
|
44
|
+
# Open the current directory
|
|
45
|
+
npx --yes @aaa_iii/fzv@latest
|
|
46
|
+
|
|
47
|
+
# Watch for changes and refresh the search index and open tabs
|
|
48
|
+
npx --yes @aaa_iii/fzv@latest --watch
|
|
49
|
+
|
|
50
|
+
# Open another directory
|
|
51
|
+
npx --yes @aaa_iii/fzv@latest --root ~/projects/example
|
|
44
52
|
```
|
|
45
53
|
|
|
46
|
-
|
|
54
|
+
Press `Ctrl+C` to stop.
|
|
47
55
|
|
|
48
|
-
|
|
56
|
+
The port is derived from the project path, in the range 20000–29999. The same project always gets the same URL, so the tabs, splits, and theme saved in your browser come back on the next run. If that port is taken, fzv starts on a free port and prints a warning. The URL then differs, so the previous session is not restored.
|
|
49
57
|
|
|
50
|
-
|
|
58
|
+
## Usage
|
|
51
59
|
|
|
52
|
-
###
|
|
60
|
+
### Find files
|
|
53
61
|
|
|
54
|
-
-
|
|
55
|
-
- HTML (`.html`, `.htm`): Viewer / Source 切り替え
|
|
56
|
-
- 画像: PNG、JPEG、GIF、WebP、AVIF、BMP、SVG、ICO。拡大・縮小・移動
|
|
57
|
-
- テキスト: Markdown、JSON、JavaScript、TypeScript、Python、Rust、Go、YAML、CSVなど。ソース表示とシンタックスハイライト
|
|
62
|
+
Press `/` or click "Find a file" to open search. With an empty query, it lists the files and directories at the project root. Selecting a directory moves into it; typing fuzzy-matches paths. Space-separated terms narrow results to paths that contain all of them.
|
|
58
63
|
|
|
59
|
-
|
|
64
|
+
The file list is rescanned in the background each time search opens, so files created after the page loaded show up too. While the rescan runs, you can keep searching the previous list.
|
|
60
65
|
|
|
61
|
-
|
|
66
|
+
Hidden files and directories, `node_modules`, and `__pycache__` are not listed.
|
|
62
67
|
|
|
63
|
-
|
|
68
|
+
### Tabs and splits
|
|
64
69
|
|
|
65
|
-
|
|
66
|
-
| ------------------- | -------------------------------------------------- |
|
|
67
|
-
| `/` | ファイル検索を開く |
|
|
68
|
-
| `↑` / `↓`, `Enter` | 検索結果を選択して開く |
|
|
69
|
-
| `Escape` | 検索やヘルプを閉じる、ヒントを解除 |
|
|
70
|
-
| `?` | キーボード操作一覧を表示 |
|
|
71
|
-
| `f` | 画面上のリンクや操作部品にジャンプするヒントを表示 |
|
|
72
|
-
| `h` `j` `k` `l` | プレビューをスクロール |
|
|
73
|
-
| `gg` / `G` | プレビューの先頭 / 末尾へ移動 |
|
|
74
|
-
| `r` | 選択中のプレビューを再取得 |
|
|
75
|
-
| `Alt+J` / `Alt+K` | 現在の領域で次 / 前のタブへ移動 |
|
|
76
|
-
| `Ctrl/Cmd+\` | 右に分割 |
|
|
77
|
-
| `Ctrl/Cmd+Shift+\` | 下に分割 |
|
|
78
|
-
| `Ctrl/Cmd+1` 〜 `9` | 分割領域へフォーカス |
|
|
70
|
+
Files open in tabs. Drag a tab to reorder it, or drop it on any edge to split the view. Hold `Ctrl` (`Option` on macOS) while dragging to copy the tab instead of moving it. Up to 32 split panes are supported, and the dividers can be dragged to resize them.
|
|
79
71
|
|
|
80
|
-
|
|
72
|
+
Open tabs, the split layout, and view modes are saved in the browser and restored on reload.
|
|
81
73
|
|
|
82
|
-
|
|
74
|
+
### Supported formats
|
|
83
75
|
|
|
84
|
-
|
|
76
|
+
| Format | Extensions | View |
|
|
77
|
+
| -------- | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------ |
|
|
78
|
+
| PDF | `.pdf` | Text selection, in-document search, zoom |
|
|
79
|
+
| HTML | `.html` `.htm` | Rendered in a sandbox; switchable to source |
|
|
80
|
+
| Markdown | `.md` | Rendered; switchable to source |
|
|
81
|
+
| Image | `.png` `.jpg` `.jpeg` `.gif` `.webp` `.avif` `.bmp` `.svg` `.ico` | Zoom and pan |
|
|
82
|
+
| Office | `.docx` `.xlsx` `.pptx` | Converted to PDF |
|
|
83
|
+
| Text | `.ts` `.js` `.py` `.rs` `.go` `.json` `.yaml` `.toml` `.tex` `.csv`, and more; `Makefile` `Dockerfile` | Source with line numbers and syntax highlighting |
|
|
85
84
|
|
|
86
|
-
|
|
87
|
-
npx --yes @aaa_iii/fzv@latest --root . --host 0.0.0.0 --port 8001
|
|
88
|
-
```
|
|
85
|
+
Files are limited to 20 MiB each. "Download" saves the current file in its original format.
|
|
89
86
|
|
|
90
|
-
|
|
87
|
+
## Keyboard shortcuts
|
|
91
88
|
|
|
92
|
-
|
|
89
|
+
| Keys | Action |
|
|
90
|
+
| ------------------------ | --------------------------------------------- |
|
|
91
|
+
| `/` | Open file search |
|
|
92
|
+
| `?` | Show all shortcuts |
|
|
93
|
+
| `f` | Label links and buttons; type a label to jump |
|
|
94
|
+
| `h` `j` `k` `l` | Scroll the preview |
|
|
95
|
+
| `gg` / `G` | Go to the top / bottom |
|
|
96
|
+
| `r` | Reload the current file |
|
|
97
|
+
| `Alt+J` / `Alt+K` | Next / previous tab in the same pane |
|
|
98
|
+
| `Ctrl/Cmd+\` | Split right |
|
|
99
|
+
| `Ctrl/Cmd+Shift+\` | Split down |
|
|
100
|
+
| `Ctrl/Cmd+1`–`9` | Focus a pane |
|
|
101
|
+
| `Ctrl/Cmd+F` | Search within a PDF |
|
|
102
|
+
| `Ctrl/Cmd` + `+` `-` `0` | Zoom images and PDFs (`0` fits to the view) |
|
|
103
|
+
| `Escape` | Close search, help, or labels |
|
|
93
104
|
|
|
94
|
-
|
|
105
|
+
Text fields keep their normal typing behavior. Shortcuts reserved by the browser take precedence.
|
|
95
106
|
|
|
96
|
-
##
|
|
107
|
+
## Office documents
|
|
108
|
+
|
|
109
|
+
`.docx`, `.xlsx`, and `.pptx` files are converted to PDF with a local ibisOffice or LibreOffice before display. At startup, fzv searches `PATH` for `ibisOffice`, `soffice`, and `libreoffice`, in that order, and also checks `/Applications` on macOS. The converter it finds is shown on the `Office` line of the startup message.
|
|
110
|
+
|
|
111
|
+
If the converter lives somewhere else, pass its path with `--office-converter`:
|
|
97
112
|
|
|
98
113
|
```bash
|
|
99
|
-
|
|
100
|
-
npm run build
|
|
101
|
-
node dist/server/cli.js --root . --watch
|
|
114
|
+
npx --yes @aaa_iii/fzv@latest --office-converter ~/Applications/ibisOffice-0.8.4-Linux.AppImage
|
|
102
115
|
```
|
|
103
116
|
|
|
104
|
-
|
|
117
|
+
Executables whose names start with `soffice` or `libreoffice` are run as LibreOffice; anything else is run as ibisOffice. Converted PDFs are cached by file content and regenerated when the content changes.
|
|
118
|
+
|
|
119
|
+
## Options
|
|
120
|
+
|
|
121
|
+
| Option | Default | Description |
|
|
122
|
+
| ------------------------- | ----------------------- | --------------------------------------------------------------------- |
|
|
123
|
+
| `--root PATH` | Current directory | Project root to open |
|
|
124
|
+
| `--host HOST` | `127.0.0.1` | Address to listen on |
|
|
125
|
+
| `--port PORT` | Derived from the path | `0` picks a free port. An explicit port that is in use stops startup |
|
|
126
|
+
| `--watch` | Off | Watch for changes and refresh the search index and open tabs |
|
|
127
|
+
| `--allow-html-network` | Off | Let HTML previews load external scripts and make network requests |
|
|
128
|
+
| `--office-converter PATH` | Auto-detected on `PATH` | ibisOffice or LibreOffice executable used to convert Office documents |
|
|
129
|
+
| `-h`, `--help` | | Show help |
|
|
130
|
+
| `-v`, `--version` | | Show the version |
|
|
131
|
+
|
|
132
|
+
## Security
|
|
133
|
+
|
|
134
|
+
By default fzv listens on `127.0.0.1` only, so it is reachable from this machine alone. To open it from another device on your LAN, set the listen address explicitly:
|
|
105
135
|
|
|
106
136
|
```bash
|
|
107
|
-
|
|
137
|
+
npx --yes @aaa_iii/fzv@latest --host 0.0.0.0 --port 8000
|
|
108
138
|
```
|
|
109
139
|
|
|
110
|
-
|
|
140
|
+
**Warning**: there is no authentication and no TLS. Anyone who can connect can read the viewable files in the project. Use it only on networks you trust.
|
|
141
|
+
|
|
142
|
+
- The server accepts only GET and HEAD and rejects cross-origin API requests.
|
|
143
|
+
- HTML previews run in a sandbox and cannot reach the fzv page or its storage. Inline scripts run, but external scripts and API requests are blocked by default. Images, CSS, and fonts may still load. Use `--allow-html-network` only for HTML you trust.
|
|
144
|
+
- Office documents are copied from the validated file into a temporary directory before conversion. The converter never reads project paths directly. The temporary directory is removed on exit.
|
|
145
|
+
|
|
146
|
+
## Status
|
|
147
|
+
|
|
148
|
+
fzv is in 0.x development. Options and shortcuts may change in minor releases.
|
|
149
|
+
|
|
150
|
+
## Run from source
|
|
111
151
|
|
|
112
152
|
```bash
|
|
113
|
-
npm
|
|
114
|
-
npm run
|
|
153
|
+
npm ci
|
|
154
|
+
npm run build
|
|
155
|
+
node dist/server/cli.js --watch
|
|
115
156
|
```
|
|
116
157
|
|
|
117
|
-
|
|
158
|
+
To work on the UI, keep the server running, run `npm run dev:ui` in another terminal, and open the URL Vite prints. Run the tests with `npm test` and `npm run test:browser`.
|
|
159
|
+
|
|
160
|
+
## License
|
|
118
161
|
|
|
119
|
-
MIT
|
|
162
|
+
[MIT](https://github.com/iiii1224/fzv/blob/main/LICENSE). Licenses for bundled components and the attribution for the fuzzy search implementation are in [THIRD_PARTY_NOTICES.md](https://github.com/iiii1224/fzv/blob/main/THIRD_PARTY_NOTICES.md).
|