Skip to main content

atmos packer source delete

Use this command to delete the vendored source directory for a Packer component. This removes the component directory that was created by atmos packer source pull.

Source-Based Version Pinning

Learn how to configure the source field for per-environment version control.

atmos packer source delete --help
 

Usage​

atmos packer source delete <component> --stack <stack> --force

Description​

The delete command removes the vendored component directory. For safety, this command requires the --force flag to confirm deletion.

This is useful for:

  • Cleaning up vendored components before re-vendoring
  • Removing components that are no longer needed
  • Resetting to a clean state for troubleshooting

Examples​

Delete Vendored Component​

Remove a vendored component directory:

atmos packer source delete ami-builder --stack dev --force

Output:

Deleting directory: components/packer/ami-builder
✓ Successfully deleted: components/packer/ami-builder

Without Force Flag​

Attempting to delete without --force shows an error:

atmos packer source delete ami-builder --stack dev

Output:

Error: --force flag is required

Explanation: Deletion requires --force flag for safety

Hint: Use --force to confirm deletion

Arguments​

component
Required. The name of the Atmos component to delete.

Flags​

--stack / -s
Required. The Atmos stack name. Can also be set via ATMOS_STACK environment variable.
--force / -f
Required. Confirm deletion. Without this flag, the command fails for safety.

Safety​

The delete command has several safety features:

  1. Requires --force - Prevents accidental deletion
  2. Only deletes source-managed components - Only works on components with source configured
  3. Non-destructive on missing directories - Shows a warning if the directory doesn't exist instead of failing
  4. Targets the directory the component runs from - The directory is metadata.component (the base component), not the instance name, and follows working_directory and provision.workdir.enabled exactly like source pull and just-in-time provisioning
  5. Only deletes directories Atmos provisioned - source pull and just-in-time provisioning record where they wrote in .atmos/source.json (workdir targets use .atmos/metadata.json). The command refuses to delete a directory without that record, and refuses a directory that is the local component directory of another component in the same stack that has no source. Directories vendored by an earlier Atmos version have no record: run source pull --force to re-provision them (which adds it), or delete them by hand

See Also​