Unlink Instance
The unlink command removes a local connection to a ZeyOS instance.
Bash
zeysdk unlink [INSTANCE_ID] [options]
Parameters
| Parameter | Description | Required | Example |
|---|---|---|---|
INSTANCE_ID | Instance to unlink | No | myinstance |
Options
| Option | Description |
|---|---|
--break-lock | Replace the current sync lock after you verify its operation is no longer running |
--verbose | Show detailed output |
Process
-
Validation
- Loads linked instances
- Uses the active instance automatically when
INSTANCE_IDis omitted - Verifies that the selected instance exists
-
Unlinking
- Removes the explicit non-active instance file, or removes
.zeysdk/sync.jsonwhen unlinking the active instance - Prompts for a replacement before unlinking the active instance when multiple other links exist
- Leaves no active instance when no linked instances remain
- Restores affected sync files if the local unlink operation fails
- Removes the explicit non-active instance file, or removes
Examples
Bash
zeysdk unlink myinstance
zeysdk unlink
Error Handling
| Error | Description | Resolution |
|---|---|---|
| Missing sync.json | No active instance configuration | Run zeysdk link |
| Invalid instance | Instance is not linked | Choose a linked instance |
| Delete failed | Sync files could not be removed | Check local permissions |
Notes
unlinkremoves local connection state for the selected instance- Remote applications and files are not deleted
- Globally saved host credentials are not deleted; use
zeysdk host removefor that - If the active instance is unlinked, another linked instance can become active
- When no linked instances remain, no active instance is set
Best Practices
- Use
zeysdk whoamibefore unlinking the active instance - Unlink old development instances that are no longer used
- Keep production instance names easy to recognize
unlinkrefuses to mutate instance state while another synchronization or instance-state operation owns the project lock