Skip to content

Office Oxide CLI — クイックスタート

office-oxide は高速かつローカルで動く Office ドキュメント処理用のコマンドラインツールです。ライブラリと同じ Rust コアを同梱しています — クラウド不要、依存ゼロ。

インストール

Cargo(任意のプラットフォーム):

cargo install office_oxide_cli

cargo-binstall(pre-built バイナリ):

cargo binstall office_oxide_cli

ソースから:

git clone https://github.com/yfedoseev/office_oxide
cd office_oxide
cargo install --path crates/office_oxide_cli

インストールされるバイナリは office-oxide です。

クイックスタート

# プレーンテキストを抽出
office-oxide text report.docx

# Markdown に変換
office-oxide markdown data.xlsx -o data.md

# HTML に変換
office-oxide html slides.pptx -o slides.html

# フォーマット非依存の IR を JSON でダンプ
office-oxide ir document.docx -o document.ir.json

# レガシー DOC → モダン DOCX に変換
office-oxide convert old.doc modern.docx

フラグ全体は office-oxide --help、コマンドごとには office-oxide <command> --help を参照してください。

コマンド

コマンド 説明
text プレーン UTF-8 テキストを抽出
markdown GitHub-flavored Markdown に変換
html セマンティック HTML に変換
ir フォーマット非依存の IR を JSON でダンプ
convert フォーマット間変換(レガシー → OOXML、OOXML → OOXML)
info フォーマット、ページ/シート/スライド数、メタデータを表示

すべてのコマンドが 6 形式に対応: .docx.xlsx.pptx.doc.xls.ppt

グローバルオプション

-o, --output <PATH>   出力ファイル(テキスト出力では既定で stdout)
-v, --verbose         タイミング情報を表示
-q, --quiet           不要な出力を抑制
    --json            JSON エンベロープで出力をラップ

スプレッドシートからテキストを抽出:

office-oxide text quarterly.xlsx

レガシー .doc のコーパスを並列で移行:

find legacy/ -iname '*.doc' | \
  parallel 'office-oxide convert {} modern/{/.}.docx'

LLM パイプライン用にデッキを変換:

office-oxide markdown deck.pptx -o deck.md

ファイルの中身を確認:

office-oxide info mystery.bin
# format: xlsx, sheets: 4, named_ranges: 12, ...

jq で加工:

office-oxide ir report.docx | jq '.sections[].title'

stdin / stdout

textmarkdownhtmlir は既定で stdout に書き出します — パイプラインに便利:

office-oxide text report.docx | grep -i "executive summary"

--output を指定するとそのファイルに書き出されます。

関連項目