jmx.sh lets you connect to any JMX-enabled JVM, browse MBeans, read and write attributes, and invoke operations — all from the comfort of your terminal.
Fork notice — jmxsh is an actively maintained fork of jiaqi/jmxterm, incorporating contributions from LeMyst/jmxterm. The goal is to keep the project alive with regular updates and releases, dependency maintenance, and new features.
Download the latest JAR from Releases and run:
java -jar jmxsh-<version>.jarbrew install nyg/jmxsh/jmxsh# Add the GPG key and repository
curl -fsSL https://jmx.sh/apt/gpg.asc | sudo gpg --dearmor -o /usr/share/keyrings/jmxsh.gpg
echo "deb [signed-by=/usr/share/keyrings/jmxsh.gpg] https://jmx.sh/apt stable main" | sudo tee /etc/apt/sources.list.d/jmxsh.list
# Install
sudo apt update && sudo apt install jmxsh- Interactive REPL with tab completion and command history (JLine)
- Remote & local connections — connect via host:port, JMX URL, or local PID
- JMXMP protocol support — connect via
jmxmp://host:portin addition to the default RMI protocol - Full MBean support — browse domains, read/write attributes, invoke operations
- Command chaining — run multiple commands in one line with
&& - Script mode — automate JMX operations via files or piped input
- Verbose control — silent, brief, or verbose output modes
- Cross-platform — runs anywhere Java runs (JAR, DEB, RPM)
- XDG Base Directory compliance — command history stored in
$XDG_STATE_HOME/jmxsh/(defaults to~/.local/state/jmxsh/), keeping your home directory clean
$ java -jar jmxsh-<version>.jar
Welcome to jmx.sh, type "help" for available commands.
$> open localhost:9999
#Connection to localhost:9999 is opened
$> domains
#following domains are available
JMImplementation
java.lang
com.example
$> bean com.example:type=AppStats
#bean is set to com.example:type=AppStats
$> get RequestCount
#mbean = com.example:type=AppStats:
RequestCount = 42;
$> run resetStats
#calling operation resetStats of mbean com.example:type=AppStats
#operation returns:
null
$> close
$> quit
| Command | Description |
|---|---|
open <host:port> |
Connect to a remote JMX endpoint (RMI) |
open jmxmp://<host:port> |
Connect to a remote JMX endpoint (JMXMP) |
open <pid> |
Attach to a local JVM by process ID |
domains |
List all MBean domains |
beans |
List all MBeans (optionally filter by domain with -d) |
bean <name> |
Select an MBean for subsequent operations |
info |
Show attributes and operations of the selected MBean |
get <attr> |
Read an MBean attribute |
set <attr> <value> |
Write an MBean attribute |
run <op> [args] |
Invoke an MBean operation |
close |
Disconnect from the JMX endpoint |
jvms |
List local Java processes |
help |
Show all available commands |
To connect using the JMXMP protocol instead of the default RMI:
$> open jmxmp://localhost:9999
#Connection to jmxmp://localhost:9999 is opened
Full service URLs are also supported: open service:jmx:jmxmp://localhost:9999
Run commands from a script file:
java -jar jmxsh-<version>.jar -l localhost:9999 --input commands.txtOr pipe commands via stdin:
echo "open localhost:9999 && beans" | java -jar jmxsh-<version>.jar -nApache License 2.0 — see LICENSE for details.