Repository navigation
coding-agent-kit becomes a standalone install (v0.2.0) - #1
Merged
Merged
Conversation
The structured merge engine, its four *-sync launchers, setup-sync, the tomlkit pin and their suites only ever served dotfiles' own settings sync, and dotfiles now carries them again. Remove them here, along with their hooks and the CI steps that provisioned the parser. The kit now needs only the Python 3.11+ standard library and Node.js 22+.
The tree mirrored dotfiles' Stow packages (common/codex/.local/bin/...),
which only made sense while dotfiles stowed it directly. Move the
launchers to bin/, their Python modules to lib/<tool>/, the Bash and
zsh completions to completions/{bash,zsh}/ and the Claude Code helpers
to helpers/, keeping file modes and history, and point the tests and
hooks at the new paths. bin/.. has the same shape as a ~/.local prefix,
so the copy-installed test fixtures need no other change. Behaviour is
unchanged.
codex-as and claude-as no longer assume a dotfiles install. Each launcher follows its own symlinks (a bounded readlink loop, no readlink -f) to the kit root and runs lib/<tool>/launch.py there, so a linked, copied or Stow-managed install all work, and an incomplete one says so instead of failing with a traceback. lib/coding-agent-kit/config.py reads one optional TOML file (CODING_AGENT_KIT_CONFIG, else $XDG_CONFIG_HOME or ~/.config, then coding-agent-kit/config.toml) for the codex and claude executables, codex_home and secrets_dir. The file must be a regular file the user or root owns that others cannot write; unknown keys only warn. Without a file every default reproduces the old behaviour byte for byte, and it is the only code that reads HOME. New metadata queries --list-accounts (codex-as) and --show-config (both) start nothing; the completions now ask the launchers for account names. CODING_AGENT_KIT_COLOR replaces DOTFILES_COLOR, with NO_COLOR and TERM=dumb still honoured, and --help names the configurable defaults and points at the kit's own docs, or at GitHub for a lone copy.
install.sh links the launchers into PREFIX/bin (default ~/.local), the Bash completions into the bash-completion user directory and the zsh completions into PREFIX/share/zsh/site-functions, then prints the fpath hint and the helper commands for Claude Code's settings.json. It treats as its own only links whose text starts with the checkout's physical path, the form it writes. Every other existing path, a relative link such as Stow's included, is refused, and so is a destination reached through a relative directory link (a Stow fold) or whose nearest existing parent is not a writable directory; then nothing changes. --uninstall removes only its own links, and nothing when it could not remove them all. tests/standalone-e2e.sh installs into temporary homes with no dotfiles, under /bin/sh, dash and bash, and drives both launchers, their completions and every configuration override through the installed links against recording fakes, plus every refusal and uninstall case. tests/contract.sh pins what consumers rely on: the public paths and modes, the three CI job names and the overlay test files. CI installs zsh and GNU Stow on Linux, and run.sh --ci now requires zsh instead of skipping the zsh cases.
Rewrite README.md and AGENTS.md for a project anyone can install on top of an existing Codex or Claude Code: requirements, install.sh, usage, the Claude Code helpers, colour, tests, the public contract consumers depend on, and release rules (tags are immutable; a patch tag reaches dotfiles hosts within a day). docs/configuration.md documents the optional config file, its permission rules and how to move codex_home and secrets_dir before enrolling. The launcher docs name the configurable paths and the new metadata queries, and CHANGELOG.md gets the 0.2.0 entry with an old-to-new path table. tests/contract.sh now pins docs/configuration.md too.
codex-as already refuses them, but claude-as took `claude-as -x`, `-h` or `--version` as an account name and offered to enrol it. Every invalid name now gets the codex-as message; the exit status stays 1.
The last two cases of the directories-on-the-way test ran while ~/.config and the configuration directory were still 0775 from the Ubuntu case and without the user private group stand-in, so they passed only where the runner's login group is private. On macOS, whose users share staff, the loader rightly refused the group-writable directory. Make both 0755 first, so only ownership decides.
The "insecure secrets" case kept the invalid configuration file of the case before it, so every listing stopped at that error and the 0700 check on the secrets directory was never reached. Remove that file first, and have each case name what its one error line must say.
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.
The kit was extracted from dotfiles as a pure refactor and was still laid out like dotfiles' Stow packages, with hard-coded
~/.local/lib,~/.secrets,~/.codex,DOTFILES_COLORand a--helppointer into~/dotfiles. This makes it a wrapper anyone can install on top of an existing codex or claude, and gives dotfiles back its settings-sync engine.Commits:
refactor: hand the AI config sync engine back to dotfiles: removeslib/config_sync.py, the four*-synclaunchers, setup-sync, the tomlkit pin and their suites. The kit now needs only the Python 3.11+ standard library and Node.js 22+.refactor: lay the kit out as bin, lib, completions and helpers: a puregit mv, with history and modes kept.feat: self-locating launchers with an optional configuration file:lib/coding-agent-kit/config.pyreads one optional TOML file with four keys:codex,claude,codex_homeandsecrets_dir. It is checked for owner, group, other-write, ACLs and the directories on its path. Without a file, every default reproduces v0.1.0 byte for byte.--list-accountsand--show-config, andCODING_AGENT_KIT_COLOR.feat: add install.sh, a standalone end-to-end test and a contract test:install.shrefuses foreign paths, Stow links and folded directories.tests/standalone-e2e.shinstalls into temporary homes under /bin/sh, dash and bash.tests/contract.shpins the public paths, modes, CI job names and overlay files.docs: describe coding-agent-kit as a standalone install: README, AGENTS,docs/configuration.md, and CHANGELOG 0.2.0 with an old-to-new path table.fix: refuse claude-as account names that start with -:claude-as -x,-hor--versionused to offer to enrol an account of that name. claude-as now refuses these names, as codex-as does, and prints codex-as's message for every invalid name. The exit status stays 1.test: check directory ownership without group write: the first macOS CI run failed here. The case passed only where the runner's login group is a user private group; macOS users sharestaff.test: make each bad-configuration case fail on its own error: found by a portability review. The "insecure secrets" case passed on the previous case's config error and never reached the 0700 check. A mutation that accepts 0755 now fails it.Breaking changes (0.x minor): every launcher, library, completion and helper path moved;
DOTFILES_COLORis no longer read; the launchers no longer run~/.local/lib/<tool>/; claude-as refuses account names starting with-. See CHANGELOG.md.Testing:
tests/run.sh --ciandpre-commit run --all-files;gitleaks gitis clean on the full history;tests/run.ps1runs under pwsh 7.6;