Documentation Index
Fetch the complete documentation index at: https://docs.tensor9.com/llms.txt
Use this file to discover all available pages before exploring further.
cmdlib is the open-source reference repository of operational
command templates that ship ready-to-register against any Tensor9 app.
Most teams start by registering it as a source, then layer their own
app-specific templates on top.
It lives at github.com/tensor9ine/cmdlib,
Apache 2.0 licensed.
Why use it
Three reasons to registercmdlib on day one:
- Common ops are already written. Disk usage, top processes, pod
restarts, EBS snapshots, Temporal workflow termination, etc. The
templates declare appropriate
data_accesstags and permission tiers so your customers can review them quickly. - Templates evolve from real ops incidents. Bug fixes and new templates land via PR in the cmdlib repo and propagate to every install that re-syncs.
- They’re good reference for your own templates. When you write
an app-specific template, the closest match in
cmdlibis usually a good starting point. Browse the directory that matches your target (linux, k8s, aws, etc.) and copy the closest file.
What’s in it
Templates are organized by target environment. Each category is a directory undersrc/; every .tensor9.tf file inside contributes
one template.
| Category | Examples | Use when |
|---|---|---|
linux/ | disk-usage, top-processes, journalctl-tail, dmesg-tail, network-connections, host-info | Triaging a Linux appliance host. Read-only diagnostics. |
darwin/ | disk-usage, top-processes, log-tail, pmset-status, launchd-list, system-profile | Triaging a macOS appliance host. Read-only diagnostics. |
k8s/ | tail-pod-logs, restart-deployment, scale-deployment, drain-node, delete-failed-evicted-pods, describe-deployment, get-events, list-stuck-pods, restart-pods-by-label | Standard SRE operations on the appliance’s Kubernetes cluster. |
aws/ | find-idle-instances, find-untagged-resources, find-unused-security-groups, list-public-s3-buckets, list-old-snapshots, rotate-iam-access-key, snapshot-ebs-volume, rds-snapshot, terminate-stopped-instances | Direct AWS resource operations (EC2, EBS, S3, RDS, IAM). |
node/ | cpu-profile, heap-snapshot, event-loop-lag, gc-trace, open-handles, tail-stderr, npm-list, process-info | Debugging a Node.js process inside the appliance. |
temporal/ | list-running-workflows, list-failed-workflows, describe-workflow, signal-workflow, reset-workflow, terminate-workflow | Inspecting and intervening in Temporal workflows. |
orchestration/ | pre-deploy-backup, snapshot-then-restart, snapshot-then-resize-volume, drain-then-terminate-node, rollout-restart-then-tail | Multi-step compositions that chain primitives from the other categories. |
README.md in the repo for the full per-file
inventory and the trade-off notes for each template.
Registering it
.tensor9.tf under src/, persists
each as a template prefixed with its parent directory name
(linux/disk-usage.tensor9.tf becomes linux-disk-usage, so it does
not collide with darwin/disk-usage.tensor9.tf which becomes
darwin-disk-usage).
You can scope to a subset of categories with --dirs:
Reading a template
Every file is a small standalone Terraform template. The canonical shape is documented in Authoring templates;linux/disk-usage.tensor9.tf
is the example used there. Open any file in the repo to see the same
pattern applied to a different operation.
Contributing
cmdlib accepts pull requests. Useful contributions tend to fall in
one of three buckets:
- A new template for an existing category. Follow the conventions
in that category’s
README.md. Match the existing data-access tags and permission-tier choices unless you have a reason not to. - A new category. Discuss in an issue first; new categories imply new conventions and shouldn’t be added without coordination.
- A bug fix or hardening change to an existing template. Include a one-line reproducer in the PR description so reviewers can confirm the fix.
ReadWrite or Admin tier) require an
extra reviewer and a dry-run plan in the PR description. The bias is
toward conservative defaults: prefer ReadOnly unless the operation
genuinely cannot be expressed that way.
License
Apache 2.0. You can fork the repo, register your fork as a source instead of upstream, and curate the template set that matches your deployment shape.Related
- Authoring templates: the file format used by every
cmdlibtemplate. - Git template sources: how to keep your registered
cmdlibsource up to date as the upstream evolves.