Huaweicloud cleanup

From huaweicloud/huaweicloud-devkit · View interactive version

Huaweicloud cleanup is an AI agent skill from the GitHub repository huaweicloud/huaweicloud-devkit. Clean up HuaweiCloud DevKit environment for fresh testing. Removes plugin files, skills, MCP server, KooCLI, and Codex plugin registration. Use when the user wants a clean test environment or to reset before reinstall.

How to use this skill

Skill file

HuaweiCloud DevKit Cleanup

STOP - Do not answer from general knowledge. Follow the procedure below.

Complete environment cleanup for fresh testing.

Step 1: Check Current State

Test-Path $env:USERPROFILE\.config\opencode\huaweicloud-plugins
Test-Path $env:USERPROFILE\.hcloud
hcloud version 2>$null

Step 2: Uninstall Plugin

npx --yes huaweicloud-devkit uninstall --target all

Step 3: Remove OpenCode Files

Remove-Item -Recurse -Force $env:USERPROFILE\.config\opencode\skills\huawei* -ErrorAction SilentlyContinue
Remove-Item -Recurse -Force $env:USERPROFILE\.config\opencode\huaweicloud-plugins -ErrorAction SilentlyContinue
Remove-Item -Force $env:USERPROFILE\.config\opencode\commands\huaweicloud* -ErrorAction SilentlyContinue

Step 4: Remove MCP Config

Remove mcp.huaweicloud-devkit entry from both:

$files = @("$env:USERPROFILE\.config\opencode\opencode.json", "$env:USERPROFILE\.config\opencode\opencode.jsonc")
foreach ($f in $files) {
  if (Test-Path $f) {
    $c = Get-Content $f -Raw | ConvertFrom-Json
    if ($c.mcp.PSObject.Properties.Name -contains 'huaweicloud-devkit') {
      $c.mcp.PSObject.Properties.Remove('huaweicloud-devkit')
      if ($c.mcp.PSObject.Properties.Count -eq 0) { $c.PSObject.Properties.Remove('mcp') }
      $c | ConvertTo-Json -Depth 5 | Set-Content $f -Encoding UTF8
    }
  }
}

Step 5: Uninstall KooCLI

npm uninstall -g @huaweicloud/hcloud
Remove-Item -Recurse -Force $env:USERPROFILE\.hcloud -ErrorAction SilentlyContinue
Remove-Item -Recurse -Force $env:USERPROFILE\.hcloud-agent -ErrorAction SilentlyContinue

Step 6: Remove Codex Plugin

codex plugin remove "huaweicloud-core@huaweicloud-devkit" 2>$null
codex plugin marketplace remove huaweicloud-devkit 2>$null
codex plugin marketplace remove HuaweiCloud-Devkit 2>$null

Step 7: Verify Clean

hcloud version          # Should error: not found
Test-Path $env:USERPROFILE\.config\opencode\huaweicloud-plugins  # Should be False

All checks should return errors or False. Then reinstall:

npx --yes huaweicloud-devkit install
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.