rufio 0.60.0 → 0.62.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +56 -0
- data/README.md +221 -590
- data/README_ja.md +331 -0
- data/examples/bookmarks.yml +14 -0
- data/examples/config.rb +68 -0
- data/examples/script_paths.yml +11 -0
- data/lib/rufio/application.rb +1 -1
- data/lib/rufio/bookmark.rb +6 -30
- data/lib/rufio/bookmark_manager.rb +15 -1
- data/lib/rufio/bookmark_storage.rb +149 -0
- data/lib/rufio/command_mode.rb +4 -4
- data/lib/rufio/command_mode_ui.rb +8 -8
- data/lib/rufio/config.rb +268 -54
- data/lib/rufio/config_loader.rb +149 -26
- data/lib/rufio/keybind_handler.rb +14 -9
- data/lib/rufio/script_config_loader.rb +27 -12
- data/lib/rufio/script_path_manager.rb +50 -89
- data/lib/rufio/terminal_ui.rb +2 -2
- data/lib/rufio/version.rb +1 -1
- data/lib/rufio.rb +1 -0
- metadata +10 -17
- data/README_EN.md +0 -610
- data/config_example.rb +0 -88
- data/examples/config.yml +0 -8
- data/scripts/test_jobs/build_simulation.sh +0 -29
- data/scripts/test_jobs/deploy_simulation.sh +0 -37
- data/scripts/test_jobs/quick.sh +0 -11
- data/scripts/test_jobs/random_result.sh +0 -23
- data/scripts/test_jobs/slow_fail.sh +0 -10
- data/scripts/test_jobs/slow_success.sh +0 -10
- data/scripts/test_jobs/very_slow.sh +0 -19
- data/test_delete/test1.txt +0 -1
- data/test_delete/test2.txt +0 -1
data/README.md
CHANGED
|
@@ -1,720 +1,351 @@
|
|
|
1
1
|
# rufio
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
**日本語** | [English](./README_EN.md)
|
|
6
|
-
|
|
7
|
-
## 概要
|
|
8
|
-
|
|
9
|
-
rufioは、Yaziにインスパイアされたターミナル上で動作するファイルマネージャーです。Rubyで実装されており、DSLコマンドによる拡張機能を備えています。軽量で高速な操作性を提供し、ファイルの閲覧・管理・検索機能を備えています。
|
|
10
|
-
|
|
11
|
-
### 🚀 v0.60.0の重要な更新
|
|
12
|
-
|
|
13
|
-
- **⌨️ スクリプト補完機能**: コマンドモードでスクリプトのTab補完が可能に
|
|
14
|
-
- **🗑️ プロジェクトモード廃止**: `P`キーのプロジェクトモードを削除(ジョブモード`J`に機能統合予定)
|
|
15
|
-
- **🧹 コードクリーンアップ**: 未使用コードの削除でコードベースをスリム化
|
|
16
|
-
|
|
17
|
-
詳細は [CHANGELOG](./CHANGELOG.md) を参照してください。
|
|
18
|
-
|
|
19
|
-
## 特徴
|
|
20
|
-
|
|
21
|
-
- **軽量でシンプル**: Rubyで書かれた軽量なファイルマネージャー
|
|
22
|
-
- **直感的な操作**: Vimライクなキーバインド
|
|
23
|
-
- **DSLコマンドシステム** (v0.50.0): 拡張可能なDSLベースのコマンド定義
|
|
24
|
-
- **強力なコマンドモード** (v0.32.0):
|
|
25
|
-
- シェルコマンド実行 (`!ls`, `!git status` など)
|
|
26
|
-
- コマンド履歴(上下矢印キーでナビゲーション)
|
|
27
|
-
- インテリジェントなTab補完(候補リスト表示)
|
|
28
|
-
- DSLコマンドによる拡張可能なコマンド
|
|
29
|
-
- **バックグラウンドコマンド実行** (v0.33.0):
|
|
30
|
-
- `:!command` でシェルコマンドを非同期実行
|
|
31
|
-
- 実行中もrufioの操作が可能
|
|
32
|
-
- 完了時に通知メッセージを表示
|
|
33
|
-
- 実行結果を自動的にログファイルに保存
|
|
34
|
-
- **実行ログビューワ** (v0.33.0):
|
|
35
|
-
- `L`キーでコマンド実行ログを閲覧
|
|
36
|
-
- ログファイルのタイムスタンプ付き管理
|
|
37
|
-
- ヘルプモードと同様の直感的なUI
|
|
38
|
-
- **高速ファイルプレビュー** (v0.33.0最適化):
|
|
39
|
-
- 大幅な性能改善(40-86倍高速化)
|
|
40
|
-
- 大規模ファイルも瞬時に表示(< 2ms)
|
|
41
|
-
- スムーズなスクロールと快適な操作性
|
|
42
|
-
- **ファイル選択・操作**: 複数ファイルの選択、移動、コピー、削除が可能
|
|
43
|
-
- **リアルタイムフィルター**: sキーでファイル名の絞り込み表示
|
|
44
|
-
- **高度な検索機能**: fzfとrgaを使った強力な検索
|
|
45
|
-
- **マルチプラットフォーム**: macOS、Linux、Windowsで動作
|
|
46
|
-
- **外部エディタ連携**: お気に入りのエディタでファイルを開く
|
|
47
|
-
- **ヘルスチェック**: システム依存関係の確認機能
|
|
48
|
-
- **ステータスバー**: 処理時間、現在時刻、バージョン情報をリアルタイム表示
|
|
49
|
-
- **ブックマーク一覧表示**: フッタに1-9のブックマークを番号付きで表示
|
|
50
|
-
- **統合ヘルプシステム**: ?キーでキーバインド一覧とお知らせを表示
|
|
51
|
-
|
|
52
|
-
## インストール
|
|
3
|
+
**Runtime Unified Flow I/O Operator**
|
|
53
4
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
```
|
|
5
|
+
A TUI file manager that executes and coordinates tools and scripts from files.
|
|
6
|
+
Supports Ruby/Python/PowerShell and integrates your development workflow in one place.
|
|
57
7
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
```ruby
|
|
61
|
-
gem 'rufio'
|
|
62
|
-
```
|
|
8
|
+
[日本語](./README_ja.md) | **English**
|
|
63
9
|
|
|
64
|
-
##
|
|
10
|
+
## Concept
|
|
65
11
|
|
|
66
|
-
|
|
12
|
+
rufio is not just a file manager. It's a **tool runtime execution environment**.
|
|
67
13
|
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
rufio
|
|
14
|
+
```
|
|
15
|
+
┌─────────────────────────────────────────────────────────┐
|
|
16
|
+
│ rufio │
|
|
17
|
+
│ Runtime Unified Flow I/O Operator │
|
|
18
|
+
├─────────────────────────────────────────────────────────┤
|
|
19
|
+
│ Files ──→ Scripts ──→ Tools ──→ Output │
|
|
20
|
+
│ ↑ │ │
|
|
21
|
+
│ └───────────── Feedback ────────────┘ │
|
|
22
|
+
└─────────────────────────────────────────────────────────┘
|
|
71
23
|
```
|
|
72
24
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
#### 起動オプション
|
|
78
|
-
|
|
79
|
-
```bash
|
|
80
|
-
# デフォルト(Ruby実装 - 安定)
|
|
81
|
-
rufio
|
|
82
|
-
|
|
83
|
-
# ネイティブ実装を有効化(自動検出: Magnus > Zig > Rust > Go > Ruby)
|
|
84
|
-
rufio --native
|
|
85
|
-
rufio --native=auto
|
|
25
|
+
- **File Operations**: Traditional file manager functionality
|
|
26
|
+
- **Script Execution**: Run Ruby/Python/PowerShell scripts in file context
|
|
27
|
+
- **Tool Integration**: Seamless integration with external tools (git, fzf, rga, etc.)
|
|
28
|
+
- **Unified I/O**: Manage all input/output in a single flow
|
|
86
29
|
|
|
87
|
-
|
|
88
|
-
rufio --native=zig
|
|
30
|
+
## Features
|
|
89
31
|
|
|
90
|
-
|
|
91
|
-
rufio --native=rust
|
|
92
|
-
rufio --native rust /path/to/dir
|
|
32
|
+
### As a Tool Runtime
|
|
93
33
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
34
|
+
- **Multi-language Script Support**: Ruby, Python, PowerShell
|
|
35
|
+
- **Script Path Management**: Register and manage multiple script directories
|
|
36
|
+
- **Command Completion**: Tab completion for scripts with `@` prefix
|
|
37
|
+
- **Job Management**: Run scripts/commands in the background
|
|
38
|
+
- **Execution Logs**: Automatically record all execution results
|
|
97
39
|
|
|
98
|
-
|
|
99
|
-
RUFIO_NATIVE=zig rufio
|
|
100
|
-
RUFIO_NATIVE=rust rufio
|
|
101
|
-
RUFIO_NATIVE=go rufio /path/to/dir
|
|
102
|
-
```
|
|
40
|
+
### As a File Manager
|
|
103
41
|
|
|
104
|
-
|
|
42
|
+
- **Vim-like Key Bindings**: Intuitive navigation
|
|
43
|
+
- **Real-time Preview**: Instantly display file contents
|
|
44
|
+
- **Fast Search**: Integration with fzf/rga
|
|
45
|
+
- **Bookmarks**: Quick access to frequently used directories
|
|
46
|
+
- **zoxide Integration**: Smart directory history
|
|
105
47
|
|
|
106
|
-
|
|
107
|
-
- **Magnus (Rust)**: 最速、メモリ安全、FFI不要(バイナリ: 314 KB)
|
|
108
|
-
- **Rust (FFI)**: 高速、メモリ安全、JSON経由
|
|
109
|
-
- **Go (FFI)**: 高速、並行処理に優れる
|
|
110
|
-
- **Ruby実装** (デフォルト): 依存なし、安定動作保証
|
|
48
|
+
### Cross-platform
|
|
111
49
|
|
|
112
|
-
|
|
113
|
-
-
|
|
114
|
-
-
|
|
115
|
-
- Rust (FFI): 0.244 ms
|
|
116
|
-
- Zig: 0.253 ms(最小バイナリ)
|
|
50
|
+
- **macOS**: Native support
|
|
51
|
+
- **Linux**: Native support
|
|
52
|
+
- **Windows**: PowerShell script support
|
|
117
53
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
ネイティブ実装を使用するには、事前にビルドが必要です:
|
|
54
|
+
## Installation
|
|
121
55
|
|
|
122
56
|
```bash
|
|
123
|
-
|
|
124
|
-
cd lib_zig/rufio_native
|
|
125
|
-
make
|
|
126
|
-
|
|
127
|
-
# Rust実装のビルド
|
|
128
|
-
cd lib_rust/scanner
|
|
129
|
-
cargo build --release
|
|
130
|
-
make install
|
|
131
|
-
|
|
132
|
-
# Go実装のビルド
|
|
133
|
-
cd lib_go/scanner
|
|
134
|
-
make install
|
|
57
|
+
gem install rufio
|
|
135
58
|
```
|
|
136
59
|
|
|
137
|
-
|
|
138
|
-
- Zig: Zig 0.15.2以降(`brew install zig` または https://ziglang.org/)
|
|
139
|
-
- Rust: Cargo(`curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh`)
|
|
140
|
-
- Go: Go 1.16以降(`brew install go` または https://golang.org/)
|
|
60
|
+
Or add to your Gemfile:
|
|
141
61
|
|
|
142
|
-
|
|
62
|
+
```ruby
|
|
63
|
+
gem 'rufio'
|
|
64
|
+
```
|
|
143
65
|
|
|
144
|
-
|
|
145
|
-
- デフォルトではRuby実装を使用(`--native`オプションなし)
|
|
146
|
-
- ネイティブライブラリがない場合、自動的にRuby実装にフォールバック
|
|
147
|
-
- gemインストール時はネイティブライブラリが含まれます(ビルド不要)
|
|
66
|
+
## Quick Start
|
|
148
67
|
|
|
149
|
-
###
|
|
68
|
+
### 1. Launch
|
|
150
69
|
|
|
151
70
|
```bash
|
|
152
|
-
rufio
|
|
153
|
-
rufio
|
|
154
|
-
rufio --help # ヘルプメッセージを表示
|
|
71
|
+
rufio # Launch in current directory
|
|
72
|
+
rufio /path/to # Launch in specified directory
|
|
155
73
|
```
|
|
156
74
|
|
|
157
|
-
###
|
|
158
|
-
|
|
159
|
-
#### 基本ナビゲーション
|
|
160
|
-
|
|
161
|
-
| キー | 機能 |
|
|
162
|
-
| ------------- | ---------------------------------- |
|
|
163
|
-
| `j` | 下に移動 |
|
|
164
|
-
| `k` | 上に移動 |
|
|
165
|
-
| `h` | 親ディレクトリに移動 |
|
|
166
|
-
| `l` / `Enter` | ディレクトリに入る・ファイルを選択 |
|
|
75
|
+
### 2. Register Script Path
|
|
167
76
|
|
|
168
|
-
|
|
77
|
+
1. Navigate to the directory where you want to place scripts
|
|
78
|
+
2. `B` → `2` to add to script path
|
|
169
79
|
|
|
170
|
-
|
|
171
|
-
| ---- | ------------------ |
|
|
172
|
-
| `g` | リストの先頭に移動 |
|
|
173
|
-
| `G` | リストの末尾に移動 |
|
|
80
|
+
### 3. Execute Script
|
|
174
81
|
|
|
175
|
-
|
|
82
|
+
1. Press `:` to enter command mode
|
|
83
|
+
2. Type `@` + part of the script name
|
|
84
|
+
3. Press `Tab` to complete
|
|
85
|
+
4. Press `Enter` to execute
|
|
176
86
|
|
|
177
|
-
|
|
178
|
-
| ---- | -------------------------------------------------- |
|
|
179
|
-
| `o` | 選択中のファイルを外部エディタで開く |
|
|
180
|
-
| `e` | 現在のディレクトリをファイルエクスプローラーで開く |
|
|
181
|
-
| `R` | ディレクトリ内容を更新 |
|
|
182
|
-
| `r` | ファイル・ディレクトリ名をリネーム |
|
|
183
|
-
| `d` | ファイル・ディレクトリを削除(確認ダイアログ付き) |
|
|
184
|
-
| `a` | 新しいファイルを作成(ダイアログ入力) |
|
|
185
|
-
| `A` | 新しいディレクトリを作成(ダイアログ入力) |
|
|
87
|
+
## Key Bindings
|
|
186
88
|
|
|
187
|
-
|
|
89
|
+
### Basic Operations
|
|
188
90
|
|
|
189
|
-
|
|
|
190
|
-
|
|
191
|
-
| `
|
|
192
|
-
| `
|
|
193
|
-
| `
|
|
194
|
-
| `
|
|
91
|
+
| Key | Function |
|
|
92
|
+
|-----|----------|
|
|
93
|
+
| `j/k` | Move up/down |
|
|
94
|
+
| `h/l` | Parent/child directory |
|
|
95
|
+
| `g/G` | Top/bottom |
|
|
96
|
+
| `Enter` | Enter directory/open file |
|
|
97
|
+
| `q` | Quit |
|
|
195
98
|
|
|
196
|
-
|
|
99
|
+
### File Operations
|
|
197
100
|
|
|
198
|
-
|
|
|
199
|
-
|
|
200
|
-
| `
|
|
201
|
-
|
|
|
202
|
-
| `
|
|
203
|
-
| `
|
|
204
|
-
| `
|
|
101
|
+
| Key | Function |
|
|
102
|
+
|-----|----------|
|
|
103
|
+
| `Space` | Select/deselect |
|
|
104
|
+
| `o` | Open with external editor |
|
|
105
|
+
| `a/A` | Create file/directory |
|
|
106
|
+
| `r` | Rename |
|
|
107
|
+
| `d` | Delete |
|
|
108
|
+
| `m/c/x` | Move/copy/delete (selected) |
|
|
205
109
|
|
|
206
|
-
|
|
110
|
+
### Search & Filter
|
|
207
111
|
|
|
208
|
-
|
|
|
209
|
-
|
|
210
|
-
| `
|
|
211
|
-
| `
|
|
112
|
+
| Key | Function |
|
|
113
|
+
|-----|----------|
|
|
114
|
+
| `f` | Filter mode |
|
|
115
|
+
| `s` | Search files with fzf |
|
|
116
|
+
| `F` | Search file contents with rga |
|
|
212
117
|
|
|
213
|
-
|
|
118
|
+
### Navigation
|
|
214
119
|
|
|
215
|
-
|
|
|
216
|
-
|
|
217
|
-
| `b`
|
|
218
|
-
| `B`
|
|
219
|
-
| `0`
|
|
220
|
-
| `1
|
|
120
|
+
| Key | Function |
|
|
121
|
+
|-----|----------|
|
|
122
|
+
| `b` | Add bookmark |
|
|
123
|
+
| `B` | Bookmark menu |
|
|
124
|
+
| `0` | Return to startup directory |
|
|
125
|
+
| `1-9` | Jump to bookmark |
|
|
126
|
+
| `z` | zoxide history |
|
|
221
127
|
|
|
222
|
-
|
|
128
|
+
### Tool Runtime
|
|
223
129
|
|
|
224
|
-
|
|
|
225
|
-
|
|
226
|
-
|
|
|
130
|
+
| Key | Function |
|
|
131
|
+
|-----|----------|
|
|
132
|
+
| `:` | Command mode |
|
|
133
|
+
| `J` | Job mode |
|
|
134
|
+
| `L` | View execution logs |
|
|
135
|
+
| `?` | Help |
|
|
227
136
|
|
|
228
|
-
|
|
137
|
+
## Command Mode
|
|
229
138
|
|
|
230
|
-
|
|
231
|
-
| ---- | ---------------------------------- |
|
|
232
|
-
| `z` | zoxide履歴からディレクトリを選択移動 |
|
|
139
|
+
Press `:` to enter command mode and execute various commands.
|
|
233
140
|
|
|
234
|
-
|
|
141
|
+
### Script Execution
|
|
235
142
|
|
|
236
|
-
| キー | 機能 |
|
|
237
|
-
| ------ | ---------------------------------------- |
|
|
238
|
-
| `:` | コマンドモードを起動 |
|
|
239
|
-
| `Tab` | コマンド補完・候補リスト表示(コマンドモード中)|
|
|
240
|
-
| `↑` | 前のコマンドを表示(コマンドモード中) |
|
|
241
|
-
| `↓` | 次のコマンドを表示(コマンドモード中) |
|
|
242
|
-
| `Enter`| コマンドを実行(コマンドモード中) |
|
|
243
|
-
| `ESC` | コマンドモードをキャンセル(コマンドモード中) |
|
|
244
|
-
|
|
245
|
-
**シェルコマンド実行** (v0.32.0):
|
|
246
143
|
```
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
:!pwd # 現在のディレクトリを表示
|
|
144
|
+
:@build # @ prefix triggers script completion
|
|
145
|
+
:@deploy.rb # Execute registered script
|
|
250
146
|
```
|
|
251
147
|
|
|
252
|
-
|
|
253
|
-
- `:!command` でシェルコマンドを非同期実行
|
|
254
|
-
- 実行中もrufioの操作が可能
|
|
255
|
-
- 完了時に通知メッセージを3秒間表示
|
|
256
|
-
- 実行結果は自動的に `~/.config/rufio/log/` に保存
|
|
148
|
+
### Shell Commands
|
|
257
149
|
|
|
258
|
-
**DSLコマンド** (v0.50.0):
|
|
259
150
|
```
|
|
260
|
-
|
|
261
|
-
|
|
151
|
+
:!git status # ! prefix for shell commands
|
|
152
|
+
:!ls -la # Execute in background
|
|
262
153
|
```
|
|
263
154
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
| キー | 機能 |
|
|
267
|
-
| ---- | ---------------------------------- |
|
|
268
|
-
| `L` | コマンド実行ログを閲覧 |
|
|
269
|
-
| `ESC`| ログビューワモードを終了 |
|
|
270
|
-
|
|
271
|
-
コマンド実行ログは `~/.config/rufio/log/` に保存され、`L`キーで閲覧できます。
|
|
272
|
-
|
|
273
|
-
#### ヘルプ
|
|
274
|
-
|
|
275
|
-
| キー | 機能 |
|
|
276
|
-
| ---- | ---------------------------------- |
|
|
277
|
-
| `?` | キーバインド一覧とお知らせを表示 |
|
|
278
|
-
|
|
279
|
-
#### システム操作
|
|
280
|
-
|
|
281
|
-
| キー | 機能 |
|
|
282
|
-
| ---- | ------------ |
|
|
283
|
-
| `q` | rufioを終了 |
|
|
284
|
-
|
|
285
|
-
### ファイル選択・操作機能の詳細
|
|
286
|
-
|
|
287
|
-
#### ファイル・ディレクトリ選択 (`Space`)
|
|
288
|
-
|
|
289
|
-
- **選択・選択解除**: `Space`キーでファイルやディレクトリを選択・選択解除
|
|
290
|
-
- **複数選択**: 複数のファイルやディレクトリを同時に選択可能
|
|
291
|
-
- **視覚的表示**: 選択されたアイテムは✓マークと緑色の背景で表示
|
|
292
|
-
|
|
293
|
-
#### ファイル操作
|
|
294
|
-
|
|
295
|
-
| 操作 | キー | 機能 |
|
|
296
|
-
| ---------- | ---- | ---------------------------------------- |
|
|
297
|
-
| **移動** | `m` | 選択したアイテムをカレントディレクトリに移動 |
|
|
298
|
-
| **コピー** | `c` | 選択したアイテムをカレントディレクトリにコピー |
|
|
299
|
-
| **削除** | `x` | 選択したアイテムを削除 |
|
|
300
|
-
|
|
301
|
-
#### 削除操作の詳細
|
|
302
|
-
|
|
303
|
-
- **フローティングダイアログ確認**: モダンなフローティングウィンドウで明確な選択肢を表示
|
|
304
|
-
- **視覚的フィードバック**: 赤い枠線と警告色で注意を引く
|
|
305
|
-
- **安全な操作**: 削除前のダブルチェック
|
|
306
|
-
- **包括的エラーハンドリング**: 削除失敗時の詳細なエラーメッセージ
|
|
307
|
-
- **リアルタイム結果表示**: フローティングダイアログで成功/失敗数を表示
|
|
308
|
-
- **ファイルシステム検証**: 成功報告前に実際の削除を確認
|
|
309
|
-
- **デバッグサポート**: BENIYA_DEBUG=1でオプションのデバッグログ出力
|
|
310
|
-
|
|
311
|
-
#### 操作の流れ
|
|
155
|
+
### Built-in Commands
|
|
312
156
|
|
|
313
157
|
```
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
- m → カレントディレクトリに移動
|
|
317
|
-
- c → カレントディレクトリにコピー
|
|
318
|
-
- x → 削除
|
|
319
|
-
3. フローティングダイアログ → Y/Nで確認、ESCでキャンセル
|
|
320
|
-
4. 操作完了 → 選択解除、画面更新
|
|
158
|
+
:hello # Greeting message
|
|
159
|
+
:stop # Quit rufio
|
|
321
160
|
```
|
|
322
161
|
|
|
323
|
-
|
|
162
|
+
## Script Path
|
|
324
163
|
|
|
325
|
-
|
|
326
|
-
- **視覚警告システム**: 危険な操作時の赤い枠線と警告色
|
|
327
|
-
- **重複チェック**: 同名ファイルがある場合は自動でスキップ
|
|
328
|
-
- **エラーハンドリング**: 権限不足などのエラーに適切に対応
|
|
329
|
-
- **操作ログ**: フローティングダイアログで処理結果を詳細表示
|
|
330
|
-
- **削除後検証**: ファイルシステムから実際に削除されたことを確認
|
|
164
|
+
### What is Script Path?
|
|
331
165
|
|
|
332
|
-
|
|
166
|
+
A feature to register directories containing script files. Scripts in registered directories can be executed using the `@` prefix in command mode.
|
|
333
167
|
|
|
334
|
-
|
|
168
|
+
### Management
|
|
335
169
|
|
|
336
|
-
|
|
337
|
-
- **文字入力による絞り込み**: 日本語・英数字・記号に対応
|
|
338
|
-
- **リアルタイム更新**: 文字を入力するたびに表示が更新される
|
|
339
|
-
- **フィルター維持**: `Enter`キーでフィルターを保持したまま通常操作に戻る
|
|
340
|
-
- **フィルタークリア**: `ESC`キーでフィルターをクリアして通常表示に戻る
|
|
341
|
-
- **再編集**: フィルター適用中に`f`キーで再編集モード
|
|
342
|
-
- **文字削除**: `Backspace`で文字削除、全削除時は自動でフィルタークリア
|
|
170
|
+
Press `B` → `3` to open the script path management menu:
|
|
343
171
|
|
|
344
|
-
|
|
172
|
+
- View registered paths
|
|
173
|
+
- `d`: Remove path
|
|
174
|
+
- `Enter`: Jump to directory
|
|
175
|
+
- `ESC`: Close menu
|
|
345
176
|
|
|
346
|
-
|
|
347
|
-
1. f → フィルターモード開始
|
|
348
|
-
2. ".rb" → Rubyファイルのみ表示
|
|
349
|
-
3. Enter → フィルター維持で通常操作
|
|
350
|
-
4. j/k → フィルター結果内をナビゲーション
|
|
351
|
-
5. f → フィルター再編集
|
|
352
|
-
6. ESC → フィルタークリア
|
|
353
|
-
```
|
|
354
|
-
|
|
355
|
-
### 検索機能の詳細
|
|
356
|
-
|
|
357
|
-
#### ファイル名検索 (`s`)
|
|
358
|
-
|
|
359
|
-
- `fzf`を使用したインタラクティブなファイル名検索
|
|
360
|
-
- リアルタイムプレビュー表示
|
|
361
|
-
- 選択したファイルは自動で外部エディタで開かれる
|
|
362
|
-
|
|
363
|
-
#### ファイル内容検索 (`F`)
|
|
364
|
-
|
|
365
|
-
- `rga`(ripgrep-all)を使用した高度なファイル内容検索
|
|
366
|
-
- PDF、Word文書、画像内テキストなども検索対象
|
|
367
|
-
- 検索結果をfzfで絞り込み、該当行にジャンプしてファイルを開く
|
|
368
|
-
|
|
369
|
-
### ブックマーク機能の詳細
|
|
370
|
-
|
|
371
|
-
#### ブックマーク操作
|
|
372
|
-
|
|
373
|
-
**通常モード:**
|
|
374
|
-
- **`b`キー**: 現在のディレクトリをブックマークに追加
|
|
375
|
-
- ディレクトリ名がタイトルに表示される
|
|
376
|
-
- ブックマーク名を入力して追加
|
|
377
|
-
- 重複パスは自動検出
|
|
378
|
-
- 緑色のダイアログで表示(作成操作)
|
|
379
|
-
|
|
380
|
-
**ブックマークメニュー (`B`キー):**
|
|
381
|
-
- **`1`**: 現在のディレクトリをブックマークに追加
|
|
382
|
-
- **`2`**: 現在のディレクトリをスクリプトパスに追加
|
|
383
|
-
- **`3`**: スクリプトパスを管理(一覧表示、削除、ジャンプ)
|
|
384
|
-
- **`4`**: ブックマーク一覧を表示
|
|
385
|
-
|
|
386
|
-
#### 高速ナビゲーション (`1`-`9`)
|
|
387
|
-
|
|
388
|
-
- 数字キーでブックマークに直接ジャンプ
|
|
389
|
-
- 最大9個のブックマークをサポート
|
|
390
|
-
- ブックマーク情報は画面上部に表示
|
|
391
|
-
|
|
392
|
-
#### ブックマークの永続化
|
|
393
|
-
|
|
394
|
-
- ブックマーク情報は `~/.config/rufio/bookmarks.json` に自動保存
|
|
395
|
-
- rufio再起動後もブックマーク情報が保持される
|
|
396
|
-
- 名前の前後のスペースは自動削除されて保存される
|
|
397
|
-
- JSONファイルを直接編集することも可能
|
|
398
|
-
|
|
399
|
-
### スクリプトパス機能の詳細
|
|
400
|
-
|
|
401
|
-
#### スクリプトパスとは
|
|
402
|
-
|
|
403
|
-
スクリプトパスは、スクリプトファイルを配置するディレクトリを登録する機能です。登録したディレクトリ内のスクリプトは、コマンドモードで`@`プレフィックスを使って実行できます。
|
|
404
|
-
|
|
405
|
-
#### スクリプトパスの管理 (`B` → `3`)
|
|
406
|
-
|
|
407
|
-
- **一覧表示**: 登録済みのスクリプトパスを一覧表示
|
|
408
|
-
- **j/k**: カーソル移動
|
|
409
|
-
- **d**: 選択したパスを削除
|
|
410
|
-
- **Enter**: 選択したディレクトリにジャンプ
|
|
411
|
-
- **ESC**: メニューを閉じる
|
|
177
|
+
### Supported Scripts
|
|
412
178
|
|
|
413
|
-
|
|
179
|
+
| Extension | Language |
|
|
180
|
+
|-----------|----------|
|
|
181
|
+
| `.rb` | Ruby |
|
|
182
|
+
| `.py` | Python |
|
|
183
|
+
| `.ps1` | PowerShell |
|
|
184
|
+
| `.sh` | Shell (bash/zsh) |
|
|
414
185
|
|
|
415
|
-
|
|
186
|
+
## DSL Commands
|
|
416
187
|
|
|
417
|
-
|
|
418
|
-
- 例: `@bu` + Tab → `@build.sh`
|
|
419
|
-
- **通常補完**: 内部コマンドとスクリプト両方を候補に表示
|
|
188
|
+
Define custom commands in `~/.config/rufio/commands.rb`:
|
|
420
189
|
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
- **赤色ダイアログ**: 削除操作
|
|
427
|
-
- **マゼンタダイアログ**: スクリプトパス管理
|
|
190
|
+
```ruby
|
|
191
|
+
command "hello" do
|
|
192
|
+
ruby { "Hello from rufio!" }
|
|
193
|
+
description "Greeting command"
|
|
194
|
+
end
|
|
428
195
|
|
|
429
|
-
|
|
196
|
+
command "status" do
|
|
197
|
+
shell "git status"
|
|
198
|
+
description "Git status"
|
|
199
|
+
end
|
|
430
200
|
|
|
431
|
-
|
|
201
|
+
command "build" do
|
|
202
|
+
script "~/.config/rufio/scripts/build.rb"
|
|
203
|
+
description "Run build"
|
|
204
|
+
end
|
|
205
|
+
```
|
|
432
206
|
|
|
433
|
-
|
|
434
|
-
- **フリークエンシー順**: よく使用するディレクトリほど上位に表示
|
|
435
|
-
- **インタラクティブ選択**: フローティングウィンドウで履歴を選択
|
|
436
|
-
- **高速ナビゲーション**: 数字キーで直接ディレクトリを選択
|
|
437
|
-
- **パス省略表示**: ホームディレクトリを`~`で表示し見やすく
|
|
207
|
+
## Configuration
|
|
438
208
|
|
|
439
|
-
|
|
209
|
+
### Configuration File Structure
|
|
440
210
|
|
|
441
211
|
```
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
212
|
+
~/.config/rufio/
|
|
213
|
+
├── config.rb # DSL-style main configuration
|
|
214
|
+
├── script_paths.yml # Script directories (list format)
|
|
215
|
+
├── bookmarks.yml # Bookmarks (list format)
|
|
216
|
+
├── commands.rb # DSL command definitions
|
|
217
|
+
├── scripts/ # Script files
|
|
218
|
+
└── logs/ # Execution logs
|
|
445
219
|
```
|
|
446
220
|
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
[zoxide](https://github.com/ajeetdsouza/zoxide)は、ディレクトリ移動履歴を学習するスマートなcdコマンドです。
|
|
221
|
+
### config.rb (DSL Configuration)
|
|
450
222
|
|
|
451
|
-
```
|
|
452
|
-
#
|
|
453
|
-
# macOS (Homebrew)
|
|
454
|
-
brew install zoxide
|
|
223
|
+
```ruby
|
|
224
|
+
# ~/.config/rufio/config.rb
|
|
455
225
|
|
|
456
|
-
#
|
|
457
|
-
|
|
226
|
+
# Language setting: 'en' or 'ja'
|
|
227
|
+
LANGUAGE = 'ja'
|
|
458
228
|
|
|
459
|
-
#
|
|
460
|
-
|
|
229
|
+
# Color settings (HSL format)
|
|
230
|
+
COLORS = {
|
|
231
|
+
directory: { hsl: [220, 80, 60] },
|
|
232
|
+
file: { hsl: [0, 0, 90] },
|
|
233
|
+
executable: { hsl: [120, 70, 50] },
|
|
234
|
+
selected: { hsl: [50, 90, 70] },
|
|
235
|
+
preview: { hsl: [180, 60, 65] }
|
|
236
|
+
}.freeze
|
|
237
|
+
|
|
238
|
+
# Keybind settings
|
|
239
|
+
KEYBINDS = {
|
|
240
|
+
quit: %w[q ESC],
|
|
241
|
+
up: %w[k UP],
|
|
242
|
+
down: %w[j DOWN]
|
|
243
|
+
}.freeze
|
|
461
244
|
```
|
|
462
245
|
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
- zoxideがシステムにインストールされている必要があります
|
|
466
|
-
- zoxideが無効な場合は適切なメッセージが表示されます
|
|
467
|
-
- 履歴が空の場合も適切にハンドリングされます
|
|
468
|
-
|
|
469
|
-
### コマンドモードの詳細
|
|
470
|
-
|
|
471
|
-
#### コマンドモードの起動 (`:`)
|
|
472
|
-
|
|
473
|
-
- `:`キーを押してコマンドモードを起動
|
|
474
|
-
- 画面最下部にコマンド入力欄が表示される
|
|
475
|
-
- プラグインが提供するコマンドを実行できる
|
|
246
|
+
### script_paths.yml
|
|
476
247
|
|
|
477
|
-
|
|
248
|
+
```yaml
|
|
249
|
+
# ~/.config/rufio/script_paths.yml
|
|
250
|
+
- ~/.config/rufio/scripts
|
|
251
|
+
- ~/bin
|
|
252
|
+
- ~/scripts
|
|
253
|
+
```
|
|
478
254
|
|
|
479
|
-
|
|
480
|
-
- **複数候補の処理**: 複数のコマンドが一致する場合は共通プレフィックスまで補完
|
|
481
|
-
- **単一候補の自動完成**: 一つだけマッチする場合は完全に補完される
|
|
482
|
-
- **リアルタイム更新**: 入力内容に応じて候補が動的に変化
|
|
255
|
+
### bookmarks.yml
|
|
483
256
|
|
|
484
|
-
|
|
257
|
+
```yaml
|
|
258
|
+
# ~/.config/rufio/bookmarks.yml
|
|
259
|
+
- path: ~/Documents
|
|
260
|
+
name: Documents
|
|
261
|
+
- path: ~/projects
|
|
262
|
+
name: Projects
|
|
263
|
+
```
|
|
485
264
|
|
|
486
|
-
|
|
487
|
-
- **色分けされた結果**:
|
|
488
|
-
- **緑色のボーダー**: コマンドが正常に実行された場合
|
|
489
|
-
- **赤色のボーダー**: エラーまたは警告が発生した場合
|
|
490
|
-
- **中央配置**: 画面中央に自動的に配置され視認性が高い
|
|
491
|
-
- **自動サイズ調整**: 結果の内容に応じてウィンドウサイズが自動調整
|
|
492
|
-
- **簡単に閉じる**: 任意のキーを押すとウィンドウを閉じて通常操作に戻る
|
|
265
|
+
### Local Configuration
|
|
493
266
|
|
|
494
|
-
|
|
267
|
+
Place `rufio.yml` in your project root for project-specific script paths:
|
|
495
268
|
|
|
496
|
-
```
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
5. フローティングウィンドウで結果を確認
|
|
502
|
-
6. 任意のキーを押してウィンドウを閉じる
|
|
269
|
+
```yaml
|
|
270
|
+
# ./rufio.yml (project root)
|
|
271
|
+
script_paths:
|
|
272
|
+
- ./scripts
|
|
273
|
+
- ./bin
|
|
503
274
|
```
|
|
504
275
|
|
|
505
|
-
|
|
276
|
+
## External Tool Integration
|
|
506
277
|
|
|
507
|
-
|
|
278
|
+
rufio integrates with the following external tools to extend functionality:
|
|
508
279
|
|
|
509
|
-
|
|
280
|
+
| Tool | Purpose | Key |
|
|
281
|
+
|------|---------|-----|
|
|
282
|
+
| fzf | File name search | `s` |
|
|
283
|
+
| rga | File content search | `F` |
|
|
284
|
+
| zoxide | Directory history | `z` |
|
|
510
285
|
|
|
511
|
-
|
|
286
|
+
### Installation
|
|
512
287
|
|
|
513
288
|
```bash
|
|
514
|
-
# macOS
|
|
289
|
+
# macOS
|
|
515
290
|
brew install fzf rga zoxide
|
|
516
291
|
|
|
517
292
|
# Ubuntu/Debian
|
|
518
293
|
apt install fzf zoxide
|
|
519
|
-
# rga
|
|
520
|
-
|
|
521
|
-
# その他のLinuxディストリビューション
|
|
522
|
-
# パッケージマネージャーまたは手動インストールが必要
|
|
523
|
-
```
|
|
524
|
-
|
|
525
|
-
#### 各ツールの用途
|
|
526
|
-
|
|
527
|
-
- **fzf**: ファイル名検索機能(`s`キー)
|
|
528
|
-
- **rga**: ファイル内容検索機能(`F`キー)
|
|
529
|
-
- **zoxide**: ディレクトリ履歴移動機能(`z`キー)
|
|
530
|
-
|
|
531
|
-
## 設定
|
|
532
|
-
|
|
533
|
-
### 色設定(カスタマイズ)
|
|
534
|
-
|
|
535
|
-
rufioではファイルタイプや UI 要素の色をカスタマイズできます。HSLカラーモデルによる直感的な色指定をサポートしています。
|
|
536
|
-
|
|
537
|
-
#### サポートされる色形式
|
|
538
|
-
|
|
539
|
-
```ruby
|
|
540
|
-
# HSL(色相・彩度・明度)- 推奨形式
|
|
541
|
-
{hsl: [220, 80, 60]} # 色相220度、彩度80%、明度60%
|
|
542
|
-
|
|
543
|
-
# RGB(赤・緑・青)
|
|
544
|
-
{rgb: [100, 150, 200]}
|
|
545
|
-
|
|
546
|
-
# HEX(16進数)
|
|
547
|
-
{hex: "#6496c8"}
|
|
548
|
-
|
|
549
|
-
# 従来のシンボル
|
|
550
|
-
:blue, :red, :green, :yellow, :cyan, :magenta, :white, :black
|
|
551
|
-
|
|
552
|
-
# ANSIカラーコード
|
|
553
|
-
"34" または 34
|
|
554
|
-
```
|
|
555
|
-
|
|
556
|
-
#### 設定例
|
|
557
|
-
|
|
558
|
-
```ruby
|
|
559
|
-
# ~/.config/rufio/config.rb
|
|
560
|
-
COLORS = {
|
|
561
|
-
# HSLでの色指定(直感的で調整しやすい)
|
|
562
|
-
directory: {hsl: [220, 80, 60]}, # 青系でディレクトリ
|
|
563
|
-
file: {hsl: [0, 0, 90]}, # 薄いグレーで通常ファイル
|
|
564
|
-
executable: {hsl: [120, 70, 50]}, # 緑系で実行ファイル
|
|
565
|
-
selected: {hsl: [50, 90, 70]}, # 黄色で選択項目
|
|
566
|
-
preview: {hsl: [180, 60, 65]}, # シアンでプレビュー
|
|
567
|
-
|
|
568
|
-
# 他の形式も併用可能
|
|
569
|
-
# directory: :blue, # シンボル
|
|
570
|
-
# file: {rgb: [200, 200, 200]}, # RGB
|
|
571
|
-
# executable: {hex: "#00aa00"}, # HEX
|
|
572
|
-
}
|
|
573
|
-
```
|
|
574
|
-
|
|
575
|
-
#### HSLカラーモデルについて
|
|
576
|
-
|
|
577
|
-
- **色相(Hue)**: 0-360度(0=赤、120=緑、240=青)
|
|
578
|
-
- **彩度(Saturation)**: 0-100%(0=グレー、100=鮮やか)
|
|
579
|
-
- **明度(Lightness)**: 0-100%(0=黒、50=標準、100=白)
|
|
580
|
-
|
|
581
|
-
#### 設定可能な項目
|
|
582
|
-
|
|
583
|
-
- `directory`: ディレクトリの色
|
|
584
|
-
- `file`: 通常ファイルの色
|
|
585
|
-
- `executable`: 実行可能ファイルの色
|
|
586
|
-
- `selected`: 選択中の項目の色
|
|
587
|
-
- `preview`: プレビューパネルの色
|
|
588
|
-
|
|
589
|
-
## DSLコマンドシステム
|
|
590
|
-
|
|
591
|
-
rufioはDSLベースのコマンドシステムを備えており、独自のコマンドを簡単に追加できます。
|
|
592
|
-
|
|
593
|
-
### コマンド定義ファイル
|
|
594
|
-
|
|
595
|
-
ユーザー定義コマンドは以下のファイルに記述します:
|
|
596
|
-
|
|
597
|
-
```
|
|
598
|
-
~/.config/rufio/commands.rb
|
|
294
|
+
# rga requires separate installation: https://github.com/phiresky/ripgrep-all
|
|
599
295
|
```
|
|
600
296
|
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
#### Rubyコードを実行するコマンド
|
|
604
|
-
|
|
605
|
-
```ruby
|
|
606
|
-
# ~/.config/rufio/commands.rb
|
|
607
|
-
command "hello" do
|
|
608
|
-
ruby { "Hello from rufio!" }
|
|
609
|
-
description "挨拶コマンド"
|
|
610
|
-
end
|
|
297
|
+
## Advanced Features
|
|
611
298
|
|
|
612
|
-
|
|
613
|
-
ruby { Time.now.strftime("%Y-%m-%d %H:%M:%S") }
|
|
614
|
-
description "現在時刻を表示"
|
|
615
|
-
end
|
|
616
|
-
```
|
|
299
|
+
### Native Scanner (Experimental)
|
|
617
300
|
|
|
618
|
-
|
|
301
|
+
Support for native implementation for fast directory scanning:
|
|
619
302
|
|
|
620
|
-
```
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
description "Gitステータスを表示"
|
|
624
|
-
end
|
|
625
|
-
|
|
626
|
-
command "disk" do
|
|
627
|
-
shell "df -h"
|
|
628
|
-
description "ディスク使用量を表示"
|
|
629
|
-
end
|
|
303
|
+
```bash
|
|
304
|
+
rufio --native # Auto-detect
|
|
305
|
+
rufio --native=zig # Zig implementation
|
|
630
306
|
```
|
|
631
307
|
|
|
632
|
-
|
|
308
|
+
### JIT Compiler
|
|
633
309
|
|
|
634
|
-
```
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
description "プロジェクトをビルド"
|
|
638
|
-
end
|
|
310
|
+
```bash
|
|
311
|
+
rufio --yjit # Ruby 3.1+ YJIT
|
|
312
|
+
rufio --zjit # Ruby 3.4+ ZJIT
|
|
639
313
|
```
|
|
640
314
|
|
|
641
|
-
###
|
|
642
|
-
|
|
643
|
-
1. rufioを起動
|
|
644
|
-
2. `:`キーでコマンドモードを起動
|
|
645
|
-
3. コマンド名を入力(または一部を入力してTabキーで補完)
|
|
646
|
-
4. Enterキーで実行
|
|
647
|
-
5. フローティングウィンドウに結果が表示される
|
|
648
|
-
|
|
649
|
-
### 組み込みコマンド
|
|
650
|
-
|
|
651
|
-
rufioには以下のコマンドがデフォルトで組み込まれています:
|
|
652
|
-
|
|
653
|
-
| コマンド | 説明 |
|
|
654
|
-
| -------- | ---- |
|
|
655
|
-
| `hello` | 挨拶メッセージを表示 |
|
|
656
|
-
| `stop` | rufioを終了 |
|
|
657
|
-
| `touch` | ファイルを作成 |
|
|
658
|
-
| `mkdir` | ディレクトリを作成 |
|
|
659
|
-
|
|
660
|
-
### DSLコマンドの種類
|
|
661
|
-
|
|
662
|
-
1. **ruby**: Rubyコードをインラインで実行
|
|
663
|
-
2. **shell**: シェルコマンドを実行
|
|
664
|
-
3. **script**: 外部スクリプトファイルを実行
|
|
315
|
+
### Health Check
|
|
665
316
|
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
~/.config/rufio/
|
|
670
|
-
├── config.rb # カラー設定
|
|
671
|
-
├── commands.rb # DSLコマンド定義
|
|
672
|
-
├── bookmarks.json # ブックマーク
|
|
673
|
-
├── scripts/ # スクリプトファイル
|
|
674
|
-
└── log/ # 実行ログ
|
|
317
|
+
```bash
|
|
318
|
+
rufio -c # Check system dependencies
|
|
319
|
+
rufio --check-health # Same as above
|
|
675
320
|
```
|
|
676
321
|
|
|
677
|
-
##
|
|
322
|
+
## Development
|
|
678
323
|
|
|
679
|
-
###
|
|
324
|
+
### Requirements
|
|
680
325
|
|
|
681
|
-
- Ruby 2.7.0
|
|
326
|
+
- Ruby 2.7.0 or later
|
|
682
327
|
- io-console, pastel, tty-cursor, tty-screen gems
|
|
683
328
|
|
|
684
|
-
###
|
|
329
|
+
### Running Development Version
|
|
685
330
|
|
|
686
331
|
```bash
|
|
687
332
|
git clone https://github.com/masisz/rufio
|
|
688
333
|
cd rufio
|
|
689
334
|
bundle install
|
|
690
|
-
./
|
|
335
|
+
./bin/rufio
|
|
691
336
|
```
|
|
692
337
|
|
|
693
|
-
###
|
|
338
|
+
### Testing
|
|
694
339
|
|
|
695
340
|
```bash
|
|
696
341
|
bundle exec rake test
|
|
697
342
|
```
|
|
698
343
|
|
|
699
|
-
##
|
|
700
|
-
|
|
701
|
-
- **macOS**: ネイティブサポート
|
|
702
|
-
- **Linux**: ネイティブサポート
|
|
703
|
-
- **Windows**: 基本機能をサポート
|
|
704
|
-
|
|
705
|
-
## ライセンス
|
|
344
|
+
## License
|
|
706
345
|
|
|
707
346
|
MIT License
|
|
708
347
|
|
|
709
|
-
##
|
|
710
|
-
|
|
711
|
-
バグ報告や機能リクエストは[GitHub Issues](https://github.com/masisz/rufio/issues)でお願いします。
|
|
712
|
-
|
|
713
|
-
プルリクエストも歓迎です!
|
|
714
|
-
|
|
715
|
-
### 開発ガイドライン
|
|
348
|
+
## Contributing
|
|
716
349
|
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
3. 必要に応じてドキュメントを更新する
|
|
720
|
-
4. 可能であれば複数のプラットフォームでテストする
|
|
350
|
+
Bug reports and feature requests are welcome at [GitHub Issues](https://github.com/masisz/rufio/issues).
|
|
351
|
+
Pull requests are also welcome!
|