| name | git-init |
| description | Initialize a git repo with SSH, identity and remote configured. Usage: /git-init <personal|laboral> <key_name> <remote_url> <branch> |
Git init with SSH and identity
Arguments
- Context: $0 (personal or laboral)
- Key name: $1 (name of the SSH key in ~/.ssh/, e.g. incognia, kone)
- Remote URL: $2 (SSH URL, e.g. git@github.com:incognia/repo.git)
- Branch: $3 (default branch name, e.g. main)
Instructions
- Read the full CoT: Load and follow
~/rules/cot/git_init.md from line 1 to end
- Initialize repo:
git init
- Configure identity based on context ($0):
- Configure SSH key:
git config core.sshCommand "ssh -i ~/.ssh/$1 -o IdentitiesOnly=yes"
- Verify the key exists:
ls ~/.ssh/$1 — if not found, list available keys with ls ~/.ssh/ and ask the user
- Add remote:
git remote add origin $2
- Set default branch:
git branch -M $3
- Verify configuration:
echo "=== CONFIGURATION ==="
echo "Email: $(git config user.email)"
echo "SSH: $(git config core.sshCommand)"
echo "Remote: $(git remote get-url origin)"
echo "Branch: $3"
echo "====================="
- Confirm: Verify remote uses SSH (git@), not HTTPS
Defaults
If arguments are missing, use these defaults based on context:
- personal: key=
incognia, branch=main
- laboral: key=
kone, branch=main
If no arguments are provided at all, ask the user for context and remote URL.
Examples
/git-init personal incognia git@github.com:incognia/myproject.git main
/git-init laboral kone git@gitlab.com:incogniadev/project.git main
/git-init personal — uses defaults, asks for remote URL
References
- Detailed CoT:
~/rules/cot/git_init.md
- Rules:
~/rules/rulesets/GIT.md