A simpler installation
The current installation method is kind of confusing, you could simplify it a lot by placing kr, krd, and krssh into their own directories under a top level cmd directory (cmd/kr, cmd/krd, and cmd/krssh respectively). Installation/updates become as easy as
go get -u github.com/kryptco/kr/cmd/...
I'm not sure what the importance of the pks11 rust code is, but I have it working on Arch Linux without it. This may have to do with my configuration below but as far as I can tell all that's needed is the ssh agent to be setup correctly. Note that this would also allow you to remove all sorts of ugly platform specific hacks and you could offer a single installation method to everyone.
Then the user configuration is as simple as
Match canonical exec "kr restart"
IdentityAgent %d/.kr/krd-agent.sock
ProxyCommand krssh %h %p
Note that I use the canonical filter in the Match block so that kr restart only runs once and the canonical/full name of the host gets passed to krssh. The ProxyCommand line is not necessary but in my testing not having it causes it to show up with "unknown host" on the app, which is fine since a custom proxy command or proxy jump (see the -J option for ssh) will prevent the ProxyCommand from being used. The IdentityAgent line can be omitted if you set SSH_AUTH_SOCK to the value of $HOME/.kr/krd-agent.sock but then you lose the benefit of only using kryptonite when kr restart succeeds (that way when you fall back on the default agent/no agent when kr isn't installed or has only been installed for a particular user). The full path to the krssh executable wasn't specified because it's assumed that the user's $GOPATH/bin directory is added to their PATH, a fact that is confirmed by kr being in the PATH when we execute kr restart.
The above block doesn't need to be placed in the user's ~/.ssh/config but it could be placed in the global /etc/ssh/ssh_config and the user would only end up using it if they ran the go get ... command above.
A patch as not been offered as this would require changing a lot of user facing behaviour that would break assumptions made in documentation. I will gladly offer one though if it is requested.
All of this is confirmed to work on the latest Arch Linux with Go 1.8.3 and OpenSSH 7.5p1, thus it should solve #63 without an AUR package (although someone will likely create one to install in the root directory). Confirmed to work on ChromeOS (a platform you don't support at all yet). Making rust an optional dependency and using Go for almost everything is expected to fix #89, #83 (with gccgo), #77, #70, and #62. Mac support unclear as I don't have access to hardware at this time.