*.tensor9.{tf,sh,kubectl}
and *.t9.{tf,sh,kubectl} files become Tensor9 BYOC ops command templates
in your control plane. You register the source once; later, as the repo
evolves, resync compares the repository with your imported templates.
A separate upgrade applies selected additions, modifications or removals
from source tracking.
This is the canonical way to maintain a library. The open-source
tensor9ine/cmdlib repo is laid out exactly this way and is a good
starting point if you’re new to authoring templates.
- Templates can follow your code review process. Use the repository review policy to check changes before importing or updating templates.
- Resync surfaces drift. When the repo lands new templates or
modifies existing ones,
tensor9 ops template source resyncshows the four-bucket diff (unchanged, modified, new, removed) without committing anything. - Upgrades are explicit.
tensor9 ops template source upgradeis a separate step. Diff first, then apply only the picks you want, scoped by file or action kind.
A reference layout
Thecmdlib repo groups templates by category. Each subdirectory
contributes one template per .tensor9.* file inside it:
linux/ and darwin/ contain a disk-usage.tensor9.tf. They
coexist because Tensor9 BYOC prefixes the parent directory name onto the
imported template, producing linux-disk-usage and darwin-disk-usage
as distinct templates. See “Conflict resolution” below for the cases
where the prefix alone does not disambiguate.
Registering a source
gh to clone the selected branch, discovers matching
files in the selected directories and sends their raw bytes to your
control plane for parsing and template creation. It then records the
source and its imported template IDs.
Useful flags:
gh auth login must succeed first. The action will fail with a clear
message if the GitHub CLI is missing or unauthenticated.
Conflict resolution
The persisted template name is the dir-prefixed file stem (linux-disk-usage from linux/disk-usage.tensor9.tf). A name
conflict happens when that stem already exists in the target app
because, say, the same source was registered before and you are
re-importing.
--conflictPolicy controls the bulk behavior:
Example:
Resyncing against HEAD
Resync is read-only; it never persists anything. Run it as often as you
like.
Resync walks the whole repo, not just the directories you selected
at register time. If a new sibling directory landed upstream after you
registered (a
darwin/ next to your originally-selected linux/), its
files surface as New available automatically. You do not need to
re-register the source to track new dirs.Applying the diff: upgrade
tensor9 ops template source upgrade fetches the source again
and applies all matching actions: evolve modified templates, import new
files and remove source bindings for missing files. The repository can
change between resync and upgrade; the earlier diff does not freeze the
bytes that upgrade imports.
Modified templates receive a new lineage version and content hash.
Existing command records retain their submitted template references.
Check approval coverage for the selected version and values before
submitting another command.
Scoping with --only and --actions
Two filters narrow what the upgrade does:
--actions accepts any subset of upgrade, add, retire-here. --only
restricts to a CSV of file names matching what
tensor9 ops template source resync listed.
What “retire-here” means
When a tracked file vanishes upstream,retire-here attempts to
deprecate its current template version, then removes its source binding.
If deprecation fails, the action warns and still removes the binding.
For example, a lineage cannot deprecate its only active version.
The template lineage remains in your control plane. Removing a source
binding is a library-maintenance action; manage template versions and
customer approvals separately.
Inventory
retrieve shows the GitHub coordinates, last-synced commit, selected
directories, and the imported template id list.
Retiring a source
--auto to skip the confirmation prompt in scripts.
End-to-end example
Related
- Authoring templates: the file format, variables, data access tags, permission tiers.
- Submitting and tracking ops commands: use a registered template to actually run something.