feat: Portable per-key git identity and signing#20
Open
Conversation
Add 'keycutter key link' command to create generic symlinks from machine-specific keys (e.g., github.com_alex@laptop -> github.com_alex). This enables portable git configs that reference the generic path while actual keys remain machine-specific. Changes: - Add ssh-keys-create-symlinks() function in lib/ssh - Add 'key link' subcommand with --dry-run option - Integrate symlink creation into 'keycutter create' The symlinks are created: - Automatically when running 'keycutter create' - Manually via 'keycutter key link' for existing keys - Idempotently (safe to run multiple times) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Add commands for portable per-key git identity configuration: - `git-identity create <keytag>` - Create identity config with name, email, signing key - `git-identity list` - List all identity configs - `git-config setup` - Generate master config with includeIf rules - `setup` - Bootstrap keycutter on a new machine (requirements, symlinks, git config) The identity configs reference portable key paths (symlinks created in Phase 1), enabling version-controlled git configs that work across machines. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
When creating a GitHub key and uploading it with signing permissions, keycutter now offers to set up git commit signing automatically: - Detects name/email from GitHub API if logged in - Creates the identity config with signing key - Updates the master git config with includeIf for ~/Code/github.com/username/ - Adds the include to ~/.gitconfig if needed This provides a seamless one-step setup for new GitHub keys. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add comprehensive git-signing.md documenting the portable identity workflow - Add 14 BATS tests for key link, git-identity, git-config, and setup commands - Update README.md to feature git commit signing - Update guide.md with git signing section 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Tests were failing because the parent environment (Claude Code) sets GIT_CONFIG_COUNT and GIT_CONFIG_KEY_0/VALUE_0 to disable commit signing. These environment variables override all git config sources, including local .git/config. This fix clears these variables in setup_test_environment() to ensure tests have a clean git config environment. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
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
Add portable git identity and commit signing support to keycutter, enabling version-controlled git configs that work across machines with FIDO2/hardware-backed SSH keys.
New Commands
keycutter key link [--dry-run]- Create portable symlinks for machine-specific keyskeycutter git-identity create <keytag>- Create identity config (name, email, signing key)keycutter git-identity list- List all identity configskeycutter git-config setup- Generate master config with includeIf ruleskeycutter setup- Bootstrap keycutter on a new machineKey Features
github.com_alex→github.com_alex@laptop) so config can reference portable pathsWorkflow
keycutter create github.com_alex(symlinks auto-created)git-identity createlater)~/Code/github.com/alex/and commits are signed automaticallyPortability
The
~/.ssh/keycutter/directory can be version controlled:keycutter setupbootstraps on new machinesTest Plan
keycutter key linkcreates symlinks for existing keyskeycutter git-identity creategenerates correct configkeycutter git-config setupwires up includeIf rulesTODO
🤖 Generated with Claude Code