How oras-project/oras works
ORAS CLI transfers and manages OCI artifacts in registries and OCI layouts. Users invoke commands to resolve references, move or inspect manifests and blobs, and receive formatted metadata or progress. The clearest sampled workflow is copy: it prepares source and destination targets, applies graph-copy options, transfers artifact content, then may tag additional references. The tree also exposes pull/push, discovery, backup/restore, repository, manifest, and authentication command families. Command wiring beyond the sampled copy and display-handler code is inferred only at the subsystem level; those detailed links are omitted.
Main entry points: cmd.go Command root · cp.go Copy artifacts · target.go Target options · handler.go Display handlers
Components 20
CLI commands
- CLI entry
cmd/oras/main.go - Command root
cmd/oras/root/cmd.go - Pull and push
cmd/oras/root/pull.go - Copy artifacts
cmd/oras/root/cp.go - Discover artifacts
cmd/oras/root/discover.go - Manifest operations
cmd/oras/root/manifest - Blob operations
cmd/oras/root/blob - Repository queries
cmd/oras/root/repo - Backup and restore
cmd/oras/root/backup.go - Registry login
cmd/oras/root/login.go
Artifact transfer
- Target options
cmd/oras/internal/option/target.go - Content traversal
internal/contentutil/traverse.go - Artifact graph
internal/graph/graph.go
Registry access
- OCI registries
- OCI layouts
Output and status
- Display handlers
cmd/oras/internal/display/handler.go - Formatted output
cmd/oras/internal/output/print.go - Transfer progress
cmd/oras/internal/display/status/progress/manager.go
Shared runtime
- Reference parsing
internal/repository/repository.go
Other components
- CLI user
Connections 20
- CLI user → CLI entry: invokes
- CLI entry → Command root: executes
- Command root → Pull and push: dispatches
- Command root → Copy artifacts: dispatches
- Command root → Discover artifacts: dispatches
- Command root → Manifest operations: dispatches
- Command root → Blob operations: dispatches
- Command root → Repository queries: dispatches
- Command root → Backup and restore: dispatches
- Command root → Registry login: dispatches
- Copy artifacts → Target options: creates targets
- Copy artifacts → Artifact graph: uses graph traversal
- Copy artifacts → OCI registries: copies content
- Target options → OCI registries: accesses
- Target options → OCI layouts: accesses
- Copy artifacts → Content traversal: wraps destination
- Copy artifacts → Display handlers: selects handlers
- Display handlers → Formatted output: formats metadata
- Display handlers → Transfer progress: selects status
- Copy artifacts → Reference parsing: parses references