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
plancommand 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
| Flag | Type | Default | Description |
|---|---|---|---|
-e, --env <env> | string | — | Environment to plan for |
--output <path> | string | .nanokit/plans/latest.json | Save 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 provisioningServices
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
| Symbol | Action | Description |
|---|---|---|
+ | CREATE | New service will be created |
~ | RESTART | Existing service will be restarted (config changed) |
- | DELETE | Service will be removed |
• | NO_OP | No changes needed |
Examples
# Preview changes for local environment
nkapp plan -e local
# Preview production deployment
nkapp plan -e production[!TIP] Always run
nkapp planbeforenkapp upin production environments to review changes.