Zum Hauptinhalt springen
Markdown anzeigen

Remove Asset

The remove command removes an existing asset from your ZeyOS application.

Bash
zeysdk remove <ASSET_PATH> [options]

Parameters

ParameterDescriptionRequiredExample
ASSET_PATHAsset path including class directory and filenameYesservices/my-service.ixml

Options

OptionDescription
--verboseShow detailed output

Process

  1. Validation

    • Verifies zeyos.app.json exists
    • Validates the asset class from ASSET_PATH
    • Rejects traversal, absolute paths, symbolic-link path components, and invalid characters
    • Confirms the asset key exists and its extension matches the MIME type in the manifest
  2. Manifest Update

    • Removes the asset entry from zeyos.app.json
    • Preserves unrelated asset definitions
  3. File Removal

    • Deletes the local asset file
    • Removes empty parent directories below the asset-class directory
    • Treats an already-missing local file as a successful manifest cleanup
    • Reports progress when verbose output is enabled
    • Leaves remote deletion to zeysdk push or zeysdk sync

Generic assets may use nested paths. Services, resources, and weblets use a single filename below their class directory. The operation is serialized with other local manifest mutations, and a filesystem error restores the manifest entry.

Error Handling

ErrorDescriptionResolutionExample
Invalid asset classWrong type specifiedUse correct classInvalid asset class. Expected: services, resources, weblets, assets
Missing app.jsonConfig file not foundInitialize apprequires the zeyos.app.json file to exist
Asset not foundAsset doesn't existCheck asset namerequires the asset key to exist in zeyos.app.json
Extension mismatchFilename does not match the registered MIME typeUse the registered pathrequires the file extension to match
Unsafe pathPath escapes its asset directory or contains a symbolic linkUse a path inside the apprequires the asset file path to stay inside
File delete errorCannot remove fileCheck permissionsThere was a problem deleting the file

Notes

  • remove deletes the local file and its manifest entry
  • The command does not prompt for confirmation
  • The remote instance is not updated until you push or sync
  • Removing an asset can affect services, weblets, or references that depend on it
  • Use zeysdk compare to review removal before synchronizing

Best Practices

  • Search for references before removing shared resources
  • Create a snapshot before large cleanup work
  • Remove unused manifest entries and files together
  • Push removals during a planned maintenance window when users may be affected

Examples

Bash
# Remove a service
zeysdk remove services/backup.ixml --verbose
# Output:
# Loading assets info.
# Updating assets info.
# Deleting file: services/backup.ixml (...)
# File deleted successfully.
# Remove was completed successfully.

# Remove a weblet
zeysdk remove weblets/dashboard.ixml

# Remove a resource
zeysdk remove resources/logo.png

# Remove a nested generic asset
zeysdk remove assets/images/icons/favicon.ico