feat: add ct init scaffolding and process workspaces - #139
Merged
Merged
Conversation
bwl21
marked this pull request as ready for review
August 22, 2026 17:53
bwl21
marked this pull request as draft
August 24, 2026 16:35
# Conflicts: # src/index.ts # tests/cli.test.ts
# Conflicts: # src/auth/login.ts # src/auth/tokenStore.ts # src/commands/auth.ts
bwl21
marked this pull request as ready for review
August 24, 2026 20:46
Review follow-ups on eqrm#131: - `ct init` no longer exits 1 when the guided login fails after the scaffold is written. The failure is reported and the command falls through to the `ct auth login` hint, as `ct auth login` does; a re-run would otherwise only hit "refusing to overwrite". - The standard .gitignore now ignores `backups/`. `ct apply` writes backups next to the state file, which the standard scaffold puts at the repository root, so every apply left a dump of the live instance staged for the next `git add .`. The process template already did. - `validateHost` rejects a URL carrying a query or fragment. A URL copied out of the browser address bar was accepted verbatim and every request became `.../#/churchdb/api/...`. A path is left alone: it is how a sub-path installation is addressed. - The "Initialize a Git repository?" question is skipped in a directory that already is one, instead of collecting an answer that was then silently dropped. - `askHidden` delegates to `askSecret`, leaving one no-echo code path instead of two divergent ones, only one of which was covered. Claude-Session: https://claude.ai/code/session_01SaAzHDgDPSvLnfkKcnDj37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ct init [directory]to scaffold a minimal config repositoryct.config.ts,ct.envs.json,.gitignore,config/, andblueprints/--host,--env,--git/--no-git, and--yes--template processquickstart for portable, instance-aware process workspacesProcess quickstart
The existing standard template remains the default. A reusable process inside an existing repository can be initialized explicitly:
This creates:
The root
ct.config.tsis the normal entry point.ct.envs.jsonbinds the environment to the normalized host, hostname-derived state path and protection status. The empty host-bound state is written immediately; the process template never creates a genericct-state.json.Portable definitions stay outside
instances/. The generated README uses explicitct plan -e <env>/ct apply -e <env>commands and reservesconfigs/for exceptional-centry points. Reports, backups and captured reference output remain under the matching instance and are ignored by default. No credentials or live ChurchTools IDs are generated.Boundaries
--envwheneverct.envs.jsonexists is a separate engine-wide safety change. This scaffold documents the requirement without changing the backward-compatible single-instance fallback from feat: environments — per-instance state + dev→prod promotion workflow #22.ct auth statushas no--env, so there is no way to ask "who am I on the other host?" #117.Validation
npm test— 823 passed, 5 skippednpm run typechecknpm run lintnpm run buildgit diff --checkThe repository-wide Prettier command additionally sees unrelated local generated files under
reference/andreports/; those files were not modified or included in this PR.Fixes #131