Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ production.
|---------|-------|
| Realm | `hypershell` |
| Frontend client | `hypershell-frontend` (public, standard flow + direct access grants) |
| CLI client | `hypershell-cli` (public, standard flow + device authorization grant, used by `hsctl login`) |
| Provisioner client | `hypershell-provisioner` (confidential, service account) |
| Control plane client | `hypershell-control-plane` (confidential, service account, client_credentials) |
| Admin user | `admin` / `admin` (role: `hypershell-admins`) |
Expand Down Expand Up @@ -203,6 +204,23 @@ session management during `make kind-up`.
4. Sign in with `admin`/`admin` or `developer`/`developer`
5. Keycloak redirects back to the web console with a valid session

### hsctl login (management API)

Build the CLI with `make build-cli`, then authenticate against the Kind cluster:

```bash
./components/cli/hsctl login \
--url https://api.hypershell.localhost \
--issuer-url https://keycloak.hypershell.localhost/realms/hypershell \
--insecure
```

For headless environments, add `--no-browser` to use the device authorization flow.
The CLI stores tokens in `~/.config/hypershell/config.json` (or `~/.hypershell.json`
if that legacy path already exists) and uses the `hypershell-cli` Keycloak client.

Check identity with `hsctl whoami` and log out with `hsctl logout`.

### Hot reload and OIDC

Web console hot reload (`make kind-web-console-up`) runs the Vite dev server
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ generate-cli:
cd scripts/cli-generator && go run . \
--spec ../../components/api-server/openapi/openapi.yaml \
--out ../../components/cli \
--binary hypershell \
--binary hsctl \
--project hypershell \
--api-prefix /api/hypershell/v1 \
--module github.com/openshift-online/hypershell/components/cli
Expand Down
2 changes: 1 addition & 1 deletion components/api-server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ generate-cli:
cd "$(CLI_GENERATOR_DIR)" && GOWORK=off go run . \
--spec "$(OPENAPI_SPEC)" \
--out "$(CLI_DIR)" \
--binary hypershell \
--binary hsctl \
--project hypershell \
--api-prefix "$(SDK_API_PREFIX)" \
--module "$(CLI_MODULE)"
Expand Down
6 changes: 3 additions & 3 deletions components/cli/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ RUN go mod download
COPY cmd/ cmd/
COPY pkg/ pkg/

RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o hypershell ./cmd/hypershell
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o hsctl ./cmd/hypershell

FROM registry.access.redhat.com/hi/static:1787099997@sha256:f4d5109b57cf7eab0a7adc566f2d78f80fa0c5ec9ccab698c9fb8eb448db6071

COPY --from=builder /workspace/hypershell /usr/local/bin/
COPY --from=builder /workspace/hsctl /usr/local/bin/

ENTRYPOINT ["/usr/local/bin/hypershell"]
ENTRYPOINT ["/usr/local/bin/hsctl"]

LABEL org.opencontainers.image.title="HyperShell CLI" \
org.opencontainers.image.description="Command line tool for the HyperShell API server" \
Expand Down
8 changes: 4 additions & 4 deletions components/cli/cmd/hypershell/apply/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ var Cmd = &cobra.Command{
Short: "Apply resources from file or directory",
Long: "Apply resources from YAML files or kustomize directories.\n\n" +
"Examples:\n" +
" hypershell apply -f resource.yaml\n" +
" hypershell apply -f ./resources/\n" +
" hypershell apply -k ./overlays/prod/\n" +
" hypershell apply -f - < resource.yaml",
" hsctl apply -f resource.yaml\n" +
" hsctl apply -f ./resources/\n" +
" hsctl apply -k ./overlays/prod/\n" +
" hsctl apply -f - < resource.yaml",
Args: cobra.NoArgs,
RunE: run,
}
Expand Down
6 changes: 3 additions & 3 deletions components/cli/cmd/hypershell/completion/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ var Cmd = &cobra.Command{
Short: "Generate shell completion scripts",
Long: "Generate shell completion scripts for the CLI.\n\n" +
"Examples:\n" +
" hypershell completion bash > /etc/bash_completion.d/hypershell\n" +
" hypershell completion zsh > \"${fpath[1]}/_hypershell\"\n" +
" hypershell completion fish > ~/.config/fish/completions/hypershell.fish",
" hsctl completion bash > /etc/bash_completion.d/hsctl\n" +
" hsctl completion zsh > \"${fpath[1]}/_hsctl\"\n" +
" hsctl completion fish > ~/.config/fish/completions/hsctl.fish",
Args: cobra.ExactArgs(1),
ValidArgs: []string{"bash", "zsh", "fish"},
RunE: run,
Expand Down
4 changes: 2 additions & 2 deletions components/cli/cmd/hypershell/create/gateway/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ var Cmd = &cobra.Command{
Short: "Create a gateway",
Long: "Create a new gateway.\n\n" +
"Examples:\n" +
" hypershell create gateway --cluster-id <value> --database-id <value> --external-dns <value> --image <value> --name <value> --phase <value> --release-id <value> --route <value> --server-dns-names <value> --service-type <value> --status <value> --supervisor-image <value> --tls-mode <value> \n" +
" hypershell create gateway --body request.json",
" hsctl create gateway --cluster-id <value> --database-id <value> --external-dns <value> --image <value> --name <value> --phase <value> --release-id <value> --route <value> --server-dns-names <value> --service-type <value> --status <value> --supervisor-image <value> --tls-mode <value> \n" +
" hsctl create gateway --body request.json",
Args: cobra.NoArgs,
RunE: run,
}
Expand Down
4 changes: 2 additions & 2 deletions components/cli/cmd/hypershell/create/gatewayNetwork/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ var Cmd = &cobra.Command{
Short: "Create a gatewayNetwork",
Long: "Create a new gatewayNetwork.\n\n" +
"Examples:\n" +
" hypershell create gatewayNetwork --hub-gateway-id <value> --name <value> --status <value> --topology <value> --tunnel-mode <value> \n" +
" hypershell create gatewayNetwork --body request.json",
" hsctl create gatewayNetwork --hub-gateway-id <value> --name <value> --status <value> --topology <value> --tunnel-mode <value> \n" +
" hsctl create gatewayNetwork --body request.json",
Args: cobra.NoArgs,
RunE: run,
}
Expand Down
4 changes: 2 additions & 2 deletions components/cli/cmd/hypershell/create/gatewayRelease/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ var Cmd = &cobra.Command{
Short: "Create a gatewayRelease",
Long: "Create a new gatewayRelease.\n\n" +
"Examples:\n" +
" hypershell create gatewayRelease --canary-duration <value> --canary-percent <value> --image <value> --name <value> --rollout-strategy <value> --status <value> \n" +
" hypershell create gatewayRelease --body request.json",
" hsctl create gatewayRelease --canary-duration <value> --canary-percent <value> --image <value> --name <value> --rollout-strategy <value> --status <value> \n" +
" hsctl create gatewayRelease --body request.json",
Args: cobra.NoArgs,
RunE: run,
}
Expand Down
4 changes: 2 additions & 2 deletions components/cli/cmd/hypershell/create/managedCluster/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ var Cmd = &cobra.Command{
Short: "Create a managedCluster",
Long: "Create a new managedCluster.\n\n" +
"Examples:\n" +
" hypershell create managedCluster --api-server-url <value> --kubeconfig-secret <value> --name <value> --provider <value> --region <value> --status <value> \n" +
" hypershell create managedCluster --body request.json",
" hsctl create managedCluster --api-server-url <value> --kubeconfig-secret <value> --name <value> --provider <value> --region <value> --status <value> \n" +
" hsctl create managedCluster --body request.json",
Args: cobra.NoArgs,
RunE: run,
}
Expand Down
4 changes: 2 additions & 2 deletions components/cli/cmd/hypershell/create/managedDatabase/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ var Cmd = &cobra.Command{
Short: "Create a managedDatabase",
Long: "Create a new managedDatabase.\n\n" +
"Examples:\n" +
" hypershell create managedDatabase --connection-secret <value> --engine <value> --engine-version <value> --instance-class <value> --name <value> --provider <value> --region <value> --status <value> \n" +
" hypershell create managedDatabase --body request.json",
" hsctl create managedDatabase --connection-secret <value> --engine <value> --engine-version <value> --instance-class <value> --name <value> --provider <value> --region <value> --status <value> \n" +
" hsctl create managedDatabase --body request.json",
Args: cobra.NoArgs,
RunE: run,
}
Expand Down
4 changes: 2 additions & 2 deletions components/cli/cmd/hypershell/create/role/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ var Cmd = &cobra.Command{
Short: "Create a role",
Long: "Create a new role.\n\n" +
"Examples:\n" +
" hypershell create role --built-in <value> --description <value> --display-name <value> --name <value> --permissions <value> \n" +
" hypershell create role --body request.json",
" hsctl create role --built-in <value> --description <value> --display-name <value> --name <value> --permissions <value> \n" +
" hsctl create role --body request.json",
Args: cobra.NoArgs,
RunE: run,
}
Expand Down
4 changes: 2 additions & 2 deletions components/cli/cmd/hypershell/create/roleBinding/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ var Cmd = &cobra.Command{
Short: "Create a roleBinding",
Long: "Create a new roleBinding.\n\n" +
"Examples:\n" +
" hypershell create roleBinding --gateway-id <value> --role-id <value> --scope <value> --user-id <value> \n" +
" hypershell create roleBinding --body request.json",
" hsctl create roleBinding --gateway-id <value> --role-id <value> --scope <value> --user-id <value> \n" +
" hsctl create roleBinding --body request.json",
Args: cobra.NoArgs,
RunE: run,
}
Expand Down
4 changes: 2 additions & 2 deletions components/cli/cmd/hypershell/delete/gateway/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ var Cmd = &cobra.Command{
Short: "Delete a gateway",
Long: "Delete a gateway by ID.\n\n" +
"Examples:\n" +
" hypershell delete gateway 2abc123\n" +
" hypershell delete gateway 2abc123 --yes",
" hsctl delete gateway 2abc123\n" +
" hsctl delete gateway 2abc123 --yes",
Args: cobra.ExactArgs(1),
RunE: run,
}
Expand Down
4 changes: 2 additions & 2 deletions components/cli/cmd/hypershell/delete/gatewayNetwork/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ var Cmd = &cobra.Command{
Short: "Delete a gatewayNetwork",
Long: "Delete a gatewayNetwork by ID.\n\n" +
"Examples:\n" +
" hypershell delete gatewayNetwork 2abc123\n" +
" hypershell delete gatewayNetwork 2abc123 --yes",
" hsctl delete gatewayNetwork 2abc123\n" +
" hsctl delete gatewayNetwork 2abc123 --yes",
Args: cobra.ExactArgs(1),
RunE: run,
}
Expand Down
4 changes: 2 additions & 2 deletions components/cli/cmd/hypershell/delete/gatewayRelease/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ var Cmd = &cobra.Command{
Short: "Delete a gatewayRelease",
Long: "Delete a gatewayRelease by ID.\n\n" +
"Examples:\n" +
" hypershell delete gatewayRelease 2abc123\n" +
" hypershell delete gatewayRelease 2abc123 --yes",
" hsctl delete gatewayRelease 2abc123\n" +
" hsctl delete gatewayRelease 2abc123 --yes",
Args: cobra.ExactArgs(1),
RunE: run,
}
Expand Down
4 changes: 2 additions & 2 deletions components/cli/cmd/hypershell/delete/managedCluster/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ var Cmd = &cobra.Command{
Short: "Delete a managedCluster",
Long: "Delete a managedCluster by ID.\n\n" +
"Examples:\n" +
" hypershell delete managedCluster 2abc123\n" +
" hypershell delete managedCluster 2abc123 --yes",
" hsctl delete managedCluster 2abc123\n" +
" hsctl delete managedCluster 2abc123 --yes",
Args: cobra.ExactArgs(1),
RunE: run,
}
Expand Down
4 changes: 2 additions & 2 deletions components/cli/cmd/hypershell/delete/managedDatabase/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ var Cmd = &cobra.Command{
Short: "Delete a managedDatabase",
Long: "Delete a managedDatabase by ID.\n\n" +
"Examples:\n" +
" hypershell delete managedDatabase 2abc123\n" +
" hypershell delete managedDatabase 2abc123 --yes",
" hsctl delete managedDatabase 2abc123\n" +
" hsctl delete managedDatabase 2abc123 --yes",
Args: cobra.ExactArgs(1),
RunE: run,
}
Expand Down
4 changes: 2 additions & 2 deletions components/cli/cmd/hypershell/delete/role/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ var Cmd = &cobra.Command{
Short: "Delete a role",
Long: "Delete a role by ID.\n\n" +
"Examples:\n" +
" hypershell delete role 2abc123\n" +
" hypershell delete role 2abc123 --yes",
" hsctl delete role 2abc123\n" +
" hsctl delete role 2abc123 --yes",
Args: cobra.ExactArgs(1),
RunE: run,
}
Expand Down
4 changes: 2 additions & 2 deletions components/cli/cmd/hypershell/delete/roleBinding/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ var Cmd = &cobra.Command{
Short: "Delete a roleBinding",
Long: "Delete a roleBinding by ID.\n\n" +
"Examples:\n" +
" hypershell delete roleBinding 2abc123\n" +
" hypershell delete roleBinding 2abc123 --yes",
" hsctl delete roleBinding 2abc123\n" +
" hsctl delete roleBinding 2abc123 --yes",
Args: cobra.ExactArgs(1),
RunE: run,
}
Expand Down
Loading
Loading