controlm-chain-admin
Manage BMC Control-M job chains as a git-friendly JSON repository. Import the Control-M XML export, keep the links between jobs explicit, hold one environment-neutral definition for test/uat/bench/prod, validate the chains, refactor safely, and export the XML back for the environment you choose.
Status: alpha. Byte-identical import and export, environments (letter rule, constants, exceptions, folders and jobs of some environments) learned from the exports themselves, releases with installations per environment, comparison of branches and taking their changes item by item, validation with fixes, an editing web UI. The design is in
DESIGN.mdand the plan inBACKLOG.md. Released on PyPI since 0.1.0.
Why
The Control-M user interface is slow for reviewing or changing whole chains, and its XML
export (DEFTABLE) is hard to diff, review and version. controlm-chain-admin turns that
export into:
- JSON files in git, one per folder and per job, with stable ordering, so a plain
git diffshows what really changed and a pull request can review a chain change. - Links instead of condition names.
OUTCOND/INCONDpairs become edges between nodes; the original names are kept, and the export can keep them or standardize them. - One base, many environments. The environment letter in names, hosts, users, mail recipients and other per-environment values become tokens and constants; each environment is a small file. Exporting for another environment is one flag.
- Environments learned from their exports. Start from the production export; the export
of each other environment is grouped into a few decisions (a machine, a user, a mail, the
environment's name in a subject becomes a constant with a value per environment; what only
one environment has or lacks is noted), and production stays byte for byte as it was.
ctmchain checkthen counts, field by field, what the repository's export of each environment still differs in. - Releases and comparison. The trunk mirrors production; a release is installed environment by environment; two branches compare in Control-M terms, and any change of the other branch (one attribute, one job without its folder, one condition) can be taken into yours, conflicts shown value by value.
- Validation and refactorings that the Control-M UI does not offer: dangling or stale conditions, chains broken by renames, condition names that differ only by a copy's suffix or by case (numbered as the fix), renaming a sub-application across a folder, moving a job, inserting a job in a chain.
- Byte-identical export. Untouched definitions export exactly as they were imported.
Install
pip install controlm-chain-admin # core + ctmchain CLI (standard library only)
pip install "controlm-chain-admin[web]" # + local read-only web UI
pip install "controlm-chain-admin[mcp]" # + the tools for an assistant (Kilo, Claude)
Requires Python 3.11 or newer.
Where only PyPI is reachable
The source distribution carries the whole project (rules, skills, tests, the web sources and the built UI), so it can be adjusted where GitHub is out of reach:
pip download controlm-chain-admin==<version> --no-deps --no-binary :all:
tar -xzf controlm_chain_admin-<version>.tar.gz && cd controlm_chain_admin-<version>
git init -b main && git add -A && git commit -m "chore: controlm-chain-admin <version>"
python -m venv .venv && .venv/bin/pip install -e ".[dev,web]"
The bootstrap skill (.claude/skills/bootstrap/SKILL.md) takes it from there, for a person
or Claude Code: the gate, then a new chain repository: production first, the values of the
other environments from their full exports, then the releases on their way from their
deliveries.
Quickstart
# a git repository (new or existing) becomes a chain repository
ctmchain init --repo ./my-chains --application P77_RISK_ENGINE \
--envs test=T,uat=U,bench=B,prod=P --prefixes P77,RQ_,RC_ --leading-only RQ_,RC_
ctmchain distinct NODEID RUN_AS DOMAIL/@DEST --xml uat_export.xml # what varies per environment
ctmchain import uat_export.xml --env uat --repo ./my-chains # XML -> JSON, with a report
ctmchain validate --repo ./my-chains # chain findings, exit 1 if any
ctmchain resolve never-cleaned=add-cleanup --repo ./my-chains # preview the fixes; --apply
ctmchain release start 2026-11 --repo ./my-chains # edits go to release/2026-11
ctmchain commit --dry-run --repo ./my-chains # the message it would use
ctmchain graph P77_INGEST_DAILY --repo ./my-chains --format mermaid # the chain of one folder
ctmchain export --env uat -o uat.xml --repo ./my-chains # byte-identical to the import
ctmchain export --env prod -o prod.xml --repo ./my-chains # same chain, prod letters
ctmchain serve --repo ./my-chains # local web UI
ctmchain compare main release/2026-11 --repo ./my-chains # what the release changed
ctmchain compare main release/2026-11 --real-only --repo ./my-chains # without the condition names only
ctmchain package main release/2026-11 --env uat --repo ./my-chains # import file, changed folders
ctmchain release installed uat --repo ./my-chains # tag uat/2026-11-1
ctmchain receive delivery.xml --repo ./my-chains # a team's folders, made neutral
ctmchain receive uat_full.xml --full --repo ./my-chains # all of uat: constants, its exceptions, what only uat has
ctmchain technical --add LAST_UPLOAD --repo ./my-chains # a technical attribute: kept in meta, never compared
ctmchain check uat_full.xml --env uat --repo ./my-chains # what our uat export still differs in
ctmchain take release/2026-10 --list --repo ./my-chains # what another release changed
ctmchain take release/2026-10 --item job:P77_CHAIN/P77_D --repo ./my-chains # one job of it; --apply
ctmchain release close --repo ./my-chains # once installed in prod
Refactorings preview a change set and write only with --apply:
ctmchain rename-job P77_INGEST_DAILY/P77_INGEST_LOAD P77_INGEST_POSITIONS # diff only
ctmchain rename-subapp P77_BATCH P77_CORE --folder P77_INGEST_DAILY --apply
ctmchain insert-job P77_INGEST_DAILY/P77_CHECK --after P77_INGEST_DAILY/P77_INGEST_INIT \
--before P77_INGEST_DAILY/P77_INGEST_LOAD --apply
Also rename-folder, move-job, extract-variable, map, env constants, show FOLDER/JOB,
links FOLDER/JOB, links --name <condition>. Every command takes --format json where a
report is produced. All examples use the fictional
application P77; the repository never contains real exports.
Ask in plain words (Kilo, other assistants)
ctmchain mcp gives an assistant the repository as tools: it answers questions and proposes
changes, previewed field by field, and writes one only when you agree. Nothing is committed.
What can be asked, and how, is one file (capabilities.json): ctmchain menu prints it.
The assistant's model reads what the tools return (the names and fields of your jobs): use
one your company allows.
pip install "controlm-chain-admin[mcp]"
ctmchain kilo init --repo ./my-chains # writes .kilo/ at the top of the git repository
kilo --agent controlm # "set MAXWAIT to 3 on P77_B", "only in prod, ..."
In the web UI, ctmchain serve --assistant --assistant-model openai/gpt-5-mini starts Kilo
with the server: Assistant in the header opens the conversation beside the page, and a
change waits there, shown field by field, for Apply or Reject. The assistant answers in
the language it is asked in. That Kilo does not read ~/.claude/CLAUDE.md, which holds what
you want of Claude Code; KILO_DISABLE_CLAUDE_CODE_PROMPT=0 makes it read the file again.
The controlm agent may use the ctmchain tools only: it cannot edit files or run commands,
and ctmchain_apply asks before it writes (.kilo/kilo.json). Words of your team go in
.kilo/skills/ctmchain/vocabulary.md. Any other MCP client runs
python -m controlm_chain_admin mcp --repo ./my-chains.
On Windows, from scratch (with Kilo)
In PowerShell, with Python 3.11 or newer, git, and the Kilo CLI (kilo --version; signed in
with the model your company allows) on the PATH. Only PyPI needs to be reachable.
# 1. The tool, in a virtual environment of its own (an older one: the same pip line in it)
py -m venv $HOME\ctmchain-venv
& $HOME\ctmchain-venv\Scripts\Activate.ps1 # blocked? Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
python -m pip install --upgrade pip
python -m pip install --upgrade "controlm-chain-admin[web,mcp]"
ctmchain --version
# 2. The data repository, outside the code: the full exports in exports\<env>\, the chains
# in chains\; production first, it is the trunk
mkdir $HOME\dev\my-data\chains; cd $HOME\dev\my-data\chains
git init -b main
ctmchain init --application P77_RISK_ENGINE --envs test=T,uat=U,bench=B,prod=P `
--prefixes P77,RQ_,RC_ --leading-only RQ_,RC_
ctmchain import ..\exports\prod\prod.xml --env prod --dedupe-jobnames
ctmchain check ..\exports\prod\prod.xml --env prod # "the same byte for byte"
git add -A; git commit -m "chore: production baseline"
# 3. The other environments, in one release: their machines, users and mails become
# constants, everything else they have becomes their exceptions; production stays
ctmchain release start environments
ctmchain receive ..\exports\uat\uat.xml # the decisions (or the Import page of serve)
ctmchain receive ..\exports\uat\uat.xml --apply
ctmchain check ..\exports\uat\uat.xml --env uat # what the repository still differs in
git add -A; git commit -m "chore: uat" # the same for bench and test, then:
ctmchain release installed prod; ctmchain release close
# 4. The assistant
ctmchain kilo init --repo .
Add-Content .gitignore ".kilo/kilo.json" # it holds the paths of this machine
ctmchain serve --assistant # Assistant in the header; Kilo's model
ctmchain serve --assistant starts kilo serve itself, with the model Kilo is set to
(--assistant-model provider/model for another one, kilo models lists them) and stops it with
the server. A kilo that is not on the PATH: $env:CTMCHAIN_KILO = "C:\path\to\kilo.cmd".
Kilo in a terminal works too: kilo --agent controlm in the chains directory.
The step by step of the data repository (the decisions of each environment, the conventions
for constants and exceptions, the releases already on their way) is the bootstrap skill of
the source distribution: pip download controlm-chain-admin --no-deps --no-binary :all:, then
.claude/skills/bootstrap/SKILL.md in the archive.
Development
pip install -e ".[dev,web]"
pytest # synthetic fixtures
cd web && npm ci && npm run build # builds the web UI into the package
.claude/skills/verify/verify.sh # the whole quality gate
Concepts
| Term | Meaning |
|---|---|
| Chain repository | A git repository with the environment-neutral base plus one small directory per environment |
| Node | A folder or a job, identified as FOLDER/JOB without the environment letter |
| Link | A dependency edge: producer OUTCOND + → consumer INCOND with the same condition name |
| Constant | A logical value @{name} resolved per environment (hosts, users, recipients) |
| Exception | A per-job, per-environment whole-value replacement (envs/<env>/overrides.json) |
| Environments of a node | "envs": [...] on a folder or job that exists in some environments only |
| Release | A branch release/<name> started from the trunk (production), installed per environment, closed into the trunk |
Contributing
See CONTRIBUTING.md. The project is developed test-first; the quality gate
is .claude/skills/verify/verify.sh.
License
MIT — see LICENSE.
Metadata
Release files for controlm-chain-admin 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| controlm_chain_admin-0.1.4.tar.gz | 757.7 kB | With provenance | Details for controlm_chain_admin-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| controlm_chain_admin-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for controlm_chain_admin-0.1.4-py3-none-any.whl |
Total release size: 1.2 MB
Release files / controlm_chain_admin-0.1.4.tar.gz
| Download URL | controlm_chain_admin-0.1.4.tar.gz |
|---|---|
| Size | 757.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d441a4db054383e0fee76f03eec850747370501f52676c4bd9a652d6668f6516
|
|
BLAKE2b-256 checksum How to use checksums |
39a597621491cb8e6751323578f0e1dc2b2fd8afa53eed09273981ebeacd8df8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.
Transparency logRelease files / controlm_chain_admin-0.1.4-py3-none-any.whl
| Download URL | controlm_chain_admin-0.1.4-py3-none-any.whl |
|---|---|
| Size | 435.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8de577e27f34bedf8ffde59c98b9a057d26fe4e0c6fdf7094607707db53d0572
|
|
BLAKE2b-256 checksum How to use checksums |
023bdd10345392152f27962d7be99c895c919da29bcd10a1973b9f0fd943fdf9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.
Transparency logSecurity for controlm-chain-admin 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for controlm_chain_admin-0.1.4.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.