Install and sign in

Install

curl -fsSL https://your-konnecthub-host/install.sh | sh

On Windows, from PowerShell:

irm https://your-konnecthub-host/install.ps1 | iex

The installer is served by the same KonnectHub you sign in to, and that is the point: the CLI you get is the one that matches the API you will talk to. Both scripts check the download against a published checksum and only move the binary into place once it matches.

The POSIX one needs curl or wget and runs under plain sh. The PowerShell one needs 5.1 or newer — what Windows 10 and 11 ship — and works in pwsh too. Neither touches your shell configuration or your PATH: they print the line to add and leave the decision to you.

Sign in

konnecthub login

This opens a browser, asks which workspace to grant, and stores the credentials on your machine.

konnecthub whoami     # the active token, its identity, workspace and scopes
konnecthub logout     # forget the stored credentials

whoami is the first thing to run when something behaves as though you are someone else — it prints the scopes the current token actually carries, and the file it came from.

Where the token is stored

Tokens are stored per origin and workspace, so being a member of several workspaces does not mean signing in again every time you switch between repos.

konnecthub init copies the token it used into the new project, so a repo carries its own from the moment it exists.

Changing what the CLI may do

The approval page lists every permission the platform has, with the ones the CLI asked for already ticked. Untick what it should not have, or open Grant more than it asked for and add what it needs. Whatever is ticked when you approve is what the token carries — and it can never do more than your own role allows, so approving a permission you do not hold yourself grants nothing.

A token's scopes are fixed once it is minted. To change them, sign in again:

konnecthub login
konnecthub login --scopes +DataStore__Write   # the usual set, plus one
konnecthub login --scopes Flow__Read          # exactly this, and nothing else

The new token replaces the stored one for that workspace; a token for any other workspace is left alone. It does not replace the old token on the server — that one stays valid until it expires, ninety days after it was created. If it might be on a machine you no longer control, revoke it as well: it is listed with your other access tokens, named konnecthub cli.

CI

CI has no browser. Set a personal access token instead:

export KONNECTHUB_TOKEN=…
konnecthub deploy

This is a first-class path, not a fallback. Grant the token the least it needs — a deploy pipeline usually wants Flow__Write and Deployment__Write and nothing else.

Shell completion

konnecthub completions bash > ~/.local/share/bash-completion/completions/konnecthub
konnecthub completions zsh  > "${fpath[1]}/_konnecthub"
konnecthub completions fish > ~/.config/fish/completions/konnecthub.fish
konnecthub completions powershell | Add-Content -Path $PROFILE

With the argument left off it guesses: from $SHELL, or — since PowerShell sets no such variable — from being in a PowerShell session at all. Open a new shell afterwards.

TAB then completes commands and flags, and — inside a project — the names of your linked flows and of the fixtures under <flow>/tests/, so konnecthub deploy <TAB> offers what this repo actually has.

Staying in step with the API

konnecthub upgrade

Installs the version your API serves. The API advertises a minimum CLI version, and a CLI below that floor refuses to run rather than half-working — exit code 4, with the upgrade command in the message.

Uninstall

There is no konnecthub uninstall. The installer writes one directory and never edits a shell config, so removing the CLI is removing that directory — plus revoking what it stored.

Revoke first, while you can still tell which token is this machine's. logout forgets the credentials here and deliberately leaves the token itself alive, because the same token may be in use elsewhere; deleting the file only loses its id.

konnecthub api GET /auth/personal-tokens          # "last used" identifies this machine
konnecthub api DELETE /auth/personal-tokens/<id>

Your token list does the same with a button.

Then delete the CLI home — the binary, the global credentials.json and the shared caches all live there.

rm -rf "${KONNECTHUB_HOME:-$HOME/.konnecthub}"

Any project you signed into keeps its own token in its own .konnecthub/. Remove those too:

rm -rf <project>/.konnecthub

On Windows, from PowerShell:

Remove-Item -Recurse -Force "$env:USERPROFILE\.konnecthub"

KONNECTHUB_HOME moves that directory and the installer honours it, so a per-user or in-container install is not necessarily under your home directory.

Last, undo what the installer printed rather than performed. It declines to write to your shell's configuration, so these exist only if you acted on what it told you:

rm -f ~/.local/share/bash-completion/completions/konnecthub \
      ~/.config/fish/completions/konnecthub.fish
# zsh: the _konnecthub you wrote into $fpath

Exit codes

Every command accepts --json, and every command exits with one of:

CodeMeaning
0Success
1Ran and failed — a bundle failed, a test failed, a conflict is in the tree
2A decision is needed and there is no TTY to ask. The message names the flag that answers it
3Not authenticated — no token, or it expired or was revoked
4The CLI is below this API's minimum version

Code 2 is the one that matters in CI: it means the command stopped rather than guessing.

Next