Kanject.Cli 1.1.0

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global Kanject.Cli --version 1.1.0
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local Kanject.Cli --version 1.1.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=Kanject.Cli&version=1.1.0
                    
nuke :add-package Kanject.Cli --version 1.1.0
                    

Kanject.Cli

A single .NET global tool that drives C# AWS services from dotnet new to kanject aws deploy --env prod — wrapping the existing dotnet/AWS toolchain so your inner loop stays vanilla and the Lambda, ECS Fargate, static-site, and coupled full-stack deploy plumbing disappears behind one committed manifest.

Install

dotnet tool install --global Kanject.Cli

Requires the .NET 10 SDK. The aws, msbuild, and github providers ship in the box — no extra installs.

Choose a workflow

  • Deploy applications: Lambda, ECS Fargate, or a coupled SPA/backend. Choose independent service roots, a shared multi-Lambda stack, or a coordinated frontend/backend pair.
  • Publish libraries: kanject packages init, then kanject packages plan and kanject packages verify from the package repository root.
  • Distribute desktop apps: initialize the product manifest, register with kanject add distributable, and configure delivery destinations.

Start at Getting started for workflow selection. Service commands run from the directory containing that service's manifest, which can differ from the repository or solution root. The current static-site shape requires a coupled backend.

Discover commands with kanject --help and kanject aws --help.

What it does

  • Bootstrap — dotnet new + kanject init puts the manifest, NuGet config, and dotnet-tool pinning in place in one step.
  • Deploy — kanject aws deploy --env <stage> resolves cross-repo dependencies and env, builds the provider artifacts, and ships the manifest's target (Lambda, ECS Fargate, static site, or a coupled backend + site), recording every release in an S3 deployment ledger.
  • Rollback — kanject aws rollback --env prod shows the last 10 deployments with dates, statuses, targets, and commit summaries; pick one and Kanject does the target-native promotion with the prior artifact still immutable in S3/ECR.
  • And more — cross-repo dependency sync, a local test runner, env/param/secret management, static-site preview environments, VPC & custom-domain wiring, multi-function services, and AWS-native pipeline scaffolding.

It invokes — never replaces — dotnet new, dotnet build, and dotnet lambda, and drives AWS services through their SDK APIs (including CloudFormation change sets). The dotnet-native experience stays; kanject only owns the AWS plumbing that doesn't have a great answer in the box.

Learn more

License

Commercial — governed by the Kanject Code Libraries License Agreement (KCLLA); see the bundled LICENSE.md. © Kanject Business Solutions.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
2.5.0 103 11/16/2026
2.4.0 93 11/16/2026
2.3.0 113 11/15/2026
2.2.0 128 11/14/2026
2.1.0 96 11/13/2026
2.0.2 102 11/13/2026
2.0.1 94 11/13/2026
2.0.0 100 11/12/2026
1.5.1 123 11/11/2026
1.5.0 121 11/10/2026
1.4.0 106 11/4/2026
1.3.0 119 11/2/2026
1.2.0 157 11/1/2026
1.1.0 115 11/1/2026
1.0.79 111 10/30/2026
1.0.78 101 10/30/2026
1.0.77 108 10/29/2026
1.0.76 102 10/29/2026
1.0.75 100 10/29/2026
1.0.74 101 10/28/2026
Loading failed

- `kanject aws deploy` can put any Lambda entry behind a managed, streaming Function URL and CloudFront, recorded in the ledger (proposal 0048 r3 §9).
 A stage's `http.<entry>` can now be a managed `function-url` with `responseMode: streaming` (Lambda streams past the 6 MB buffered limit), on an entry with the Web Adapter host. The deploy renders `<stack>-http-<entry>`: the Function URL on the entry's `live` alias with both permissions a `NONE` URL needs and, with the optional `cloudFront` block, a distribution in front of it.
 - The distribution uses managed `CachingDisabled` and `AllViewerExceptHostHeader`. It sends an origin-secret header from Secrets Manager, pinned to the version current at each deploy, so rotating is `put-secret-value` and then a deploy. It can carry `GET`/`HEAD`-only methods, a us-east-1 custom domain with Route 53 records, a WAF ACL and response headers added when missing (a Basic `WWW-Authenticate` challenge, which Function URLs rename).
 - The edge is reconciled before promotion when the alias exists, so a failure leaves traffic in place, or after it on a first deploy. It is verified through CloudFront, and the bare URL must refuse a request without the secret at `cloudFront.originCheckPath`, a guarded path that is required and can't be the readiness path the adapter calls without the secret.
 - The ledger records it under `httpEdges`. Rollback audits each edge against a fresh render before moving an alias, and a single-entry weighted rollout canaries through it.
 - Multi-entry services can front any entry. An edge the stage stops declaring is never deleted silently.
 - New codes: `KANCLI572` (certificate or zone) and `KANCLI577` (origin secret); the rest reuse 0048's `KANCLI674–680`.
 - This replaces hand-written edge stacks such as the licence feed's `infra/feed-edge`. Its live proof on AWS is still to come.

- A Lambda entry can declare the Web Adapter host, and kanject wires it (proposal 0048 r3 §9.2).
 `"httpHost": {"kind": "web-adapter"}` on a manifest entry runs ASP.NET Core on Kestrel behind the Lambda Web Adapter, as a Native AOT binary on `provided.al2023`. kanject adds the adapter layer for the stage's region (arm64, pinned at version 30 and checked live before anything builds, `KANCLI579`). It replaces any hand-pinned adapter layer and writes `AWS_LWA_PORT` and `ASPNETCORE_HTTP_PORTS` onto every function it owns. With a managed Function URL (below) it also writes `AWS_LWA_INVOKE_MODE`, the readiness check and the origin secret's id; otherwise the template's own invoke mode stands. The host contract is checked before the build (`KANCLI581`): the entry must be Native AOT, and `Amazon.Lambda.AspNetCoreServer*`, which replaces Kestrel whenever Lambda runs it, must not appear anywhere in its restore closure. That includes packages brought in through a class library; the message gives the `dotnet nuget why` command that finds it. A stage or `entryEnv` that sets one of the adapter's keys is refused (`KANCLI573`), and a stage template kept as written must already carry the adapter (`KANCLI582`).

- The Web Adapter layer is a locked dependency, a hand-written edge can be adopted, and streaming is verified through the edge (proposal 0048 r4 §9.9).
 - Locked adapter. `kanject aws web-adapter upgrade` pins the layer version in `manifest.lock.json`, through `kanject sync` so the lock hash stays consistent. Deploy uses the pinned version and refuses one this CLI hasn't verified (`KANCLI579`). An unpinned or older lock warns `KANCLI578`.
 - Adoption. `kanject aws deploy --adopt-edge <STACK>` moves a hand-written edge's Function URL, permissions and CloudFront distribution into kanject's stack with a validated CloudFormation stack refactor (`KANCLI576`). The distribution keeps its id and domain; Route 53 records stay in the old stack and keep pointing at it. Before anything moves, adoption refuses (naming each setting) if kanject's render of the stage's `http` block would drop an alias, certificate, WAF ACL, response header or origin header, change the allowed methods, or change the URL's mode or auth.
 - Streaming verification. `verification.stream` fetches a large response through CloudFront (bearer or Basic credentials) and checks the time to first byte and the body size. Only a body over 6 MB counts as proof of streaming. `verification.headers` checks headers on the health response. The bare URL must refuse with 401/403; any other failure is recorded unverified.
 - Refused before building. `AWS_LWA_ENABLE_COMPRESSION` with streaming (`KANCLI573`), and a streaming URL on a VPC-attached stage (`KANCLI674`).
 - Warnings. A missing readiness route and Kestrel endpoints set in code or settings (`KANCLI580`), and a `maxResponseBytes` that outlasts the function's timeout (`KANCLI575`).
 - Rollback refuses a target version that doesn't run behind the adapter while an edge serves it (`KANCLI581`).
 - One port. `httpHost.port` renders both Kestrel's and the adapter's port.
 - Dry run and doctor. `--dry-run` prints each streaming edge's limits and cost. `doctor --env` reports each edge's URL invoke mode, auth and alias binding, and the live adapter layer.

- A fresh git worktree builds its cross-repo libraries without fetching them.
 A linked worktree's `.kanject/cache` is gitignored, so it starts empty, and its first build failed `KANBUILD001`. Once a library's `main` had moved, `kanject sync --locked` failed `KANCLI196` too, until someone ran a plain sync or copied `.kanject/` across by hand. `kanject sync` now copies each locked clone that the main checkout's cache already holds, so `kanject sync --offline` in a new worktree needs no network and no library credentials. `KANBUILD001` now names that command, and `KANCLI196` lists each library that moved since the lock was written (`locked a81c0fd, now b04ff21`) and says how to build the committed commits instead.

- `entryEnv` references resolve, and a skipped alias routing says why.
 A stage's per-entry overlay (`entryEnv.<entry>`) now resolves its `secret:` and `param:` values the same way stage `env` does, so a per-entry secret reaches only that entry's function. Through 1.0.79 those values deployed as their literal text, for example `secret:svc/dev/key`. An overlay that reaches the deployer unresolved now stops the deploy (`KANCLI696`) instead of shipping the reference. Separately, when a template sets `Globals.Api` or `Globals.HttpApi`, or declares its own API beside implicit `Api`/`HttpApi` events, `kanject aws deploy` now warns `KANCLI682` and names the cause. kanject leaves that API's events on the function, so rollback and weighted rollouts don't move their traffic. Until now the router skipped them without saying so.

- Under the changelog versioning model, `packages release` honours declared release intents.
 Until now the model ignored `packaging/intent/`. The version rose by `--part`, or by `patch` when nothing was passed, so a declared minor shipped as a patch unless whoever ran the release remembered `--part minor`, and the declaration was left behind. Now:
 - The highest declared part is the default, and `--part` (or the interactive choice, which starts there) can only raise it. A lower `--part` is `KANCLI604`.
 - The release commit deletes the declarations it resolved, and its body records the part and their notes.
 - A version left open by the earlier workflow (an `X.Y.Z - unreleased` heading) releases at its own number, so a run that finds declarations stops with `KANCLI604` instead of dropping them. The release notes still come from the changelog fragments alone.

- Stage files accept an `aws` block.
 It is empty for now and nothing moves into it: it is the place AWS-specific settings land from here on, so that a later schema change can carry the existing top-level AWS fields (`region`, `stack`, `function`, `ecs`, …) under the same key without a migration (proposal 0054). A stage file without the block reads exactly as before.