Kanject.Cli 2.7.0

Prefix Reserved
dotnet tool install --global Kanject.Cli --version 2.7.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.7.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=Kanject.Cli&version=2.7.0
                    
nuke :add-package Kanject.Cli --version 2.7.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.7.0 0 11/29/2026
2.6.1 102 11/25/2026
2.6.0 124 11/24/2026
2.5.0 184 11/16/2026
2.4.0 110 11/16/2026
2.3.0 140 11/15/2026
2.2.0 153 11/14/2026
2.1.0 116 11/13/2026
2.0.2 115 11/13/2026
2.0.1 107 11/13/2026
2.0.0 114 11/12/2026
1.5.1 134 11/11/2026
1.5.0 134 11/10/2026
1.4.0 120 11/4/2026
1.3.0 133 11/2/2026
1.2.0 165 11/1/2026
1.1.0 125 11/1/2026
1.0.79 123 10/30/2026
1.0.78 115 10/30/2026
1.0.77 117 10/29/2026
Loading failed

- A scaffolded Lambda service declares project scripts: `kanject run build`, `test` and `dev`.
 Every Lambda template (`webapi`, `minimal-api`, `tasks`, `file-server`, `instant-messaging`) now ships `kanject-cli/scripts.json` in each service root, beside the manifest, so `kanject run` lists the project's everyday commands from the first minute and the file is there to add to.
 - `build` runs `dotnet build` on the scaffold's solution and `test` runs `dotnet test` on it (`test` is left out with `--include-tests false`). `dev` runs `kanject test --http` for an API and `kanject test` for `tasks` and the instant-messaging Connect project. Arguments after the name pass through as typed: `kanject run test --filter Name~Todo`, `kanject run dev --port 5080`.
 - `kanject new` writes the editor schema, `kanject-cli/scripts.schema.json`, beside each file, and the guidance it prints at the end names `kanject run`. That line also appears after `kanject init` and `kanject add function` in a repository that has a scripts file.
 - `kanject add function` removes every `kanject-cli/` folder a template emits, not only one at the entry's root, so a function added to an existing service brings no second scripts file to hide the service's own.
 - Run the scripts from the service root, like the service's other commands. `dev` starts `kanject` from `PATH`, so where the CLI is only a local tool it is refused with `KANCLI1003`. `source-generator` declares none. The template READMEs now use `kanject run`.
 - Also fixed: the `webapi` README's first heading had a stray character in front of it.

- Changelog fragments can say what they are.
 A fragment may open with a tag block, between two `---` lines, naming the `edition` a change starts at, its `kind` (`feature`, `fix` or `security`) and a one-line `headline` (proposal 0065, phase 1). `kanject distribution release` and `kanject packages release` check the block before anything is written and leave it out of `CHANGELOG.md`, so the dated section is byte for byte what it was without tags.
 - The block is read strictly and is not YAML. An unknown or repeated key, a blank value, an unclosed block or a block with no entry after it fails `KANCLI1013`, naming the file and line.
 - `edition` must be one of the editions the release unit's distributables build, in its exact spelling (`KANCLI1014`). A unit with no editions, and every package release, refuses the tag.
 - A fragment with no block releases as before. Pin this CLI before tagging fragments: an older one inlines the block into the changelog as text.

- `aws distribute` sets `Cache-Control` on what it uploads to S3.
 The release feed and `SHA256SUMS` are uploaded `no-cache`, because their keys are overwritten by every release. A file whose name carries the version of a versioned distributable is uploaded `public, max-age=31536000, immutable`; any other file is `no-cache` (proposal 0037 §4.2). `distribute promote` writes the stable `SHA256SUMS` and feed the same way, and copies installers with the header they were staged with.

- S3 release-feed entries can name a release's notes page and its minimum OS.
 A distributable may declare `releaseNotesUrlPattern`, an `https` URL holding `{version}`, and `minimumOsVersion`, such as `{ "osx": "13.0", "win": "10.0.19041" }` (proposal 0037 §6). Each S3 cell's `kanject-release.json` entry then carries `releaseNotesUrl`, filled with the release's version (a candidate's `-rc.N` dropped), and `minimumOsVersion`, its own operating system's entry. `distribute promote` copies both. `distribute` refuses a pattern that cannot make an https link (`KANCLI1027`) and an invalid map (`KANCLI1028`) before it builds. Entries without them are unchanged.

- A desktop distributable can declare its update channel.
 `distributables[].updates` is now part of the manifest: `{ "provider": "kanject" }`, with optional `linkHosts` and `notesFrom` (proposal 0037 §8). Before, any `updates` block failed as an unknown field. `distribute` checks it before anything is built: `KANCLI1018` for a provider other than `kanject`, `KANCLI1019` when the distributable has no `versioning` block, `KANCLI1020` for a `linkHosts` entry that is not a bare host name, and `KANCLI1021` for a `notesFrom` edition it does not build. Any other field in the block still fails as an unknown field. Declaring the block does nothing else yet.

- `kanject distribution release` can write a version's notes as data.
 A release unit that sets `versioning.notes` to a folder gets `<folder>/<version>.json` in its release commit: one entry per changelog fragment, with its headline, its Markdown body, its `kind` and, when tagged, its `edition` (proposal 0065, phase 1). A desktop app can build its update prompt from it.
 - An entry's headline is the fragment's `headline:` tag, or the bold lead of its first bullet. With neither, the release stops with `KANCLI1015` before anything is written.
 - `--dry-run` prints each entry as `kind · edition · headline`.
 - The release stops with `KANCLI784` when the version's document already exists, when `notes` is not a service-relative path, when it is set with `"changelog": false`, or when a unit's members disagree on it.
 - The document is committed only: `distribute` does not publish it yet.

- `kanject run` tells a script where it was typed, and its refusals point somewhere that exists.
 - A script now gets `KANJECT_SCRIPT_CALLER_CWD`, the folder `kanject run` was typed in (never the `--cwd` value). The script still runs in the folder that holds the metadata folder, so `kanject run lint ./Program.cs` from `services/orders/` can now find `./Program.cs`.
 - `KANCLI1000` and the "no scripts file" messages named `docs/reference/scripts-schema.md`, which exists only in the kanject-cli repository. They now point at `scripts.schema.json`, which `kanject init --refresh-schema` writes beside the file, and `kanject run` with no scripts file prints a minimal valid `scripts.json` to start from.
 - An unknown name that starts a group offers the whole group: `kanject run vm` suggests `vm:ubuntu` and `vm:windows` instead of nothing (`KANCLI1001`).
 - A name that is not declared here but is declared in the scripts file further up is refused with the command that runs it: `kanject run --cwd <folder> <name>`.

- A project scaffolded with a hyphen in its name builds, and its projects are PascalCase.
 `kanject new minimal-api --name Acme.my-svc` wrote the namespace-safe form of the name, `Acme.my_svc`, into every file but kept `Acme.my-svc` in file and folder names, so the solution and each project reference named paths that did not exist.
 - `kanject new` and `kanject add function` now give the templates the name's PascalCase form when the typed name is not a valid C# namespace, and say so: `Acme.MySvc.slnx`, `src/Acme.MySvc.Api/Acme.MySvc.Api.csproj`, `namespace Acme.MySvc.Api`; `bg-worker` gives `BgWorker.csproj`. The project folder (`./Acme.my-svc`), the service name (`acme-my-svc`) and an added function's folder and entry id (`bg-worker`) keep the name as typed. A name that is already a valid namespace is used unchanged.
 - The entry id `kanject new` derives from the Api project follows its name: `acme-mysvc-api`.
 - All six templates also name files and folders with the template engine's own safe form, so plain `dotnet new` with a hyphenated name builds too (`Acme.my_svc.slnx`).

- Distribution targets can record where they are served publicly.
 A `distribution.targets[]` entry may carry `publicBaseUrl` (the complete `https` base its bucket and prefix are served at, ending in `/`), `candidatePublicBaseUrl` (the same for its `-rc` bucket) and `corsOrigins` (the `https` origins a browser page may read it from), proposal 0037 §4. `distribute` checks them before it builds: `KANCLI1022` for a malformed base, `KANCLI1023` for a provider-owned host such as `*.cloudfront.net` as the `publicBaseUrl` of a distributable with `updates`, and `KANCLI1024` for a bad origin. For an `updates` distributable it warns, and goes on, when no target is public (`KANCLI1025`) or a target's offers would carry no usable link (`KANCLI1026`). Nothing is served from the fields yet.

- The template READMEs deploy with `kanject`.
 The `webapi`, `instant-messaging` and `tasks` READMEs still described deploying from Visual Studio or with `dotnet lambda deploy-serverless`, which do not read the stage configuration `kanject init` writes. They now give `kanject doctor --env dev`, `kanject aws deploy --env dev --dry-run` and `kanject aws deploy --env dev`.

- `kanject add function` in a service made by `kanject new` leaves the solution building.
 Every `kanject new` scaffold keeps `kanject-cli/` beside its main project, so a function added from there landed inside that project's folder, and the project compiled the function's sources as its own: after `kanject new minimal-api --name Acme.Orders` and `kanject add function tasks --name Worker`, `dotnet build Acme.Orders.slnx` failed with 68 errors from the Api project. The entry also went into a new solution beside the Api project instead of the scaffold's `Acme.Orders.slnx`.
 - Each project whose folder holds the new entry, up to the service root, now gets `<DefaultItemExcludes>$(DefaultItemExcludes);Worker/</DefaultItemExcludes>`, inserted before `</Project>` with the rest of the file untouched.
 - With no solution in the service root, the entry joins the nearest solution above it that already lists one of the service's entry projects; one is created only when there is none.
 - A project file that cannot be edited stops the command before anything is scaffolded (`KANCLI798`), and the hint gives the line to add by hand.

- Desktop cells of an `updates` distributable are published with their update identity.
 `kanject aws distribute` passes reserved properties on each such cell's `dotnet publish` (proposal 0037 §3): `KanjectUpdateDistributable`, `KanjectUpdateEdition`, `KanjectUpdateRid`, `KanjectUpdateFeedUrl` (the routed target's `publicBaseUrl` plus `kanject-updates.json`) and `KanjectUpdateLinkHosts`. They are derived from the routing that places the cell, so a build's identity and its feed cannot drift, and a `--candidate` cell compiles the stable feed URL so a promoted candidate checks the stable feed. The app's update client compiles them into assembly metadata; the names, keys and a reference MSBuild targets file are a published contract (`docs/reference/update-channel-contract.md`). `publishProperties` or build inputs that set a `KanjectUpdate*` property fail `KANCLI1030`; `--dry-run` prints each cell's identity.

- S3 targets with a `publicBaseUrl` get the public update feed, `kanject-updates.json`.
 It sits beside `kanject-release.json` and holds only what an update client or a download page may read (proposal 0037 §4.1): each release's version, edition, RID, publish time, minimum OS, notes link and assets, and the feed's `updatedAt`. It has no `latest`, no `location`, no signing evidence and no file counts, and leaves out a build marked withdrawn. Publish and `distribute promote` keep it through the same feed writer, after the feed and only ever forward, so two racing runs leave it at the newer feed. A candidate's `-rc` bucket gets one only when the target sets `candidatePublicBaseUrl`. Every feed write now carries a later `updatedAt` than the one it replaced. If the projection cannot be written after its feed, the run fails `KANCLI1029`, and the new `kanject aws distribute reproject --env <stage> [--distributable <id>]` re-derives it from the feed.

- `kanject aws distribute` publishes the version's release-notes document beside each S3 feed.
 For a stable publish of a release unit with `versioning.notes` (proposal 0065 P2), every run, `--dry-run` and `--offline` included, reads the committed `{notes}/{version}.json` and refuses one that is unreadable, not schema 1, or names another unit or version (`KANCLI1016`). A publishing run refuses a different copy already at `{prefix}release-notes/{version}.json` before uploading anything (`KANCLI1017`), then puts the document create-only and immutable, with `unit` replaced by the distributable's id, before the cell's feed entry. The entry names it as `notesKey` and carries `important` when it holds a `security` entry (proposal 0037 §6), and `kanject-updates.json` carries both. Release units are now resolved from the whole manifest before `--distributable` narrows the run, so a run scoped to a unit's second member finds the unit's document. A version cut before the unit set `notes` warns and publishes none; candidates publish none.