@@ -15,13 +15,13 @@ code, and reconcile it against the ChurchTools API with Terraform-style
1515A ChurchTools instance's structure is normally maintained by clicking. That
1616works — until you need to answer questions clicking cannot:
1717
18- | Clicking | With ` ct ` |
19- | --- | --- |
20- | "Who changed this group's rights, and why?" | ` git log ` , and the PR that changed it |
21- | "Set up the next campus like the last one" | Call the same blueprint function again |
22- | "Try it somewhere safe first" | ` ct plan --env dev ` → ` ct apply --env dev ` → promote |
23- | "Has anyone edited this by hand?" | ` ct plan ` reports drift against the last known state |
24- | "What will this actually change?" | ` ct plan ` prints it before anything is written |
18+ | Clicking | With ` ct ` |
19+ | ------------------------------------------- | ------------------------------------------------- --- |
20+ | "Who changed this group's rights, and why?" | ` git log ` , and the PR that changed it |
21+ | "Set up the next campus like the last one" | Call the same blueprint function again |
22+ | "Try it somewhere safe first" | ` ct plan --env dev ` → ` ct apply --env dev ` → promote |
23+ | "Has anyone edited this by hand?" | ` ct plan ` reports drift against the last known state |
24+ | "What will this actually change?" | ` ct plan ` prints it before anything is written |
2525
2626## Show me
2727
@@ -101,11 +101,13 @@ commands.
101101ct auth login --host https://mychurch.church.tools --token < personal-login-token>
102102ct auth status # who am I?
103103
104- ct get groups # JSON to stdout — pipe into jq
104+ ct get groups # JSON to stdout — pipe into jq (every page, not just the first)
105105ct adopt campus 0 # bring ONE existing resource under management
106+ ct coverage # what the instance has that the config does not manage
106107ct state list # what is managed
107108ct plan # diff the config against ChurchTools (read-only)
108109ct apply # create + update in dependency order (confirm + backup first)
110+ ct refresh --group < key> # make ChurchTools re-evaluate one auto-group now
109111```
110112
111113` apply ` reconciles ** creates and updates** only, saving state after each action
@@ -116,23 +118,29 @@ confirmation — and a declaration marked `preventDestroy: true` blocks even tha
116118
117119## What it manages
118120
119- | Resource | DSL | Guide |
120- | --- | --- | --- |
121- | Campuses | ` ct.campus ` | [ config guide] ( docs/configuration.md ) |
122- | Groups (fields, campus, multi-parent hierarchy) | ` ct.group ` | [ config guide] ( docs/configuration.md ) |
123- | Group types, roles, age/target groups, relationship types, person statuses | ` ct.groupType ` , ` ct.roleDefinition ` , ` ct.ageGroup ` , ` ct.targetGroup ` , ` ct.relationshipType ` , ` ct.personStatus ` | reusable building blocks |
124- | Permissions (group-role, group-type-role, person-status) | ` ct.groupRole ` , ` ct.groupTypeRole ` , ` ct.status ` | [ permissions] ( docs/handbuch/permissions.md ) |
125- | Auto-groups (dynamic groups) | the ` dynamic ` block on a group | [ dynamic groups] ( docs/handbuch/dynamic-groups.md ) |
126- | Repeated structure, parametrized | a plain function over the DSL | [ blueprints] ( docs/handbuch/blueprints.md ) |
121+ | Resource | DSL | Guide |
122+ | -------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ---------------------------------------------- --- |
123+ | Campuses | ` ct.campus ` | [ config guide] ( docs/configuration.md ) |
124+ | Groups (fields, campus, multi-parent hierarchy) | ` ct.group ` | [ config guide] ( docs/configuration.md ) |
125+ | Group types, roles, age/target groups, relationship types, person statuses | ` ct.groupType ` , ` ct.roleDefinition ` , ` ct.ageGroup ` , ` ct.targetGroup ` , ` ct.relationshipType ` , ` ct.personStatus ` | reusable building blocks |
126+ | Permissions (group-role, group-type-role, person-status) | ` ct.groupRole ` , ` ct.groupTypeRole ` , ` ct.status ` | [ permissions] ( docs/handbuch/permissions.md ) |
127+ | Auto-groups (dynamic groups) | the ` dynamic ` block on a group | [ dynamic groups] ( docs/handbuch/dynamic-groups.md ) |
128+ | Repeated structure, parametrized | a plain function over the DSL | [ blueprints] ( docs/handbuch/blueprints.md ) |
127129
128130Read-only by design: the person master-data model, security levels and
129- custom-field * definitions * (` ct get person-masterdata ` , ` ct get data-fields ` ) —
131+ custom-field _ definitions _ (` ct get person-masterdata ` , ` ct get data-fields ` ) —
130132schema in scope, per-record values never. See
131133[ field definitions] ( docs/handbuch/field-definitions.md ) .
132134
133135References are logical throughout: ` groupType: "ministry_team" ` resolves to that
134136instance's id at plan time, so the same config drives a dev and a prod instance
135- unchanged. Numeric ids remain an escape hatch everywhere.
137+ unchanged. Numeric ids remain an escape hatch everywhere — and where one is left
138+ in place, ` ct ` says so rather than letting a host-specific id travel silently to
139+ another instance.
140+
141+ ` ct coverage ` answers the other direction: what exists on the instance that the
142+ config does not manage, and which of it could be declared today (per group _ and_
143+ role, with the blocking scope dimension named). ` --json ` makes it a CI gate.
136144
137145## Environments and CI
138146
@@ -166,10 +174,10 @@ ct apply --env prod # protected env: type the env name to confirm
166174
167175## Two-repo model
168176
169- | Repo | Contents |
170- | --- | --- |
171- | ** ` eqrm/ct-cli ` ** (this repo) | The tool: CLI, API client, plan/apply engine. Generic, reusable. |
172- | * your config repo * (private) | Your instance's desired-state config + state files. Depends on this tool. |
177+ | Repo | Contents |
178+ | ----------------------------- | ---------------------------------------------------------------------- --- |
179+ | ** ` eqrm/ct-cli ` ** (this repo) | The tool: CLI, API client, plan/apply engine. Generic, reusable. |
180+ | _ your config repo _ (private) | Your instance's desired-state config + state files. Depends on this tool. |
173181
174182Like Terraform, the tool never lives in the same repo as the infra config — the config
175183repo holds an organisation's actual structure and stays private. This repo is the tool
0 commit comments