Update plugin with version detection, backup, and rollback
/plugin marketplace add akaszubski/autonomous-dev/plugin install autonomous-dev@autonomous-devsonnetInteractive plugin update with version detection, backup, and rollback.
This command provides a safe, interactive way to update the autonomous-dev plugin (or other plugins) from the marketplace with:
# Interactive update (recommended)
/update-plugin
# Check for updates only (no update performed)
/update-plugin --check-only
# Non-interactive update (for automation)
/update-plugin --yes
# Update without backup (advanced users only)
/update-plugin --yes --no-backup
# JSON output for scripting
/update-plugin --json
--check-only: Check for updates without performing update (dry-run)--yes, -y: Skip confirmation prompts (non-interactive mode)--auto-backup: Create backup before update (default: enabled)--no-backup: Skip backup creation (advanced users only)--verbose, -v: Enable verbose logging--json: Output JSON for scripting (machine-readable)--project-root PATH: Path to project root (default: current directory)--plugin-name NAME: Name of plugin to update (default: autonomous-dev)--activate-hooks: Automatically activate hooks after update (default: enabled on first install, prompted on update)--no-activate-hooks: Skip hook activation (manual setup required)0: Success (update performed or already up-to-date)1: Error (update failed)2: No update needed (when --check-only and update available)Automatic hook activation makes plugin updates turnkey - just update and hooks are ready to use.
First Install (settings.json doesn't exist):
/update-plugin after fresh installUpdate (settings.json already exists):
/update-plugin on existing installationEnable hook activation (default):
/update-plugin # Interactive, prompts on update
/update-plugin --yes --activate-hooks # Non-interactive, activates hooks
/update-plugin --yes # Non-interactive, auto-activates (default behavior)
Disable hook activation:
/update-plugin --no-activate-hooks # Skip hook activation (manual setup required)
/update-plugin --yes --no-activate-hooks # Non-interactive, no hooks
When hooks are activated, /update-plugin configures in .claude/settings.json:
Example activation:
{
"hooks": {
"PrePush": ["auto_test.py", "security_scan.py"],
"SubagentStop": ["log_agent_completion.py", "auto_update_project_progress.py"]
}
}
Hooks not activating on first install:
ls -la .claude/settings.jsonls -la .claude/ should show readable/writable directory/setup to manually configure hooksHooks not activating on update:
--activate-hooks flag: /update-plugin --yes --activate-hooks/update-plugin (without --yes)cat .claude/settings.json to see current hooksActivation failed, but update succeeded:
/setup to configure hooks manually--yes --activate-hooks to retry activation.claude/settings.json directly (see docs/SETTINGS.md)/update-plugin
Output:
============================================================
Plugin Update Available
============================================================
Current version: 3.7.0
New version: 3.8.0
Status: Upgrade Available
============================================================
Do you want to proceed with the update? [y/N]: y
Creating backup...
Updating autonomous-dev...
Verifying update...
============================================================
Update Result
============================================================
Plugin updated successfully to 3.8.0
Version: 3.7.0 → 3.8.0
Backup: /tmp/autonomous-dev-backup-20251109-120000
============================================================
Hook Activation
============================================================
Activating hooks from updated plugin...
Hooks activated: auto_test.py, security_scan.py, auto_format.py
Settings saved to .claude/settings.json
============================================================
/update-plugin --check-only
Output:
============================================================
Version Check
============================================================
Project version: 3.7.0
Marketplace version: 3.8.0
Status: Upgrade Available
============================================================
Update available.
/update-plugin --yes
/update-plugin --json
Output:
{
"success": true,
"updated": true,
"message": "Plugin updated successfully to 3.8.0",
"old_version": "3.7.0",
"new_version": "3.8.0",
"backup_path": "/tmp/autonomous-dev-backup-20251109-120000",
"rollback_performed": false,
"hooks_activated": true,
"hooks_added": 3,
"details": {
"files_updated": 15,
"hooks": ["auto_test.py", "security_scan.py", "auto_format.py"],
"settings_path": "/path/to/project/.claude/settings.json"
}
}
All operations are security-validated:
If update fails at any point:
Rollback restores:
Invoke the Python CLI script:
python {{pluginDir}}/lib/update_plugin.py "$@"
/sync - Manual sync from marketplace to project/health-check - Check plugin integrity and version/setup - Manual hook configuration (alternative to auto-activation)lib/plugin_updater.py for implementation detailslib/update_plugin.py for CLI implementationlib/hook_activator.py for hook activation logic