ジョブとファイル

files

orc files は、Workspace に保存したファイルの用途や所有者で一覧を絞り込み、メタデータを登録・取得し、ファイル内容をアップロードするコマンドです。保存済みのファイルは ID で管理できます。

実行には認証と Workspace の選択が必要です。ファイルの登録情報を作る create と、実際のバイナリを送る content update は別の操作です。バイナリのアップロードには JSON の --stdin ではなく --file を使用します。

orc files upload-url create は、ファイルを送るための署名付き URL を発行します。返された URL にファイルを PUT で送り、返された公開 URL を --image-urls、--image-url、--audio-url などの入力に指定します。

ファイルの種類、サイズ、保持期間はアップロードを参照してください。

使い方

terminal
orc files list --json

ワークスペースのファイルを一覧表示します。

サブコマンド

list

用途や所有者で絞り込んで一覧にします。Issue の添付を取得する場合は --owner-type issue と --owner-id を組み合わせます。--order は作成日時と ID の asc または desc で、--limit と --cursor でページを指定します。

terminal
orc files list [options]

固有のオプション

--purpose

Include only files with this purpose. Omit for all purposes in the workspace.; enum: agent-context|brand-asset|chat-attachment|document|screenshot|export|profile-image|docs-asset|domain-favicon

型: string。任意。

terminal
orc files list --purpose <value>
--owner-type

Owner type for an ownership filter. Must be paired with one or
more repeated owner_id values. Issue attachments use issue.; enum: issue

型: string。任意。

terminal
orc files list --owner-type <value>
--owner-id

Owner ID values for an ownership filter. Repeat this parameter
to return files owned by any of several issues in one read.; csv

型: string。任意。

terminal
orc files list --owner-id <value>
--order

Sort order by created_at, then id.; enum: asc|desc

型: string。任意。

terminal
orc files list --order <value>

create

purpose、filename、mime_type、byte_size を指定してファイルの登録情報を作成します。sha256、JSON の metadata、構造化した owner_ref も指定できます。Issue 添付の owner_ref は種類 issue と Issue ID を使用します。

terminal
orc files create [options]

固有のオプション

--idempotency-key

Retry identity for operations that support idempotency. Use a unique key for each new operation, and reuse it only when retrying the same HTTP method, path, query values and exact request body. JSON whitespace changes can count as a different body. Keys contain 1–255 characters after trimming and expire after 24 hours. A completed JSON response is replayed without repeating the operation. A different request using the same key returns 409 idempotency_error. An in-progress request returns 409 idempotency_in_progress with Retry-After: 2. Whether this header is required depends on the operation.

型: string。任意。

terminal
orc files create --idempotency-key <value>
--purpose

(required) File usage category. Determines applicable upload policy. Use document for a general document or chat-attachment for an attachment.; enum: agent-context|brand-asset|chat-attachment|document|screenshot|export|profile-image|docs-asset|domain-favicon

型: string。任意。

terminal
orc files create --purpose <value>
--filename

(required) Display filename. Leading and trailing whitespace is removed; the result must not be empty.

型: string。任意。

terminal
orc files create --filename <value>
--mime-type

(required) MIME type of the binary content, such as text/plain. Accepted types depend on purpose.

型: string。任意。

terminal
orc files create --mime-type <value>
--byte-size

(required) Expected binary content size in bytes. Must be a non-negative integer; purpose-specific size limits also apply.

型: number。任意。

terminal
orc files create --byte-size <value>
--copy-from

Copy an uploaded docs-asset video in the same workspace without transferring its bytes. Supply matching purpose, mime_type and byte_size, and the desired filename. The new independent record references the same immutable storage object; no upload is required.

型: string。任意。

terminal
orc files create --copy-from <value>
--sha256

Optional 64-character hexadecimal hash for workspace-scoped deduplication. Normalized to lowercase. Omit to register a new storage key.

型: string。任意。

terminal
orc files create --sha256 <value>
--metadata

Optional caller-defined metadata object. Defaults to {}.; (JSON object, e.g. '{"custom_id":"x"}')

型: string。任意。

terminal
orc files create --metadata <value>
--owner-ref

Optional ownership reference. Issue attachments must use
{ "type": "issue", "id": "<issue id>" }.

型: string。任意。

terminal
orc files create --owner-ref <value>

get

ファイル ID を指定してメタデータを取得します。バイナリ内容の取得とは別の操作です。

terminal
orc files get <file-id> [options]

content get

ファイル ID を指定して内容取得 API を呼び出します。現在の CLI の応答処理はテキストを経由するため、画像などのバイナリを原本どおり保存する用途には使用しないでください。

terminal
orc files content get <file-id> [options]

content update

ファイル ID と --file にローカルファイルのパスを指定してバイナリ内容を送信します。--file が必須で、--stdin との併用は拒否されます。

terminal
orc files content update <file-id> [options]

固有のオプション

--file

Path to the local file to upload as binary content

型: string。必須。

terminal
orc files content update <file-id> --file <value>

upload-url create

アップロード URL を発行

terminal
orc files upload-url create [options]

固有のオプション

--content-type

ファイルの MIME タイプ。省略する場合は対応する拡張子を含む filename が必要です。

型: string。任意。

terminal
orc files upload-url create --content-type <value>
--size-bytes

(required) ファイルの正確なサイズ。単位はバイト。

型: number。任意。

terminal
orc files upload-url create --size-bytes <value>
--filename

元ファイルの名前。1〜255 文字。content_type を省略する場合は必須です。; max 255 chars

型: string。任意。

terminal
orc files upload-url create --filename <value>

使用例

ファイル ID のメタデータを確認します。

terminal
orc files get FILE_ID --json

ファイル ID のメタデータを確認します。

登録済みファイルへローカルの内容をアップロードします。

terminal
orc files content update FILE_ID --file ./document.pdf --json

登録済みファイルへローカルの内容をアップロードします。

PNG のアップロード先を発行します。

terminal
orc files upload-url create --content-type image/png --size-bytes 204800 --filename input.png --json

PNG のアップロード先を発行します。

発行した URL へファイルを送ります。

terminal
curl -X PUT --upload-file input.png -H "Content-Type: image/png" "<upload-url>"

発行した URL へファイルを送ります。

グローバルオプション

orc files では、次のグローバルオプションを使用できます。

各オプションの詳細と使用例は、グローバルオプションを参照してください。