Internals
This page maps the major tinx subsystems to the responsibilities they own. Use it when you need to understand how the workspace, provider, and runtime layers fit together.
System view
Provider (OCI)
↓
tinx home (cache)
↓
Workspace (definition + lock)
↓
Runtime (execution)
↓
Command
Subsystems
| Package | Responsibility |
|---|---|
internal/cmd | Cobra commands, workspace targeting, CLI behavior |
internal/core | Normalized provider package model and tool dependency resolution |
internal/parser | Manifest loading, legacy normalization, and multi-document parsing |
internal/workspace | Workspace manifests, lock files, sync, shell artifact generation |
internal/oci | OCI packing, remote install, local layout reads, runtime materialization |
internal/state | tinx home layout, aliases, active workspace, provider metadata |
internal/runtime | Environment assembly, PATH handling, process execution helpers |
internal/runtimes | Built-in runtime plugins for oci, script, and local tools |
internal/build | Go and GoReleaser build pipelines for providers |
Workspace pipeline
When you run a workspace command such as:
tinx --workspace demo -- node build
tinx follows this path:
internal/cmdresolves the selected workspace by flag, discovery, or active workspace record.internal/workspaceloads and normalizes the workspace manifest.internal/workspacesyncs provider sources and updatestinx.lock.internal/workspacebuilds.workspace/env,.workspace/path, and lazy shims under.workspace/bin/.- The selected shim re-enters
internal/cmdthrough the hidden__shimcommand. internal/coreresolves the tool dependency plan.internal/runtimesinstalls missing tools andinternal/runtimeexecutes the target process.
The important architectural shift is that execution is now planned per tool, not per provider binary.
Packaging pipeline
When you package a provider:
tinx release --manifest tinx.yaml --main ./cmd/my-provider --push ghcr.io/acme/my-provider:v1.2.3
tinx follows this path:
internal/parsernormalizes the provider manifest into a package model.internal/buildinfers build targets from normalized bundle layer sources.internal/buildcompiles the required bundle-backed binaries.internal/ocistages bundle sources, writes config, manifest, normalized package metadata, and bundle layers into an OCI layout.internal/ocioptionally pushes the layout to a registry through ORAS.
Storage model
Two storage roots matter:
- tinx home: default
~/.tinx, orTINX_HOME, or--tinx-home - workspace root: the directory that contains
tinx.yaml
The workspace is for project-local runtime state. tinx home is for reusable provider metadata, OCI store content, aliases, and active workspace tracking.
Design themes
- Workspace first: execution always goes through a workspace shell.
- OCI everywhere: providers are packaged and distributed as OCI artifacts.
- Lazy materialization: metadata can exist before tools or assets are materialized.
- Normalized packages: legacy manifests and new resource-based manifests share one internal model.
- Plugin-driven execution: runtime behavior lives in built-in plugins behind a shared interface.
- Explicit failures: missing workspaces, missing commands, and environment conflicts fail early.
Key takeaway
- workspace logic decides what should run
- provider packaging decides what gets distributed
- runtime decides how commands execute