How ocx-sh/ocx works
OCX is a Rust package manager for installing pre-built binaries, switching package versions, and running tools in clean environments, including CI use. The main user path is a CLI command that installs or selects a package and then runs it; package resolution, registry access, and local package management support that path. The repository also has substantial index, project, shell, and supply-chain signing and verification capabilities. Edges are limited to README-documented workflow links and references in the supplied source index; unsampled implementation connections are left unasserted.
Main entry points: app.rs Command interface · client.rs OCI client · tasks.rs Package tasks · resolve.rs Package resolution
Components 19
CLI
- Command interface
crates/ocx_cli/src/app.rs - Package commands
- Error classification
crates/ocx_cli/src/exit.rs
Package lifecycle
- Package tasks
crates/ocx_package_manager/src/tasks.rs - Package resolution
crates/ocx_package_manager/src/tasks/resolve.rs - Install and select
crates/ocx_package_manager/src/tasks/install.rs - Execution environment
crates/ocx_package_manager/src/launch.rs - Package metadata
crates/ocx_package/src/metadata/authoring.rs
Registry and indexes
- OCI client
crates/ocx_oci/src/client.rs - OCI registries
- Package indexes
crates/ocx_index/src/lib.rs
Supply-chain trust
- Image signing
crates/ocx_sign/src/sign/pipeline.rs - Attestations
crates/ocx_sign/src/attest/pipeline.rs - Signature verification
crates/ocx_sign/src/verify/pipeline.rs - Forge announcements
crates/ocx_announce/src/forge.rs
Project and shell
- Configuration
crates/ocx_config/src/lib.rs - Project context
crates/ocx_project/src/compose.rs - Shell integration
crates/ocx_shell/src/shell.rs
Other components
- Package user
Connections 22
- Package user → Command interface: runs command
README.md - Command interface → Package commands: dispatches
crates/ocx_cli/src/app.rs - Package commands → Package tasks: invokes tasks
- Package tasks → Package resolution: resolves package
crates/ocx_package_manager/src/tasks.rs - Package tasks → Install and select: installs package
crates/ocx_package_manager/src/tasks.rs - Package tasks → Execution environment: runs package
- Package resolution → Package indexes: queries index
- Package resolution → OCI client: fetches package
- Install and select → OCI client: pulls artifacts
- OCI client → OCI registries: reads and writes
- Install and select → Package metadata: uses metadata
- Command interface → Configuration: loads settings
- Command interface → Project context: uses project context
- Execution environment → Shell integration: sets environment
- Command interface → Image signing: supports package signing
- Command interface → Attestations: supports attestations
- Command interface → Signature verification: supports verification
- Image signing → OCI client: publishes referrer
crates/ocx_sign/src/sign/pipeline.rs - Attestations → OCI client: pushes referrer
crates/ocx_sign/src/attest/pipeline.rs - Signature verification → OCI client: checks referrers
- Command interface → Forge announcements: supports announcements
- Command interface → Error classification: classifies failures
crates/ocx_cli/src/exit.rs