> For the complete documentation index, see [llms.txt](https://docs.zirkul.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zirkul.com/zirkul-agent/command-reference.md).

# Command reference

Zirkul agent can be used as an interactive standalone command line application if you run it with no arguments:

```bash
c:\zirkul.exe

            ===========================================================

               Zirkul Agent v2.1.11
               Zirkul S.A, 2024

            ===========================================================
            If you have any questions:
               Visit: https://docs.zirkul.com
               Email: support@zirkul.com

[ ! ] Loading service configuration
[ ! ] Loading Vulnerability translation database
Welcome to Zirkul Agent, send "?" for help on how to use this tool
zirkul#
```

Once the agent is loaded, you will see the terminal mode is changed to `zirkul#` which means, Zirkul is ready for receiving commands.

### Command line arguments

Command line arguments are also available, you can use -h or --help for getting the list of arguments available:

```bash
zirkul -h
usage: zirkul [-h] [-k APIKEY] [-u SERVER] [-f SCRIPT] [-H WEBHOOK] [-w {True,False}] [-a AGENT]
              [-p PLUGINS] [-S {True,False}]

Zirkul Agent 2.1.11 for CLI and CICD automation

optional arguments:
  -h, --help            show this help message and exit
  -k APIKEY, --apikey APIKEY
                        API Key for connecting to Zirkul server
  -u SERVER, --server SERVER
                        Zirkul Server URL (SaaS will be used if not provided)
  -f SCRIPT, --script SCRIPT
                        File path for the script you want to run
  -H WEBHOOK, --webhook WEBHOOK
                        Execute a remote job via webhook call
  -w , --wait 
                        Wait for webhook task to be completed
  -a AGENT, --agent AGENT
                        Use an unique agent name that should match with the agent in a job for CICD
  -p PLUGINS, --plugins PLUGINS
                        Overwrite the path where the plugins are located
  -S , --service 
                        Run this tool in service mode if you want to use the agent for running scans
                        locally

For more information visit: https://docs.zirkul.com
```

### Commands basics

Some important basic considerations:

* Commands and arguments need to be separated by spaces.\
  `zirkul# command argument`
* Text literals need to be enclosed between single or double quotes:\
  `zirkul# print "Hello world"`
* Multiline text is also supported as follows:\
  ``zirkul# print `multiline text``\
  `` another line` ``
* There are locations or configuration modes for configuring settings or plugins, when you're inside a configuration mode the terminal symbol will chance indicating the location you're currently in:\
  `zirkul# server` \
  `zirkul(server)#`
* For getting out of a configuration mode, use the command `exit` or ' `-` '\
  `zirkul(server)# exit`\
  `zirkul#`
* If you need help on the commands available in any mode, use the command `help` or simply ' `?` '
* Exit the application with `exit` or `quit`.

Scripts can be created with the list of commands you want the agent to execute, this is useful for automation purposes, let's create a simple script 'script.txt':

```bash
# This is a comment in my first script
var my_name = 'John'
print 'My name is: {{my_name}}'
```

Now we can run the script with the following command:

```bash
zirkul.exe --script script.txt


            ===========================================================

               Zirkul Agent v2.1.11
               Zirkul S.A, 2024

            ===========================================================
            If you have any questions:
               Visit: https://docs.zirkul.com
               Email: support@zirkul.com

[ ! ] Loading service configuration
[ ! ] Loading Vulnerability translation database
Welcome to Zirkul Agent, send "?" for help on how to use this tool
[ ! ] Running Script: script.txt
var my_name = 'John'
print 'My name is: {{my_name}}'
My name is: John
[ ! ] Script Completed

```
