Skip to Content
CLI Referencenkapp plan

nkapp plan

Preview all infrastructure and service changes that would be applied, without actually executing them. This is the dry-run equivalent for Nanokit.

Guarantees

  • Read-Only: The plan command is strictly non-mutating. It will never create, modify, or destroy real resources on any provider.
  • Environment Isolation: Changes are calculated strictly for the specified environment (-e). It will not detect or interfere with resources in other environments.
  • Deep Discovery: Nanokit queries the provider’s live API to identify orphans or drift from your nanokit.yml.
nkapp plan [options]

Options

FlagTypeDefaultDescription
-e, --env <env>stringEnvironment to plan for
--output <path>string.nanokit/plans/latest.jsonSave the plan to a specific JSON file

Plan Persistence

Every time you run nkapp plan, Nanokit automatically saves the generated plan to .nanokit/plans/latest.json. This file contains the complete structural diff and can be used for auditing or automated validation in CI/CD pipelines.

The plan object includes:

  • Timestamp: When the plan was generated.
  • Project Context: Project name and ID.
  • Infrastructure Delta: Detailed list of resources to create or delete.
  • Warnings: Potential issues detected during discovery.

Output Sections

Infrastructure

Shows instances to create or destroy based on the infra block:

Infrastructure: + Create instance of type t3.medium (role: manager) - Destroy resource abc123def456 (running)

Databases

Shows database branching operations for non-production environments:

Databases: ⇄ main_db: Create branch from production • staging_db: Standard provisioning

Services

Shows container-level changes with the reason for each action:

Services: + web: Create new service ~ api: Restart/Update (image changed) - old-worker: Remove service (removed from config) • docs: No changes needed (Status: running)

Action Types

SymbolActionDescription
+CREATENew service will be created
~RESTARTExisting service will be restarted (config changed)
-DELETEService will be removed
NO_OPNo changes needed

Examples

# Preview changes for local environment nkapp plan -e local # Preview production deployment nkapp plan -e production

[!TIP] Always run nkapp plan before nkapp up in production environments to review changes.