Qelos CLI - Hard Push Flag Documentation
Overview
The --hard flag (alias: -h) is an advanced feature for the qelos push command that allows you to synchronize your Qelos environment with your local repository. When used, it will remove resources from Qelos that don't exist locally, ensuring your remote environment matches exactly what's in your local files.
⚠️ Important Warning
This is a destructive operation. Resources removed from Qelos cannot be recovered unless you have a backup. Always double-check the list of resources that will be removed before confirming.
Syntax
qelos push <type> <path> --hard
# or using the short alias
qelos push <type> <path> -hSupported Resource Types
The --hard flag only works with the following resource types:
components- Vue componentsblueprints- Blueprint definitionsplugins- Plugin configurationsintegrations- Integration configurationsallor*- All supported types
Requirements
- Directory Only: The
--hardflag can only be used when pushing a directory, not a single file - Confirmation Required: You must explicitly confirm before any resources are removed
- Network Connection: Requires connection to your Qelos instance to fetch existing resources
Workflow
When you use the --hard flag, the following happens:
- Validation: The command checks if the flag is used with supported types and a directory
- Fetch: Pulls the list of existing resources from Qelos
- Compare: Compares local files with remote resources
- Warning: Shows a warning message and lists resources that will be removed
- Confirmation: Asks for your confirmation (default: No)
- Push: If confirmed, pushes all local resources first
- Cleanup: After successful push, removes the remote resources that don't exist locally
Examples
Basic Usage
# Remove remote components that don't exist locally
qelos push components ./components --hard
# Remove remote blueprints that don't exist locally
qelos push blueprints ./blueprints -h
# Remove all types of resources that don't exist locally
qelos push all ./my-project --hardTypical Workflow
# 1. Pull existing resources
qelos pull components ./components
# 2. Remove some local files
rm ./components/old-component.vue
rm ./components/unused-component.vue
# 3. Push with --hard to clean up remote
qelos push components ./components --hard
# This will show:
# ⚠️ WARNING: You are using the --hard flag
# The following resources will be removed:
# - components: old-component
# - components: unused-component
# Do you want to continue?Interactive Confirmation
The confirmation dialog supports:
- Arrow Keys: ↑/↓ to navigate between options
- Enter: Select the highlighted option
- Y/N: Quick select Yes/No
- Esc/Ctrl+C: Cancel the operation
Do you want to continue?
(•) No (default)
( ) Yes, remove themError Handling
- If the push fails, no resources are removed
- If a resource cannot be removed, an error is logged but the operation continues
- The command will exit if you cancel the confirmation
Best Practices
- Backup First: Before using
--hardon production, consider backing up your resources - Review Carefully: Always read the list of resources to be removed before confirming
- Use in CI/CD: The
--hardflag is useful for automated deployments to ensure clean environments - Test Locally: Test the operation on a development environment first
Use Cases
1. Cleaning Up Development Environment
# Remove experimental components from dev
qelos push components ./src/components --hard2. Synchronizing After Refactoring
# After moving/deleting multiple components
qelos push all ./src --hard3. Maintaining Clean Repository
# Ensure no orphaned resources exist
qelos push blueprints ./blueprints --hard4. Automated Deployments
# In CI/CD pipeline to ensure clean state
qelos push components ./dist/components --hard --yesTroubleshooting
"Operation cancelled by user"
The confirmation was declined or cancelled. No changes were made.
"No resources to remove"
All remote resources exist locally, so nothing needs to be removed.
"Failed to remove resource"
Check network connection and permissions. The resource might be in use by other parts of the system.
Technical Details
Order of Operations
- Local files are pushed first
- Only after successful push, remote cleanup occurs
- This ensures no conflicts during the push operation
Resource Identification
- Components: Identified by filename (without .vue extension)
- Blueprints: Identified by filename (without .blueprint.json extension)
- Plugins: Identified by the
keyfield in the JSON - Integrations: Identified by the
identifierfield in the JSON
Environment Variables
The command uses QELOS_HARD_PUSH_REMOVE internally to track resources to be removed after the push completes.
Related Commands
qelos pull- Download resources from Qelosqelos push- Upload resources to Qelos (without --hard)qelos generate rules- Generate IDE rules for Qelos resources
Migration from Previous Versions
If you were previously manually cleaning up resources:
- Use
qelos pullto get current state - Delete unwanted local files
- Use
qelos push --hardto clean up automatically
Feedback and Issues
If you encounter any issues with the --hard flag:
- Check the error messages for details
- Ensure you have proper network connectivity
- Verify file permissions
- Contact support with the error logs
