Kanject.Cli 2.9.0

Prefix Reserved
dotnet tool install --global Kanject.Cli --version 2.9.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 2.9.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=Kanject.Cli&version=2.9.0
                    
nuke :add-package Kanject.Cli --version 2.9.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 or later (the .NET 11 SDK installs its .NET 11 build). 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 — kanject new scaffolds a project from a bundled template and initializes it; kanject init adds the manifest, stage files and lock file to an existing project.
  • 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 previews and ephemeral backend previews (kanject aws deploy --preview <NAME>), DynamoDB change feeds, a managed streaming Function URL and CloudFront edge, VPC & custom-domain wiring, multi-function services, AWS-native pipeline scaffolding, NuGet package publishing, desktop distribution, and sign-in for paid Kanject packages (kanject login, kanject add package).

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 net10.0 is compatible.  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.  net11.0 is compatible. 
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.9.0 82 12/3/2026
2.8.1 80 12/3/2026
2.8.0 102 12/2/2026
2.7.0 135 11/29/2026
2.6.1 135 11/25/2026
2.6.0 160 11/24/2026
2.5.0 186 11/16/2026
2.4.0 114 11/16/2026
2.3.0 155 11/15/2026
2.2.0 163 11/14/2026
2.1.0 119 11/13/2026
2.0.2 117 11/13/2026
2.0.1 110 11/13/2026
2.0.0 117 11/12/2026
1.5.1 143 11/11/2026
1.5.0 141 11/10/2026
1.4.0 122 11/4/2026
1.3.0 136 11/2/2026
1.2.0 169 11/1/2026
1.1.0 129 11/1/2026
Loading failed

- `rollback --to`, `deployments show` and `deployments mark` take a deployment id.
 A deployment id (the `deploymentId` that `deployments show` prints) names exactly one ledger entry, where a version number can belong to several: a rollback records its target's number again, and a function's versions restart at 1 when CloudFormation replaces it. `kanject aws rollback --to 01JF3M…` rolls back to that entry, and `deployments show 01JF3M…` and `deployments mark 01JF3M…` read and re-mark it. A provider plugin receives the chosen entry's id in the new optional `RollbackRequest.TargetDeploymentId`, next to the revision it already received.

- Rollback and the deployment listings see a stage's newest deployments, however many it has had.
 The ledger read one page of keys from S3 and stopped. S3 lists keys in ascending order and a ledger key starts with the time it was written, so that page held the stage's oldest records: twice the number asked for, and nothing after them. Once a stage passed that many deployments, the newer ones were never listed.
 - `kanject aws rollback` and `kanject aws deployments list` read 20 keys for their default `--limit 10`, so a stage's 21st deployment and every one after it were missing from the picker and the list, and `rollback --to previous` chose among the first 20.
 - The rollback target lookups for Lambda, ECS and static sites stopped at 100 deployments, `deployments show`, `deployments mark` and the automatic rollback after a failed canary or blue/green deployment at 200, and `deployments gc` at 400. The pair history a coupled rollback reads stopped at 100 pairs. The rollout history had the same fault, though no command lists it yet.
 - Entries from older CLIs under `_ledger/versions/` were cut the same way, and their keys are version numbers that S3 lists as text (1, 10, 100, 101, …). They are now read in full, newest version first, and fill a listing only after the stage's newer entries. Before, an entry that `deployments gc` or `deployments mark` had just re-stamped counted as the newest and could push real deployments out of a short listing.
 - A long history does not slow the listing down. A stage with up to 1000 records is still one S3 request. Past that, the CLI asks S3 to start at the keys of the last 30 days and widens the window fourfold until it holds enough, instead of walking every page from the first.

 Read from the code and reproduced against LocalStack's S3, not against AWS.

- Rollback and retention no longer read a deployment's revision as its position in history.
 A ledger row's revision is not a counter. For a Lambda deploy it is the version number of the row's first function, and that numbering starts again at 1 when CloudFormation replaces the function (`kanject aws deploy --replace-function`). A rollback records its target's revision a second time, and ECS and static-site revisions are not numbers at all. Rows are now ordered by when they were deployed and found by their deployment id.
 - `kanject aws rollback --to previous` and `--to previous-stable` pick from the rows deployed before the one in production. After versions 44 and 45, a replaced function and versions 1 and 2, `previous` from 2 used to resolve to 45; it now resolves to 1. A candidate that never became production is no longer offered as `previous`, and the picker lists rows newest first.
 - A version number that several rows share resolves to the most recently deployed of them, in `rollback --to <version>`, `deployments show` and `deployments mark`. The rollback then acts on the row that was chosen, not on whichever row with that number S3 listed first.
 - `deployments list` and the rollback picker no longer move a row to the top when `deployments mark` or `deployments gc` re-stamps it. ECS and static-site rollbacks relied on that order, so `previous` could resolve to a row that had only been re-marked.
 - `kanject aws deployments gc` no longer keeps a row because some other function is live at, or retained at, the same version number, so rows it should prune are pruned. That includes a row from before the ledger recorded functions: only the function named after the service, at that number, protects it. It marks each swept row `pruned` by its deployment id; it could mark a retained row that shared the number.
 - An automatic rollback after a failed canary or ECS blue/green deployment records the row that was in production before the deploy, and marks the candidate's own row `broken`.

- A multi-entry deploy that would replace a deployed function now stops (`KANCLI1083`).
 CloudFormation deletes a function whose logical ID changes and creates another. The old function's versions and `live` alias go with it, and a trigger wired outside the stack is left naming a function that no longer exists. Renaming an entry does this. So does growing a service from one entry to two, growing an entry from one function to two, and folding entries together without pins. These deploys used to go through with no warning. They now stop before anything is built, and are checked again on the merged template before the change set.
 - The message lists the functions that would go and the ones that would be made. When only one pairing is possible, the hint writes out the `functions` pin that keeps the old function. Otherwise it lists the old IDs and the functions that can be pinned.
 - `--replace-function` accepts the replacement, as it does a package-type switch (`KANCLI782`). Passed where nothing is replaced, it warns once.
 - A deploy that only adds functions, or only removes them, needs no flag.
 - `kanject aws rollback` to a deployment made before a replacement or a removal says the function was replaced or removed (`KANCLI207`). It used to say a version was pruned.

- A multi-entry merge rewrites every reference to a renamed function's SAM-generated resources.
 The merge decided whether a name such as `SupportRole` or `SupportEventsPermission` belonged to a renamed function by checking the IDs every entry declared. When another entry happened to declare a function by that name, the reference was left unrewritten and named a resource the merged template no longer had. An entry's references are now matched against its own resources and the resources the entries share, not against other entries' functions.

- `kanject aws change-feeds plan` reads the template a deploy would use.
 It preferred `template.<stage>.json` whenever one existed, so after a change to an entry's functions it planned against the stage template the last deploy generated. It now reads `template.json` unless the stage template is kept as written, as the deploy does.

- An entry in a multi-entry Lambda service can declare several functions (proposal 0070).
 The merge took one `AWS::Serverless::Function` per entry and stopped on a second (`KANCLI108`), so a service gave each trigger a project, a host and a Native AOT build of its own. Each function of an entry is still its own Lambda function, with its own trigger, policy, `live` alias and ledger row, and the entry is built and uploaded once. `KANCLI108` is retired.
 - A single-function entry still merges as `{EntryId}Function`, so no deployed stack changes on upgrade. Each function of an entry with several merges as `{EntryId}{OriginalId}`.
 - `entryProjects[].functions.<name>.aws.logicalId` pins a function's logical ID, the same in manifest schema 2 and 3. Pinning each function to the ID it had as its own entry folds entries together as an in-place update: no function, event-source mapping or subscription is replaced. A pin that can't apply fails `KANCLI1084`, and one that names a function the template doesn't declare fails `KANCLI1081`. A repo with a checked-in `manifest.schema.json` runs `kanject init --refresh-schema`.
 - Two functions that would share a logical ID or a SAM-generated child ID fail `KANCLI1080`. So does a function ID that is also a parameter, a shared resource or an implicit API.
 - A managed `http` entry in a multi-entry service keeps one function (`KANCLI1082`).
 - Stage `env` or `entryEnv` that sets `ANNOTATIONS_HANDLER` on an entry with several functions is refused before the build, on both deploy paths (`KANCLI1085`): it would point every function of the entry at one handler.
 - A multi-entry deploy publishes a version of every function before it moves any `live` alias, and moves the first entry's primary last. When the alias moves fail partway, or the deploy is cancelled partway, on either deploy path, the deploy records a `partial` ledger row without changing the active deployment and fails `KANCLI1086`, which names the functions that moved and both ways out. It used to record nothing. When the row can't be written either (the same expired credentials often stop both), the deploy still fails `KANCLI1086` and says so.
 - The change-feed drift check judges only the function a feed's claim names, so a sibling function that reads the same table stream no longer draws `KANCLI739`. When the deploy can't tell which function that is, it checks every function of the entry and says why.
 - `kanject doctor` and `deploy --dry-run` run the same pin, collision and stage checks offline, including on an entry whose sibling's template is missing or doesn't parse.

- `kanject aws rollback` finishes a stage whose functions are on different versions.
 A Lambda rollback reports "no change" only when the `live` alias of every function the target entry records is already on that entry's version. It used to compare the first function alone.
 - After a rollback that failed partway (`KANCLI208`), the message said to run the same command again. That second run answered "no change", because the first function had already moved, and the other functions stayed where they were. It now moves them and records the rollback.
 - The `KANCLI208` message now gives the command to finish with, naming the target by its deployment id: `kanject aws rollback --env <stage> --to <deployment id>`. "The same command" was not safe advice for `--to previous` or `--to previous-stable`: they work from the first function's live version, which the unfinished rollback has moved, so a second run resolved to the deployment being left and moved the first function back. Until the rollback is finished, `--to previous`, `--to previous-stable` and the picker stop with `KANCLI208` and change nothing.
 - When a deploy stopped while moving aliases, or an alias was moved outside kanject, `rollback --to` with the active entry's deployment id or version moves every function back to what that entry records.
 - Providers answer through the new `ICloudPlatform.IsRollbackTargetLiveAsync`. It has a default implementation, so a provider plugin built against the earlier contract still loads and keeps comparing the single current revision, as ECS Fargate, static-site and coupled stages do.