Skip to content

RezaOnGithub/local-infra-cli-agent

Repository files navigation

Infra Review

Dead-simple set-up for using CLI agents without a full-featured forge or an external forge like Github.

The simple_forge container is an SSH server with Git installed. The keygen one-shot container generates SSH client keys for mounted development home volumes and publishes their public keys into the forge user's authorized_keys.

Basic Workflow

Build and start the stack:

docker compose up --build

The forge SSH port is published on the host as 8122, and containers on the Compose network can use the generated SSH host alias:

git@forge.local

Inside a development container, the generated SSH client config points the forge.local host at the generated key in ~/.ssh.

To inject additional public keys, set INJECTED_KEYS to the JSON emitted by the encode helper:

cargo run --manifest-path key_fixer_upper/Cargo.toml --bin encode -- ~/.ssh/key_name.pub -r 'ssh-ed25519 AAAA... user@host' # inline public key

Key State

Per-container generated-key history is stored in each mounted home volume under .ssh/MyVolLog.json. The forge-side persistent key list is stored at /home/git/.ssh/MyConfig.json inside the forge volume.

Previously persisted keys are intentionally preserved. If a key was authorized on an earlier run but is not seen in the current scan or INJECTED_KEYS, setup warns about it and keeps it in authorized_keys. Remove stale entries manually from the persisted config if revocation is desired.

About

Small Docker Compose Set-Up For Using CLI Agents (And Other Things)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors