Kanject.Cli 1.5.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.5.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.5.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=Kanject.Cli&version=1.5.0
                    
nuke :add-package Kanject.Cli --version 1.5.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

- The BaaS module report no longer counts Workflow's dependencies as modules of their own.
 The embedded Kanject feed manifest is re-vendored from the licence service (`5d6a53d`): `Kanject.Workflow` (`baas-workflow`) now grants the NotificationHub and ServerlessEventHub packages it depends on, so a service that ships Workflow reports `baas-workflow` alone in `aws deploy` and `doctor --env` instead of also naming `baas-notifications` or `baas-eventhub` for those dependencies. `kanject add package` classifies package ids exactly as before.

- A command that finds no AWS SSO session reports `KANCLI502` instead of a stack trace.
 When the AWS SDK's token cache held no token for the profile (after `aws sso logout`, or before a first `aws sso login`), the CLI printed a raw `AmazonClientException: No valid SSO Token could be found.` stack trace; a long `packages bump plan` hit it at the credential refresh before its candidate proof. The command now fails with `KANCLI502` (`AwsCredentialChainUnavailable`, the code `kanject doctor` warns with for the same state) and the fix: `aws sso login`, then rerun. A `packages bump plan` resumes from `~/.kanject/package-bump-cache`. A session that was signed in and expired mid-run is still `KANCLI566`.

- `packages bump plan` can build each candidate root's wave in passes: set `KANJECT_BUMP_PLAN_WAVE_PASS=1`.
 Opt-in. Unset, the candidate proof still builds one package at a time; two changes below reach every plan, set or unset. The two-root candidate proof packs one package at a time, and in a repository whose packages mostly share a project nothing can run in parallel, so the phase grows with the wave. On Core's hosted waves of 14 to 45 packages it took 16 to 23 seconds per selected package and was 85 to 92% of the plan. With the variable set, each proof root builds its wave once per package-edge level (proposal 0056):
 - One restore and one build of a generated `.sln` over the level's packages and their `ProjectReference` closure, then a `pack --no-build` per package. A package waits one level above any selected package it restores as a package; a repository with no in-repo package edges has one level.
 - The proof is unchanged: both roots, the source digests, the lock-set hash, contract parity (`KANCLI541`) and per-package checkpoint keys. The sealed plan is the same apart from its elapsed-time evidence.
 - A pass whose restore resolves an in-repo project or package it does not account for stops before it builds, and the proof starts again one package at a time in fresh roots. The progress line names the project. A pass gives way the same way, before it writes anything, to a project whose path a `.sln` cannot hold exactly: one with a double quote, a control character, `*`, `?`, a backslash inside a name, or `%` followed by two hexadecimal digits.
 - Every plan: the `verify` progress line now carries the lock-set hash and a digest over the wave's contract digests, so two runs can be compared from their logs.
 - Every plan: the temporary directory the plan runs under is resolved through every symbolic link, including a link inside another link's target. A temporary directory that is missing, a broken link, a link loop or a file now fails `KANCLI547`; it used to fail with an uncoded I/O error. Where it is an ordinary directory or sits behind one link, as on macOS, the plan runs where it did.
 - Leave it unset for release runs for now. The pass seals the same plan as the default on fixture repositories and on Core from a workstation (a 90-package wave's phase took 158 s against 561 s); it has not yet been compared on a hosted release.

- `kanject aws deploy --preview <NAME>` deploys the current code as an ephemeral preview (proposal 0045 PR 3a). The preview lifecycle (`preview ls`, `url`, `extend`, `rm`) managed tagged stacks that nothing in kanject could create. This is the creator, for single-entry zip Lambda services (Native AOT included).
 - The preview is its own CloudFormation stack, named by `preview.stackName`, on one target of the `preview.basedOn` stage: its account, region, artifact bucket, network and resolved env. It prints the preview's URL and expiry. `<NAME>` is required and never derived from git; in CI pass `pr-<number>`.
 - A preview owns nothing of the stage's. It writes no deployment ledger, publishes no Lambda version, moves no `live` alias, runs no canary, and applies no `api.domain`, managed HTTP companion stack or edge, and no change feeds (`KANCLI738`, info).
 - The template is checked before anything is built. One that fixes a physical name, attaches a policy or API resource to something outside itself, or nests a stack is refused (`KANCLI645`), with the resource and property named: build the name from `${AWS::StackName}` or drop it. The bundled templates name nothing, so they deploy as they are. Deletion and replace policies that keep a resource are set to delete, custom-domain resources are not deployed, and event sources outside the template are listed (`KANCLI646`).
 - Deploying a name again updates the same stack and keeps the later of its current expiry and now plus `preview.ttlDays`. The deploy waits for a stack operation in progress, refuses a stack that is not this service's preview (`KANCLI643`), and refuses one left in a failed state (`KANCLI644`).
 - `--env` may only name `preview.basedOn`; `--replace-target`, `--adopt-topics`, `--adopt-edge` and `--restart-http` are refused (`KANCLI641`). A base stage that sets `rollout.required` is refused (`KANCLI642`), and `doctor` warns about it. Other service shapes fail `KANCLI648` until support for them ships. A preview with no endpoint output deploys with a warning (`KANCLI647`).
 - `preview rm` now removes a stack preview's code under `<service>/preview-<NAME>/` in the artifact bucket and empties the buckets its stack will delete before it deletes the stack, so a removal that stops halfway can be run again. A bucket whose template keeps it is never emptied. Removal therefore needs `cloudformation:ListStackResources` and `GetTemplate`, and S3 list and delete permissions on that prefix and those buckets. A preview's log groups are part of its stack and go with it.
 - `preview url` and `deploy --preview` read an `HttpEndpoint` output before an `ApiURL`-style one.
 - A preview runs the checkout's code with the base stage's secrets, and the manifest, stage files and template all come from that checkout. Run it only in jobs you trust like the stage's own deploy job, never for pull requests from forks.

- A command that finds no AWS credentials at all reports `KANCLI502` instead of a stack trace.
 When no profile, environment variable or role supplied credentials, the CLI printed a raw `AmazonServiceException: Unable to get IAM security credentials from EC2 Instance Metadata Service.` stack trace, or `Unable to find credentials` with the metadata service disabled. A command that names no profile ends there, and so do a stage whose configured profile does not exist and a default SSO profile that is signed out. The command now fails with `KANCLI502` and the fix: `aws sso login` or `aws configure`, or export the `AWS_*` variables this environment expects, and check the stage's profile.

- A stage `profile` that does not exist now warns before the environment's credentials are used.
 When a stage's or target's configured profile is not on the machine, the CLI uses the environment's credentials instead; that is how a CI role deploys, and it is unchanged. It was also silent, so on a developer's machine a misspelt stage profile deployed to the environment's account without a word. The command now warns once per profile, naming it, with the way to list the profiles that do exist.
 - The warning goes to standard error, so `--json` output stays parseable.
 - `default`, and a command that names no profile, never warn.

- A `--profile` typed on a `kanject aws` command must exist.
 A name that did not exist on the machine, a misspelling for example, was silently replaced by the environment's credentials, so the command ran against whatever account those belonged to. The command now stops before it runs with `KANCLI502`, naming the profile; a profile that exists but names no credential source is refused the same way.
 - Covers `aws pipeline up`, `bootstrap`, `status` and `promote`, `aws packages release pipeline up` and `validate`, and `aws preview publish`, `url`, `rm`, `extend` and `ls`.
 - `default` is exempt, as with the AWS CLI: with no such profile it means the environment's credentials. To use those on purpose, leave `--profile` out.
 - A stage's configured `profile` still falls back to the environment's credentials when the profile does not exist, which is how a CI role deploys a stage whose profile exists only on developers' machines.

- A request that never reaches its service reports `KANCLI775` instead of a stack trace.
 With no network, a VPN or proxy that is down, or an `AWS_ENDPOINT_URL` pointing at an address nothing listens on, a command that called AWS printed a raw `HttpRequestException` stack trace. It now fails with `KANCLI775` (`NetworkEndpointUnreachable`); the message names the host and port, and the hint says what to check.
 - Covers a host name that does not resolve and a connection that is refused, times out or has no route.
 - A TLS failure, an HTTP error status and a request that times out in flight are not covered: the service was reached, or may have been.