Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.mirage.strukto.ai/llms.txt

Use this file to discover all available pages before exploring further.

The OCI resource exposes an Oracle Cloud Infrastructure Object Storage bucket as a virtual filesystem. It uses the S3-compatible API internally. For credential setup, see OCI Setup.

Config

import os

from mirage import MountMode, Workspace
from mirage.resource.oci import OCIConfig, OCIResource

config = OCIConfig(
    bucket=os.environ["OCI_BUCKET"],
    namespace=os.environ["OCI_NAMESPACE"],
    region=os.environ["OCI_REGION"],
    access_key_id=os.environ["OCI_ACCESS_KEY_ID"],
    secret_access_key=os.environ["OCI_SECRET_ACCESS_KEY"],
)
resource = OCIResource(config=config)
ws = Workspace({"/oci": resource}, mode=MountMode.READ)
FieldRequiredDefaultDescription
bucketyesOCI bucket name
namespaceyesOCI tenancy namespace
regionyesOCI region (e.g. us-ashburn-1)
access_key_idyesCustomer secret key access ID
secret_access_keyyesCustomer secret key
endpoint_urlnoautoS3-compatible endpoint (auto-built from namespace + region)
timeoutno30Request timeout in seconds
proxynoHTTP proxy URL

Filesystem Layout

/oci/
  <object-key-path>/
    <file>
Object keys map directly to virtual paths. Directories are inferred from / delimiters in keys. Example:
/oci/
  data/
    users.csv
    logs/
      2026-04-01.jsonl
  config.json

Cache

Uses IndexCacheStore for directory listings with configurable TTL. File content caching is handled by the workspace.

Example

import asyncio
import os

from dotenv import load_dotenv

from mirage import MountMode, Workspace
from mirage.resource.oci import OCIConfig, OCIResource

load_dotenv(".env.development")

config = OCIConfig(
    bucket=os.environ["OCI_BUCKET"],
    namespace=os.environ["OCI_NAMESPACE"],
    region=os.environ["OCI_REGION"],
    access_key_id=os.environ["OCI_ACCESS_KEY_ID"],
    secret_access_key=os.environ["OCI_SECRET_ACCESS_KEY"],
)
resource = OCIResource(config=config)


async def main():
    ws = Workspace({"/oci": resource}, mode=MountMode.READ)

    r = await ws.execute("ls /oci/")
    print(await r.stdout_str())

    r = await ws.execute("cat /oci/data/users.csv | head -n 5")
    print(await r.stdout_str())

    r = await ws.execute("find /oci/ -name '*.jsonl'")
    print(await r.stdout_str())


if __name__ == "__main__":
    asyncio.run(main())

Shell Commands

CommandNotes
lsList objects and prefixes
catRead object content
head / tailFirst/last N lines
grep / rgPattern search
jqQuery JSON objects
wcLine/word/byte counts
statObject metadata (size, modified time)
findRecursive search with -name, -maxdepth
treeDirectory tree view