CLI Reference
Usage
jgo [GLOBAL_OPTIONS] COMMAND [COMMAND_OPTIONS] [ARGS]
If the first argument contains a colon (:), jgo treats it as an endpoint and implicitly runs jgo run:
# These are equivalent:
jgo org.python:jython-standalone
jgo run org.python:jython-standalone
Global Options
These options apply to all commands and must appear before the command name:
Output control
Option |
Description |
|---|---|
|
Verbose output. Repeat for more detail: |
|
Suppress all output. |
|
Control output formatting. |
|
Control line wrapping. |
|
Show what would be done without doing it. Dependencies may still be downloaded to report accurate information. |
Environment and cache
Option |
Description |
|---|---|
|
Use a specific |
|
Override cache directory. Env: |
|
Override Maven repository cache. Env: |
|
Skip cache entirely, always rebuild. Env: |
|
Update cached environment (checks remote repositories). Env: |
|
Work offline – don’t download anything. Env: |
Resolver and dependencies
Option |
Description |
|---|---|
|
Dependency resolver. |
|
Add a remote Maven repository. Can be repeated. |
|
How to link JARs from Maven cache to environment. Default: from config or |
|
Include optional dependencies. Env: |
|
Warn instead of failing on unresolved dependencies. Env: |
|
Include default coordinate components (jar packaging, compile scope) in output. |
Java
Option |
Description |
|---|---|
|
Force a specific Java version (e.g., |
|
Prefer a specific Java vendor (e.g., |
|
Use system Java instead of downloading on demand. |
|
Minimum/initial heap size (e.g., |
|
Maximum heap size (e.g., |
|
GC options. Shorthand: |
Advanced
Option |
Description |
|---|---|
|
Set property for Maven profile activation. |
|
Target platform for profile activation. Sets os-name, os-family, and os-arch. |
|
OS name for profile activation (e.g., |
|
OS family for profile activation (e.g., |
|
OS architecture for profile activation (e.g., |
|
OS version for profile activation. |
|
Force all JARs to module-path (treat as modular). |
|
Force all JARs to classpath (disable module detection). |
|
Ignore the |
Commands
jgo run
Run a Java application from Maven coordinates or jgo.toml.
jgo run [OPTIONS] [ENDPOINT] [-- JVM_ARGS] [-- APP_ARGS]
Option |
Description |
|---|---|
|
Main class to run. Supports auto-completion for simple names. |
|
Run a specific entrypoint from |
|
Append JARs, directories, or other paths to the classpath. Can be repeated. |
Argument separators: Use -- to separate JVM arguments and application arguments:
# No extra args
jgo run org.python:jython-standalone
# JVM args only
jgo run org.python:jython-standalone -- -Xmx4G
# JVM args and app args
jgo run org.python:jython-standalone -- -Xmx4G -- script.py --verbose
# App args only (empty JVM section)
jgo run org.python:jython-standalone -- -- script.py
If no endpoint is given and a jgo.toml exists in the current directory, jgo runs its default entrypoint.
jgo init
Create a new jgo.toml environment file.
jgo init [OPTIONS] [ENDPOINT]
Option |
Description |
|---|---|
|
Add coordinates from a requirements file (one per line, |
# Create empty jgo.toml
jgo init
# Initialize with a dependency
jgo init org.python:jython-standalone:2.7.3
# Initialize with multiple dependencies from a file
jgo init -r requirements.txt
jgo add
Add dependencies to jgo.toml.
jgo add [OPTIONS] [COORDINATES...]
Option |
Description |
|---|---|
|
Read coordinates from a requirements file. |
|
Don’t automatically sync after adding. |
jgo add org.slf4j:slf4j-simple:2.0.9
jgo add org.scijava:scijava-common org.scijava:scripting-jython
jgo remove
Remove dependencies from jgo.toml.
jgo remove [OPTIONS] COORDINATES...
Option |
Description |
|---|---|
|
Don’t automatically sync after removing. |
jgo remove org.slf4j:slf4j-simple
jgo sync
Resolve dependencies and build the environment in .jgo/.
jgo sync [OPTIONS]
Option |
Description |
|---|---|
|
Force rebuild even if cached. |
jgo update
Update dependencies to latest versions within constraints. Equivalent to jgo sync --update.
jgo update [OPTIONS]
Option |
Description |
|---|---|
|
Force rebuild even if cached. |
jgo lock
Update jgo.lock.toml without building the environment.
jgo lock [OPTIONS]
Option |
Description |
|---|---|
|
Check if lock file is up to date (exits non-zero if stale). |
jgo list
List resolved dependencies as a flat list.
jgo list [OPTIONS] [ENDPOINT]
Option |
Description |
|---|---|
|
Show only direct (non-transitive) dependencies. |
Without an endpoint, operates on the jgo.toml in the current directory.
jgo tree
Show the dependency tree.
jgo tree [OPTIONS] [ENDPOINT]
Without an endpoint, operates on the jgo.toml in the current directory.
jgo info
Show information about an environment or artifact. This is a command group with subcommands:
jgo info classpath [ENDPOINT] # Show classpath
jgo info modulepath [ENDPOINT] # Show module-path
jgo info jars [ENDPOINT] # Show all JAR paths (classpath + module-path)
jgo info deptree [ENDPOINT] # Show dependency tree
jgo info deplist [ENDPOINT] # Show flat dependency list
jgo info javainfo [ENDPOINT] # Show Java version requirements
jgo info entrypoints # Show entrypoints from jgo.toml
jgo info versions COORDINATE # List available versions of an artifact
jgo info mains [ENDPOINT] # Show classes with public main methods
jgo info manifest [ENDPOINT] # Show JAR manifest
jgo info pom [ENDPOINT] # Show POM content
jgo info envdir [ENDPOINT] # Show environment directory path
jgo search
Search for artifacts in Maven repositories.
jgo search [OPTIONS] QUERY...
Option |
Description |
|---|---|
|
Limit number of results (default: 20). |
|
Search a specific repository (default: |
|
Show detailed metadata for each result. |
Supports plain text, coordinates (g:a:v), and field syntax (g:groupId a:artifactId):
jgo search apache commons
jgo search g:org.python a:jython*
jgo search org.scijava:parsington
jgo config
Manage jgo configuration.
jgo config list # List all configuration values
jgo config get KEY # Get a configuration value
jgo config set KEY VALUE # Set a configuration value
jgo config unset KEY # Remove a configuration value
jgo config shortcut # List all shortcuts
jgo config shortcut NAME # Show what a shortcut expands to
jgo config shortcut NAME ENDPOINT # Add or update a shortcut
jgo config shortcut --remove NAME # Remove a shortcut
jgo version
Display jgo’s version.
jgo version
jgo --version # Also works as a global flag
Endpoint format
Endpoints are the coordinate strings that identify what to run or inspect:
groupId:artifactId[:version][:classifier][@mainClass]
Use + to combine multiple artifacts: g:a+g2:a2@MainClass.
Coordinate modifiers
Append parenthesized modifiers to control placement and resolution:
Modifier |
Meaning |
|---|---|
|
Force onto classpath |
|
Force onto module-path |
|
Disable dependency management (BOM import) for this coordinate |
Modifiers can be combined: g:a:v(m)!
# Force a JAR onto the module-path
jgo org.lwjgl:lwjgl:3.3.1(m)
# Disable managed resolution for one coordinate
jgo org.scijava:scijava-common!
Explicit positioning
When jgo’s heuristic parsing (which guesses whether a field is a version, classifier, or packaging) gets it wrong, use consecutive colons to set fields by position:
groupId:artifactId:version:classifier:packaging:scope
Empty positions default to None:
g:a:1.0: # version=1.0, classifier=None (explicit)
g:a::sources # version=None, classifier=sources (explicit)
Examples
Basic usage
# Run Jython REPL
jgo org.python:jython-standalone
# Run JRuby
echo "puts 'Hello Ruby'" | jgo org.jruby:jruby-complete@jruby.Main
# Run Groovy shell
jgo org.codehaus.groovy:groovy-groovysh+commons-cli:commons-cli:1.3.1@shell.Main
With the SciJava repository
Add the SciJava repository to your configuration:
[repositories]
scijava.public = https://maven.scijava.org/content/groups/public
Then run SciJava tools:
# SciJava REPL with different scripting languages
jgo org.scijava:scijava-common+org.scijava:scripting-jython@ScriptREPL
jgo org.scijava:scijava-common+org.scijava:scripting-groovy@ScriptREPL
Inspecting artifacts
# Preview the java command without running
jgo --dry-run run org.scijava:parsington
# Preview what jgo init would create
jgo --dry-run init org.python:jython-standalone
# Check available versions
jgo info versions org.python:jython-standalone
# Show main classes in a JAR
jgo info mains org.scijava:parsington
Working with Java versions
# Use a specific Java version
jgo --java-version 17 net.imagej:imagej
# Use system Java instead of downloading
jgo --system-java org.python:jython-standalone
# Check what Java version is needed
jgo info javainfo net.imagej:imagej