sjis_grep
Search Shift JIS/CP932 files or directories using JavaScript-compatible regex, with glob filtering and matches returned as lines or file paths. Use it instead of terminal grep/rg for legacy Japanese text.
Instructions
Shift JIS/CP932 エンコーディングのファイルやディレクトリから、指定した正規表現パターン(JavaScript/ECMAScript準拠)を検索します。terminal の grep/rg/find の代わりに使用してください。includeGlob でファイル名のglobパターン(例: '.ts', 'README.{md,txt}')に検索対象を絞り込めます。.git ディレクトリは常に除外されます。glob 未指定時はバイナリ形式(png/pdf/zip 等)のファイルも除外します。
outputMode に 'files_only' を指定するとマッチしたファイルパスの一覧のみを返します。context でマッチ行の前後に含める行数を指定できます(content モードのみ有効)。limit と offset で結果をページングできます(limit のデフォルトは100、content モードではマッチ行数、files_only ではファイル数を数えます)。
注意: 検索結果の行末コード(CRLF/LF/CR)は元のファイルのままです。マッチ行は行頭の空白も含め元の行のまま返します。正規表現として一致しない場合、パターンにメタ文字が含まれていればリテラル一致の件数をヒントとして返します。行が2000文字を超える場合は切り詰められます。
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"pattern": "<pattern>",
"path": "<path>"
},
"name": "sjis_grep"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | 検索対象のディレクトリまたはファイルの絶対パス | |
| limit | No | 返す結果の最大件数(content: マッチ行数、files_only: ファイル数、デフォルト: 100) | |
| offset | No | スキップする件数(デフォルト: 0) | |
| context | No | マッチ行の前後に含める行数(content モードのみ有効、デフォルト: 0) | |
| pattern | Yes | 検索する正規表現パターン(JavaScript準拠) | |
| ignoreCase | No | 大文字小文字を区別するかどうか(デフォルト: false) | |
| outputMode | No | 出力形式: 'content'(マッチ行と行番号、デフォルト)または 'files_only'(マッチしたファイルパスの一覧) | |
| includeGlob | No | 検索対象とするファイル名のglobパターン(例: '*.ts', 'README*.{md,txt}') |