Features: - 30+ Custom Skills (cognitive, development, UI/UX, autonomous agents) - RalphLoop autonomous agent integration - Multi-AI consultation (Qwen) - Agent management system with sync capabilities - Custom hooks for session management - MCP servers integration - Plugin marketplace setup - Comprehensive installation script Components: - Skills: always-use-superpowers, ralph, brainstorming, ui-ux-pro-max, etc. - Agents: 100+ agents across engineering, marketing, product, etc. - Hooks: session-start-superpowers, qwen-consult, ralph-auto-trigger - Commands: /brainstorm, /write-plan, /execute-plan - MCP Servers: zai-mcp-server, web-search-prime, web-reader, zread - Binaries: ralphloop wrapper Installation: ./supercharge.sh
64 lines
1.6 KiB
TypeScript
64 lines
1.6 KiB
TypeScript
/**
|
|
* Docker Cleanup Command
|
|
* Clean up unused containers, images, and volumes
|
|
*/
|
|
|
|
import { exec } from 'child_process'
|
|
import { promisify } from 'util'
|
|
|
|
const execAsync = promisify(exec)
|
|
|
|
export interface CleanupOptions {
|
|
containers?: boolean
|
|
images?: boolean
|
|
volumes?: boolean
|
|
networks?: boolean
|
|
all?: boolean
|
|
}
|
|
|
|
export async function handle(args: CleanupOptions, context: any): Promise<string> {
|
|
const {
|
|
containers = true,
|
|
images = true,
|
|
volumes = false,
|
|
networks = false,
|
|
all = false
|
|
} = args
|
|
|
|
const results: string[] = []
|
|
|
|
try {
|
|
if (all || containers) {
|
|
results.push('Cleaning up stopped containers...')
|
|
const { stdout: containerOutput } = await execAsync('docker container prune -f')
|
|
results.push(containerOutput)
|
|
}
|
|
|
|
if (all || images) {
|
|
results.push('\nCleaning up dangling images...')
|
|
const { stdout: imageOutput } = await execAsync('docker image prune -a -f')
|
|
results.push(imageOutput)
|
|
}
|
|
|
|
if (all || volumes) {
|
|
results.push('\nCleaning up unused volumes...')
|
|
const { stdout: volumeOutput } = await execAsync('docker volume prune -f')
|
|
results.push(volumeOutput)
|
|
}
|
|
|
|
if (all || networks) {
|
|
results.push('\nCleaning up unused networks...')
|
|
const { stdout: networkOutput } = await execAsync('docker network prune -f')
|
|
results.push(networkOutput)
|
|
}
|
|
|
|
results.push('\n✓ Docker cleanup complete!')
|
|
|
|
return results.join('\n')
|
|
} catch (error: any) {
|
|
throw new Error(`Docker cleanup failed: ${error.message}`)
|
|
}
|
|
}
|
|
|
|
export default { handle }
|