diff --git a/src/main/java/de/ids_mannheim/korap/plkexport/ExpTempl.java b/src/main/java/de/ids_mannheim/korap/plkexport/ExpTempl.java
new file mode 100644
index 0000000..9566492
--- /dev/null
+++ b/src/main/java/de/ids_mannheim/korap/plkexport/ExpTempl.java
@@ -0,0 +1,56 @@
+package de.ids_mannheim.korap.plkexport;
+
+import org.tinylog.Logger;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
+
+public class ExpTempl {
+
+/*
+ * Returns export template as JSON 
+ */
+public static String getExportTempl(String scheme, String host, String port){
+    
+    String json = "";
+    try {
+
+    ObjectMapper mapper = new ObjectMapper();
+    ObjectNode templ = mapper.createObjectNode();
+
+    templ.put("name", "Export");
+    templ.put("desc", "Exports Kalamar results");
+   
+    ObjectNode embed = mapper.createObjectNode();
+    embed.put("panel", "result");
+    embed.put("title", "exports KWICs and snippets");
+    embed.put("icon", "\uf019");
+
+    ArrayNode classes = mapper.createArrayNode();
+    classes.add("button-icon");
+    classes.add("plugin");
+    embed.set("classes", classes);
+
+    ObjectNode onClick = mapper.createObjectNode();
+    onClick.put("action", "addWidget");
+    onClick.put("template",  scheme + "://" + host + ":" + port +"/export");
+   
+    ArrayNode perm = mapper.createArrayNode();
+    perm.add("forms");
+    perm.add("scripts");
+    perm.add("downloads");
+
+    onClick.set("permissions", perm);
+    embed.set("onClick", onClick);
+    templ.set("embed", embed);
+
+    json = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(templ);
+
+} catch (Exception ex) {
+    Logger.error(ex);
+    return null;
+}
+    return json;
+    }
+}
diff --git a/src/main/java/de/ids_mannheim/korap/plkexport/PluginServer.java b/src/main/java/de/ids_mannheim/korap/plkexport/PluginServer.java
index b12c2fa..323b4ab 100644
--- a/src/main/java/de/ids_mannheim/korap/plkexport/PluginServer.java
+++ b/src/main/java/de/ids_mannheim/korap/plkexport/PluginServer.java
@@ -1,5 +1,6 @@
 package de.ids_mannheim.korap.plkexport;
 
+
 import java.util.Properties;
 
 import org.eclipse.jetty.server.Handler;
@@ -14,6 +15,7 @@
 
 import org.tinylog.Logger;
 
+
 import jakarta.servlet.Servlet;
 
 /**
@@ -28,11 +30,27 @@
         contextHandler.setContextPath("/");
         
         String propfile = null;
-        if(args.length >= 1) {
-            propfile = args[0];
+    
+        boolean printhelp = false;
+        boolean argexc = false;
+
+        if(args.length >= 1 & args.length <= 2) {
+            for (int i = 0; i <= args.length-1; i++) {
+             if (args[i].equals("-h" ) |  args[i].equals("--help")){
+              printhelp = true;
+                }
+              else {
+                  propfile = args[i];
+                }
+            }
+        }
+        else if(args.length >= 3){
+        argexc = true;
         }
         Properties properties = ExWSConf.properties(propfile);
-        
+      
+        String usage = "\n Usage is java -jar KalamarExportPlugin-"+ ExWSConf.version() +".jar [-h|--help] [myconf_exportPlugin.conf]";
+      
         // Default: Server is available under http://localhost:7070/
         String portStr = properties.getProperty("server.port", "7070");
         String host = properties.getProperty("server.host", "localhost");
@@ -72,6 +90,22 @@
                 properties.getProperty("api.port") +
                 properties.getProperty("api.path","")
                 );
+
+   
+            if(printhelp){
+                System.out.println(usage);
+                String templString = ExpTempl.getExportTempl(properties.getProperty("server.scheme"), properties.getProperty("server.host"), properties.getProperty("server.port"));
+                System.out.println(" \n Export template to pass to the plugin registration handler: \n " 
+                + templString);
+            }
+            else {
+                System.out.println("\n You can use  -h or --help for more information about usage");   
+            }
+
+            if(argexc){
+                System.out.println("\n Too much arguments: " + usage);
+            }
+
             jettyServer.join();
         }
         finally {
@@ -79,4 +113,5 @@
             jettyServer.destroy();
         }
     }
+
 }
diff --git a/src/main/java/de/ids_mannheim/korap/plkexport/Service.java b/src/main/java/de/ids_mannheim/korap/plkexport/Service.java
index 093f802..6b9d02f 100644
--- a/src/main/java/de/ids_mannheim/korap/plkexport/Service.java
+++ b/src/main/java/de/ids_mannheim/korap/plkexport/Service.java
@@ -578,6 +578,18 @@
 
 
     /**
+     *
+     * Returns the export template as JSON.
+     */
+    @GET
+    @Path("export/template")
+    @Produces(MediaType.APPLICATION_JSON)
+    public String exportDisplayTemplate () {
+        Properties properties = ExWSConf.properties(null);
+        return ExpTempl.getExportTempl(properties.getProperty("server.scheme"),properties.getProperty("server.host"), properties.getProperty("server.port"));
+    };
+
+    /**
      * The export script.
      *
      * Returns a static JavaScript file.
diff --git a/src/test/java/de/ids_mannheim/korap/plkexport/ExpTemlTest.java b/src/test/java/de/ids_mannheim/korap/plkexport/ExpTemlTest.java
new file mode 100644
index 0000000..f0b6744
--- /dev/null
+++ b/src/test/java/de/ids_mannheim/korap/plkexport/ExpTemlTest.java
@@ -0,0 +1,57 @@
+package de.ids_mannheim.korap.plkexport;
+
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import jakarta.ws.rs.core.Response;
+import jakarta.ws.rs.core.Response.Status;
+import org.glassfish.jersey.test.JerseyTest;
+import org.glassfish.jersey.server.ResourceConfig;
+import java.util.Properties;
+import jakarta.ws.rs.core.Application;
+
+/**
+ * @author Helge
+ * 
+ * Tests if export template is correctly displayed
+ */
+public class ExpTemlTest extends JerseyTest {
+   
+    @Override
+    protected Application configure () {
+        return new ResourceConfig(Service.class);
+    }
+
+    /*
+     * Tests if export template is produced from service /export/template
+     */
+    @Test
+    public void testTemplService(){
+        Response response = target("/export/template").request()
+                .get();
+        assertEquals("Http Response should be 200:",
+                Status.OK.getStatusCode(), response.getStatus());
+        String json = response.readEntity(String.class);
+        assertTrue(json.contains("\"name\" : \"Export\""));
+        assertTrue(json.contains(" \"classes\" : [ \"button-icon\", \"plugin\" ]"));
+        Properties properties = ExWSConf.properties(null);
+        String templurl= properties.getProperty("server.scheme") + "://" +  properties.getProperty("server.host")
+        + ":" + properties.getProperty("server.port") + "/export";
+      assertTrue(json.contains(templurl));
+    }
+
+    /*
+     * Tests if exportTemplate is returned correctly
+     */
+    @Test 
+    public void testGetTempl(){
+        String scheme = "httpx";
+        String host = "xlocalhost";
+        String port = "1234";
+        String json = ExpTempl.getExportTempl("httpx", "xlocalhost", "1234");
+        assertTrue(json.contains("\"desc\" : \"Exports Kalamar results\""));
+        assertTrue(json.contains( "\"title\" : \"exports KWICs and snippets\""));
+        String templ = "\"template\" : \""+ scheme +"://"+host + ":" + port + "/export\"";
+        assertTrue(json.contains(templ));
+    }
+}
