Remove Asset
The remove command removes an existing asset from your ZeyOS application.
Bash
zeysdk remove <ASSET_PATH> [options]
Parameters
| Parameter | Description | Required | Example |
|---|---|---|---|
ASSET_PATH | Asset path including class directory and filename | Yes | services/my-service.ixml |
Options
| Option | Description |
|---|---|
--verbose | Show detailed output |
Process
-
Validation
- Verifies
zeyos.app.jsonexists - 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
- Verifies
-
Manifest Update
- Removes the asset entry from
zeyos.app.json - Preserves unrelated asset definitions
- Removes the asset entry from
-
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 pushorzeysdk 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
| Error | Description | Resolution | Example |
|---|---|---|---|
| Invalid asset class | Wrong type specified | Use correct class | Invalid asset class. Expected: services, resources, weblets, assets |
| Missing app.json | Config file not found | Initialize app | requires the zeyos.app.json file to exist |
| Asset not found | Asset doesn't exist | Check asset name | requires the asset key to exist in zeyos.app.json |
| Extension mismatch | Filename does not match the registered MIME type | Use the registered path | requires the file extension to match |
| Unsafe path | Path escapes its asset directory or contains a symbolic link | Use a path inside the app | requires the asset file path to stay inside |
| File delete error | Cannot remove file | Check permissions | There was a problem deleting the file |
Notes
removedeletes 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 compareto 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