Prepare SSH access to OCI compute hosts through OCI Bastion without making the operator think about sessions, OCIDs, or temporary bastion hostnames.
hop is the small front-door CLI for the OCI SSH workflow:
- prepare
ssh <host>without opening a shell session - explain why a host-facing SSH route will or will not work
- track a compute instance from Terraform outputs
- create or renew the OCI Bastion managed SSH session
- write the VM-facing SSH config so the final command is still
ssh <host>
It wraps the lower-level oci-context and bastion-session CLIs with one
operator-friendly Cobra command surface.
oci-contextbastion-session- OCI CLI (
oci) with a working config/auth profile and access to the target tenancy and Bastion resources.
Homebrew is the preferred install path and installs hop and oci-hop under
Homebrew's bin directory, such as /opt/homebrew/bin on Apple Silicon macOS:
brew tap adrianmross/tap
brew install oci-hopSource install is also supported. It installs to /usr/local/bin by default;
set PREFIX to choose another install prefix.
curl -sSL https://raw.githubusercontent.com/adrianmross/oci-hop/main/install.sh | bashCheck local dependencies and context:
hop doctorExplain the host-facing SSH path:
hop explain my-vps-01Create or reuse the bastion session, update SSH config, and stop before SSH:
hop my-vps-01Install shell integration for completions and the optional hssh helper:
hop setup shell --installThe primary workflow remains hop <host> followed by ssh <host>. The hssh
helper is for people who want one command that prepares the route and then
connects. Pass SSH options after the host, for example hssh my-vps-01 -L 8080:127.0.0.1:80.
Use a longer session wait when OCI Bastion takes more time to activate:
oci-hop --wait-timeout 3m ensure my-vps-01
oci-hop ensure my-vps-01 --wait-timeout 3mhop requests a 3-hour Bastion session TTL when it creates a new session. OCI
still caps the actual session lifetime at the selected Bastion resource's
configured maximum.
Text commands print compact progress on stderr while they prepare auth,
Bastion, and SSH config. In an interactive terminal, ensure defaults to a
small human summary; when stdout is captured it keeps JSON output for tools and
agents. Use ensure -o text or ensure -o json to force the format,
--silent to suppress progress output, or --verbose to print every progress
step as plain log lines.
Successful preparation prints a compact status line:
ready my-vps-01 10.0.1.25 via my-bastion
Connect to the compute instance, not to the bastion alias:
ssh my-vps-01If you want oci-hop to prepare the route and then run the SSH command, use:
oci-hop ssh my-vps-01To reconnect after SSH transport disconnects, pass --reconnect. SSH options
and remote commands belong after -- so oci-hop does not parse them:
hop ssh --reconnect my-vps-01 -- -t tmux new -s 0 -AEThe durable target is the compute host alias you already type, such as
my-vps-01.
hop keeps the internal bastion jump host fresh, but the operator-facing
target remains:
Host my-vps-01
HostName 10.0.1.25
User cloud-user
ProxyJump my-bastionThat means ssh my-vps-01 goes through OCI Bastion while still landing directly
on the compute instance.
Use Cobra help for the full command reference:
hop --help
hop <command> --helpThe qualified command is available when scripts need a less generic binary name:
oci-hop my-vps-01Reusable agent guidance lives in:
skills/: runtime-neutral workflow instructions foroci-contextandbastion-sessionagents/: adapter metadata and quick prompts for different agent runtimes.codex-plugin/: Codex packaging for the same portable skills
go test ./...
go vet ./...
go build ./cmd/oci-hop
go test -tags=e2e ./...The default Go test suite includes strict hermetic command-contract coverage.
The e2e tagged tests use fake oci and ssh shims while exercising real
oci-context and bastion-session binaries. Override those binaries with:
OCI_CONTEXT_BIN=/path/to/oci-context \
BASTION_SESSION_BIN=/path/to/bastion-session \
go test -tags=e2e ./...JSON schema files live under schemas/. The Go tests validate top-level
compatibility for the public command contract.
