跳转到内容

CLI Reference

此内容尚不支持你的语言。

You probably don't need this

The IDE plugin handles everything automatically. Most users never touch the CLI. This page is for troubleshooting and advanced use cases.


The CLI is useful when:

ScenarioWhy CLI?
IDE can’t find your JVMRun galataj doctor to diagnose
Running without an IDEHeadless servers, CI pipelines
Docker / Remote JVMsManual attach to containerized apps
Debugging issuesCheck status, view logs
AutomationScripted profiling workflows

These are the commands you’ll actually use:

Diagnose system issues. Run this first when something doesn’t work.

Terminal window
galataj doctor
✓ Java: Found (11.0.19)
✓ Controller JAR: Found
✓ Agent JAR: Found
✓ Controller: Running
✓ Ports: Available (9876, 9877)

Check what’s running. Shows controller status and attached JVMs.

Terminal window
galataj status
Controller: Running (PID: 12345)
HTTP Port: 9877
TCP Port: 9876
Attached JVMs: 1
- abc123 (PID: 67890) - MyApp

List available JVMs. Shows all Java processes that can be profiled.

Terminal window
galataj jvms
Found 2 JVM(s):
1. com.example.MyApp
ID: abc123
PID: 12345
2. order-service
ID: def456
Environment: docker

Attach profiler to a JVM. Use when the IDE can’t attach automatically.

Terminal window
# By PID
galataj attach --pid 12345
# By JVM ID (from 'galataj jvms')
galataj attach --jvm-id abc123

Stop profiling a JVM.

Terminal window
galataj detach --jvm-id abc123

Check CLI version.

Terminal window
galataj version

Terminal window
galataj license status
Terminal window
galataj license login YOUR-LICENSE-KEY
Terminal window
galataj license purchase

Advanced Commands (rarely needed)

Most users never need these - the IDE handles controller lifecycle automatically.

Start controller manually:

Terminal window
galataj controller start
galataj controller start --port 8888 # Custom port

Stop controller:

Terminal window
galataj controller stop
VariableDescriptionDefault
GALATAJ_CONTROLLER_PORTHTTP API port9877
GALATAJ_CLI_PATHCLI path for IDEauto-detect
CodeMeaning
0Success
1General error
2Controller not running
3JVM not found
4Attach failed
5License error

Most commands support --json for scripting:

Terminal window
galataj jvms --json
galataj status --json
galataj license status --json

ProblemCommand
Something’s brokengalataj doctor
Is controller running?galataj status
Can’t find my JVMgalataj jvms
Need to attach manuallygalataj attach --pid <pid>