Installation
Kanject ships as a .NET global tool. Install the CLI once per machine, install the template pack so kanject new has something to scaffold from, then run kanject doctor to confirm everything is wired up.
Verify the toolchain
Before installing the CLI itself, confirm the underlying tools are present at the right versions:
dotnet --version # 10.0 or higher
aws --version # aws-cli/2.x
git --version # git version 2.x
dotnet lambda --version If any of those fails, install or upgrade it first — kanject doctor refuses a clean bill of health until they're all present.
Install the AWS Lambda tooling
Required by kanject deploy (Lambda packaging) and kanject test (local Lambda TestTool):
dotnet tool install -g Amazon.Lambda.Tools
dotnet tool update -g Amazon.Lambda.Tools Install kanject
The CLI distributes through your team's NuGet feed (typically AWS CodeArtifact). Replace <source> with the feed URL your team distributes:
dotnet tool install -g Kanject.Cli --add-source <source> Upgrade
Once kanject is on your PATH, the ergonomic upgrade path is its own command — it checks both the CLI and the template pack and applies them together:
kanject update # interactive; checks CLI + templates
kanject update --yes # non-interactive (CI) If you're on a build that predates kanject update, fall back to:
dotnet tool update -g Kanject.Cli --add-source <source> PATH setup
The .NET global-tools directory must be on your PATH so the kanject shim resolves. Standard locations: ~/.dotnet/tools (macOS / Linux) and %USERPROFILE%\.dotnet\tools (Windows). If kanject --version works in one shell but a fresh terminal returns "command not found", PATH isn't picked up.
macOS / Linux (zsh):
echo 'export PATH="$HOME/.dotnet/tools:$PATH"' >> ~/.zprofile
source ~/.zprofile Windows (PowerShell, persists for the user):
[Environment]::SetEnvironmentVariable(
"Path",
$env:Path + ";$env:USERPROFILE\.dotnet\tools",
"User") kanject doctor raises KANCLI018 if the global-tools directory isn't on PATH.
Install the project templates
kanject new scaffolds projects from the Kanject.Project.Templates.Aws NuGet pack. You don't have to install the templates manually — kanject new offers to install them on first run — but you can prime the cache:
dotnet new install Kanject.Project.Templates.Aws --add-source <source> First-run check
kanject --version
kanject doctor Without --env, doctor only checks the foundations: the .NET SDK, the global-tools PATH, and the manifest if you're inside a kanject project. A clean run looks like:
✓ dotnet 10.0.x
✓ global tools on PATH (~/.dotnet/tools)
✓ kanject-cli/manifest.json (schema v1)
ok: 3 warn: 0 error: 0 If you're not inside a kanject project yet, the manifest check is skipped — that's expected. The next step is Quick Start.
Uninstall
dotnet tool uninstall -g Kanject.Cli