$ show alibaba/arthas
Arthas is a production-grade Java diagnostic and monitoring agent developed by Alibaba. It attaches to running JVMs without code changes or restarts, enabling real-time inspection of threads, memory, classes, method invocations, and system properties through an interactive shell (telnet/HTTP/WebSocket) or programmatic APIs. The architecture consists of a core agent (bytecode instrumentation via ASM/ByteKit), a command framework with over 40 built-in commands (watch, trace, stack, dashboard, profiler, etc.), multiple transport protocols (telnet, HTTP, gRPC, MCP for AI integration), and a tunnel server for remote connectivity. It also includes experimental modules for JFR analysis, cluster management, and gRPC-web proxies. Key external dependencies include Netty, OGNL, CFR decompiler, and async-profiler.
The LLM identified 3 files worth highlighting for reuse:
Provides in-memory Java compilation from source strings, supporting multiple source files, classpath, and custom class loaders. Returns compiled bytecodes as a map. Isolated and reusable for any project needing runtime Java compilation without writing to disk.
Abstract base class for commands using CLI annotations (@Name, @Summary, @Option, @Argument) from a custom annotation processor. Provides automatic help generation, completion, and parsing. The pattern is well-abstracted and can be reused to build CLI tools with a consistent annotation-based definition.
Annotation-based tool definition for the Model Context Protocol (MCP). Defines tool name, description, and parameters (@ToolParam) that are automatically converted to JSON schema. Combined with ToolCallback and ToolCallbackProvider, it enables declarative MCP tool registration, reusable for building any MCP-compatible server.