Skip to content

The strait command ​

strait reads the state of Strait at one site and explains it. It is read-only: it never creates, updates, patches or deletes an object. Install puts it on the PATH, with kubectl-strait next to it.

Commands ​

CommandShows
strait statusThe site and its controller's version, its peers, and where every application name points.
strait explain SITESERVICEWhy one name points where it does: the reason, every member's observation, every site's declaration.
strait linksEvery link to a peer, its health, and which link carries the traffic.
strait peersEvery peer, and whether its observations can be read.
strait validate -f PATHChecks manifests offline, with the rules of the CRDs.
strait --skillPrints the skill document for AI agents.
strait versionThe CLI's version and commit. strait --version prints them on one line.
strait completion SHELLThe completion script for bash, zsh, fish or powershell.

strait --help, strait COMMAND --help and the man pages in the release archive cover every command and flag. The design is in RFC0006.

Flags ​

FlagDoes
--contextThe kubeconfig context to read. Each command that reads a cluster reads one site, so pass --context for each.
--kubeconfigThe kubeconfig file. Defaults to $KUBECONFIG, then ~/.kube/config.
-n, --namespaceThe namespace of namespaced objects. Defaults to the context's namespace.
-A, --all-namespacesRead namespaced objects in every namespace.
-o, --outputtable, json or yaml, for every command that prints state, a validation or a version.

Exit status ​

StatusWhen
0Success. Validation warnings alone exit 0.
1A validation error or a failed read.
2A usage error.

Output on a terminal ​

On a terminal, strait explain marks the route with a symbol: ✔ a route to a confirmed member, ▲ a route kept while a member is Unknown or the controller awaits its peers, ■ a route to nowhere. Green shows what works, yellow a warning, and red what stops traffic. Colours are off when NO_COLOR is set. Piped or redirected, the output is plain text, and -o json and -o yaml never change.

kubectl strait ​

Installed as kubectl-strait, or kubectl-strait.exe on Windows, the same commands run as kubectl strait.

The skill for AI agents ​

strait --skill > <skills dir>/strait/SKILL.md installs a skill that explains how to read Strait's state.

Shell completion ​

Completion covers commands, flags, the values of -o, the kubeconfig's contexts, and the names of namespaces and SiteServices. Names come from the context's cluster, within 2s. A completion never asks for credentials.

ShellAdd
bashsource <(strait completion bash) in ~/.bashrc. Needs the bash-completion package.
zshsource <(strait completion zsh) in ~/.zshrc, after compinit.
fishstrait completion fish > ~/.config/fish/completions/strait.fish
PowerShellstrait completion powershell | Out-String | Invoke-Expression in $PROFILE.
kubectl straitA link named kubectl_complete-strait to the binary, on the PATH: ln -s "$(command -v kubectl-strait)" ~/.local/bin/kubectl_complete-strait. On Windows, a copy of kubectl-strait.exe named kubectl_complete-strait.exe next to it. kubectl 1.26 or later runs it to complete kubectl strait.

On Windows ​

DifferenceDetail
Exit status of kubectl strait1 on every failure, and kubectl adds the line Error: exit status N, because on Windows kubectl runs a plugin as a child process. strait.exe exits with 0, 1 or 2 as on other systems.
Man pagesWindows has no man. strait --help and strait COMMAND --help hold the same text.
Skill documentCopy SKILL.md from the archive into <skills dir>\strait\. In Windows PowerShell 5.1, strait --skill > SKILL.md writes UTF-16LE, not the UTF-8 that strait prints.

Released under the Apache License 2.0.