CLI Command Map

View .md

Every Kanject CLI command: what it does, an example where it helps, and the guide that teaches it. New to the CLI? Pick what you ship and follow its path; the rest of the page is for looking things up.

Run bare kanject inside a project for a short landing screen: each workflow set up there, and the next command for it. kanject --help prints every command. Cloud commands sit under a provider key, kanject aws; the rest work on the project itself.

Set up

kanject new [template]

Scaffold a service from a template, then run init on it. Omit the template on a terminal to choose one.

Example
kanject new webapi --name Acme.Analytics
Guide
Project Templates
kanject init

Review and enroll an existing project: writes the manifest, stage files and applicable wiring after interactive confirmation. Back changes the plan; cancel leaves the project untouched.

Example
kanject init --yes --service phonebook-app --stages dev,stage,prod
Flags
--http-kind api-gateway-rest
opt into managed HTTP on a compatible schema-v2 entry
--http-auth application|anonymous
declare authentication for managed HTTP
--http-verification-path <PATH>
required safe GET health path
Guide
Lambda HTTP access
kanject doctor

Pre-flight checks of the toolchain, and of a stage when you name one.

Example
kanject doctor --env dev
Flags
--env <stage>
add the stage checks
--features
add the edition and feature-lock checks for a distributable
--json
a CI-parseable report
Guide
Troubleshooting
kanject update

Update the CLI and its template pack, then verify the new install.

Example
kanject update --check-only
Flags
--check-only
report the installed and latest versions; install nothing
--templates-only
update only the template pack
--json
one JSON document on stdout; implies --non-interactive, not --yes
kanject install provider [key]

Install an optional provider plugin. Omit the key on a terminal to choose from the curated providers.

kanject completion <SHELL>

Generate Bash, Zsh, or PowerShell 7 completion from the loaded command tree; writes only the script to stdout.

Example
kanject completion zsh
Guide
Shell completion

Daily loop

kanject add packagefunctionstagelibenvparamsecretdistributable

Register a Lambda entry, a stage, a cross-repo dependency, a distributable, or a plain / Parameter Store / Secrets Manager value in the manifest and stage files. add package adds a Kanject library: see Sign-in and paid libraries.

Examples
kanject add stage qakanject add env --stage dev ASPNETCORE_ENVIRONMENT Development
Guides
Project TemplatesDependenciesLocal Development
kanject test

Run the service locally with the right runner for its project type.

Example
kanject test --watch
Flags
--watch
hot reload through dotnet watch (webapi projects)
--http
run an API template on Kestrel
--entry <ID>
select the manifest entry project
--event <PATH>
a JSON event payload to run the handler with (Tasks and Lambda ASP.NET Core projects)
--pull-env
use a stage's real config
--debug
CLI launch, then IDE attach
--setup-ide
generate native Debug/F5 configuration, then exit
--launch-profile <NAME>
select a compatible local profile
--startup-timeout <SECONDS>
bound HTTP startup waiting
Guide
Local Development
kanject env

Show a stage's env bindings as written in its stage file, with secret: references masked. Makes no AWS call.

Example
kanject env --stage dev
Flags
--show-values
unmask the secret: references; never fetches values
Guide
Local Development
kanject sync

Resolve cross-repo dependencies into the lockfile and generated MSBuild imports.

Example
kanject sync --locked
Flags
--locked
verify in CI
--offline
replay the lock
Guide
Dependencies
kanject configure distribution

Set up how a desktop app is distributed. With no subcommand, interactively add a destination.

Example
kanject configure distribution list --env prod
Subcommands
list
show the destination mappings (alias ls)
remove
delete one (alias rm)
scaffold
copy in a release kit for native installers (alias release-kit)
packaging
write a typed Linux packaging block for a distributable
Guide
Distribute
kanject migrate

Adopt legacy cross-repo <ProjectReference>s into the manifest, or move the manifest to a newer schema.

Example
kanject migrate --dry-run
Flags
--dry-run
run this first
--schema-v2
upgrade a v1 manifest in place
--schema-v3
move to the provider-neutral manifest and stage layout; every file is read back before anything is written, and the old layout keeps working through 1.x

Deploy on AWS

kanject aws deploy

Build and ship a stage: Lambda, ECS Fargate, or a static site, per entry.

Example
kanject aws deploy --env dev
Flags
--dry-run
resolve env and write local deploy inputs; no build or AWS mutation; multi-region preview covers the primary region
--build-once
compile one bundle for an eligible multi-region deployment; --no-build is the compatibility alias
--restart-http
explicitly restart a managed HTTP operation after inspecting changed source/settings and recorded state
--bake-secrets false
skip applying resolved env to the function; baking is the default
--adopt-edge <STACK>
move a hand-written Function URL and CloudFront edge into kanject's stack; the distribution keeps its id and domain. Meant for one deploy
Guide
Deployment
kanject aws rollback

Point a stage back at a prior release from the deployment ledger, with no rebuild: the Lambda alias, the previous ECS task definition, or an earlier static-site release.

Example
kanject aws rollback --env prod --to previous-stable
Flags
--to <REF>
a deployment revision, a commit SHA, previous or previous-stable; left out on a terminal, you pick from a list
Guide
Deployment
kanject aws deployments listshowmarkgc

Read the S3 deployment ledger, mark releases stable or broken, and delete artifacts outside the rollback window.

Example
kanject aws deployments list --env prod
Guide
Deployment
kanject aws preview publishlsurlextendrm

Publish static-site previews, and list, extend, or remove previews. url resolves static-site previews.

Guide
Deployment
kanject aws configure http

Configure managed REST access, external ownership, or pending HTTP setup for an existing Lambda stage.

Flags
--env <STAGE>
the stage to configure
--entry <ID>
the HTTP entry; inferred only when there is one
--kind api-gateway-rest
the managed HTTP method
--auth application|anonymous
explicit authentication
--verification-path <PATH>
a safe GET health path, e.g. /health
--mode managed|external|pending
who owns the HTTP access
--dry-run
show the plan; change no files or cloud resources
Guide
Lambda HTTP access
kanject aws configure vpcdomain

Interactive wizards that validate and write a stage's network and custom-domain config.

kanject aws pipeline upinitbootstrappromotestatus

Provision a service's CodePipeline (up is the one-command path). promote and status serve library releases.

Subcommands
promote
select a fetched release tip in a terminal, then fast-forward only after rehearsal and commit checks pass
status
inspect a commit or use --select to choose a fetched release tip
Guides
CI/CD PipelinePublish .NET packages
Defaults for promote and status

Inside a repository with packaging/release.pipeline.json, both read the rehearsal project and region from it, so --rehearsal-project and --region are only overrides. --commit takes a full or abbreviated SHA; one that is ambiguous or unknown fails with KANCLI608.

kanject aws distribute

Build a desktop app's distributables and publish them to S3, CodeArtifact, or (with the github plugin) GitHub Releases.

Example
kanject aws distribute --env prod --candidate
Flags
--candidate
stage an -rc.N release candidate
Subcommands
init
create the stage's distribution buckets
promote
copy an approved candidate to the stable buckets, byte for byte
Guide
Distribute
kanject github distribute

Publish only the distribution cells mapped to GitHub Releases.

Release a library

For repositories whose product is one or more NuGet packages. kanject pkg is the short alias for every kanject packages command. Guides: Publish .NET packages, Release the Pricing SDK.

kanject packages initplanverify

Scaffold the repository policy, classify every packable project, and gate the release so no private package leaks into a public one. verify is the blocking CI gate.

Example
kanject packages verify
Flags
init --split
public and private packages
init --all-private
when nothing is public
kanject packages intent add

Record a change's release intent: whether it needs a minor or major release. Writes packaging/intent/<date>-<slug>.json to commit with the change; a bug fix needs none, because no declaration means patch.

Example
kanject packages intent add --part minor --note "Adds IAuthProvider"
Flags
--part patch|minor|major
the increment this change needs; asked on a terminal, required in CI
--note
an optional one-line note
--package
the package IDs the note is about
kanject packages release

The release front door, no flags needed. Resolves the declared part, plans and applies the wave on a release branch, pushes, follows the hosted rehearsal, promotes, and stops at approval.

Example
kanject packages release
Flags
--part
choose a release increment at or above declared intent; prompted when omitted in a terminal
--package <ID>
release one library and its in-repo dependencies
--no-promote
stop after the rehearsal and print the aws pipeline promote command
Subcommands
status
a commit's pipeline state; --select opens a release-tip picker, and --commit accepts a full or abbreviated SHA
wave
under the changelog versioning model, print wave or none: whether this checkout's version releases
tag
under the changelog versioning model, tag the commit that published this version and push the tag
prepare | stage
the two halves for a custom host (see Advanced and CI)
Guide
Publish .NET packages

Sign-in and paid libraries

Kanject's paid libraries restore from the Kanject feed, not nuget.org. Sign the machine in once; the CLI keeps the feed credential in your NuGet config.

kanject login

Sign this machine in to Kanject through the browser, like aws sso login. The device key stays in the OS credential store.

Example
kanject login
Flags
--no-browser
print the approval URL instead, e.g. over SSH
--non-interactive
never prompt; at the organisation's device limit, list the devices and fail with a coded diagnostic
Subcommands
status
who this machine is signed in as; refreshes the feed token when it is due (--refresh forces it, --json for scripts)
kanject add package <ID>

Add a Kanject package to a project. Public ones come from nuget.org; paid ones come from the Kanject feed with your licence, after the CLI signs the feed credential into NuGet.

Example
kanject add package Kanject.Core.NoSqlDatabase
Flags
--version <VERSION>
default: the newest stable version the feed lists for your organisation
--project <PATH>
the project file, or a directory holding one; default: the current directory
kanject access

Set NuGet up for paid Kanject libraries without adding one: the feed token as the kanject_feed credential in your user-level config, the feed's source and package source mapping in the repository's.

Example
kanject access --service
Flags
--service
write only the repository's part, with no sign-in and no credential: what a pipeline needs
kanject logout

Sign this machine out: removes its device key from the OS credential store and the feed credential from NuGet config.

Advanced and CI

The steps packages release and the hosted pipeline run for you, the building blocks for a custom CI host, and tools for less common setups. You can ship a service or a library without touching any of them.

kanject packages bump previewplanapply

Preview which packages a change reaches, prove the version wave, then apply the sealed plan with no build or network. You choose patch, minor, or major; the CLI works out what has to move with it.

Flags
--all <part>
cover the whole repository
plan --intent-file packaging/release.intent.json
on a hosted Build, stands in for --all with the part the release commit declares
kanject packages release prepare

Prepare the verified release bundle. Projects with public build-input contracts require an explicit stage.

Flags
--env <STAGE>
select the public build configuration
Guide
Public build inputs
kanject packages graphfeedsversions

Export the evaluated dependency graph, show what the feed environment variables resolve to, and list which current versions are already claimed on their feeds.

Flags
feeds --check
probe the feeds
kanject packages scope carry

Complete a --package release's approval set with the published bytes of everything outside the scope.

kanject packages publish

Push packed packages in dependency order, with release plans, preflight evidence, and a resumable journal.

kanject packages next-rc

Take the next -rc.N from the candidate feed.

kanject packages candidate materialize

Derive a candidate wave from verified stable packages.

kanject packages smoke restoretemplatefeed

Prove consumers restore against local packs or the actual candidate feed.

Flags
feed --build
build them too
Subcommands
fixture init
scaffold a composite consumer fixture
kanject packages ci

Print the day-to-day verify gate as a CodeBuild or GitHub Actions snippet. It publishes nothing; releases run through packages release or your own workflow.

kanject aws packages release pipeline validateup

Check and provision the hosted library release pipeline described in packaging/release.pipeline.json.

Flags
up --plan
preview the stack change, the release-surface diff, and the publisher pin
up --apply
apply it, after confirmation or from a reviewed --plan-file
Guide
Publish .NET packages
kanject aws change-feeds plan

Print the DynamoDB change-feed documents each Lambda entry carries, how the manifest's aws.changeFeeds claims bind them, and what a deploy would render or check. Read-only; never builds.

Flags
--env <STAGE>
the stage to plan (required)
--entry <ID>
report only this entry's feeds; binding still considers every Lambda entry
--offline
no AWS calls: the build outputs, the claims and the stage only
kanject aws web-adapter upgrade

Pin the newest Lambda Web Adapter layer this CLI has verified in manifest.lock.json, through kanject sync. No AWS call.

Flags
--version <N>
pin a specific layer version; only verified ones are accepted
kanject aws template migrate

Preview or apply migration from generated stage templates to a committed template.json base.

kanject msbuild statusenable

Inspect or set up the generated dependency wiring and git hooks.

Deprecated flags

Still accepted so existing scripts keep running, but drop them from new ones:

  • kanject new --paid / --free and kanject update --paid — every template is free since 1.0.53; they only print a warning.
  • kanject aws pipeline up --region — renamed --pipeline-region, because it sets where the pipeline stack lives, not where the service deploys.
  • kanject add lambda — the older name for kanject add function. It keeps working.
Was this page helpful?