CLI

Command-line Interface (CLI) #

The flapjack executable is a fully working application and comes with sensible defaults out of the box. However, there may be times when custom settings need to be specified for flapjack to adapt to different requirements before starting the processing engine. Be it the port used by the remote access server or the local database’s location, the flapjack CLI allows one to control how the application behaves and uses the resources provided by the system.

Useful Commands #

# Activate a new instance key
flapjack key activate JD1234567890qwertyuiopasdfghjklz

# Create a new user with all permissions
flapjack user new -p all Ellis

# Import a new engine configuration and assign it a custom name
flapjack engine config import -n MyEngineConfig ./path/to/engine_config.yml

# Import a new exchange configuration and assign it a custom name
flapjack exchange config import -n MyExchangeConfig ./path/to/exchange_config.yml

# Start the engine without waiting for a remote start command and print
# all available logs to the console in a human-friendly format
flapjack engine run -n -P -vvv -L-

# Start the engine with default options
flapjack # a shorthand for: flapjack engine run

Available Commands #

flapjack --help or flapjack <command> --help can be used to get more information about a command, its sub-commands and flags:

Usage: flapjack <command>

Flags:
  -h, --help                  Show context-sensitive help.
  -d, --db="/path/to/db"      Set the location of the local database files. It must be a directory.
  -t, --request-timeout=2m    Set the maximum duration of HTTP requests.

Commands:
  version               Print version information.

  instance-key (key)    Manage the active instance key.
  |- activate (use)     Activate a new instance key.
  |  |- <key>           The new instance key.
  |- status             Print the status of the active instance key.

  user                  Manage remote access users.
  |- new                Create a new user.
  |  |- <name>          The name of the new user.
  |- rm                 Remove an existing user.
  |  |- <name>          The name of the user to remove.
  |- ls                 List all existing users sorted by their creation timestamps.

  engine
  |- run                Start the processing engine.
  |- config             Manage engine configurations.
  |  |- export          Export an existing configuration.
  |  |  |- <file>       The path to a file to which the configuration data is written. The file extension determines the format of the configuration (json, yaml/yml, toml).
  |  |- rm              Remove an existing configuration.
  |  |  |- <name>       The name of the configuration to remove.
  |  |- ls              List all existing configurations sorted by their usage timestamps.
  |  |- import          Import a new configuration.
  |  |  |- <file>       The path to a file from which the configuration data is loaded. The file extension determines the format of the configuration (json, yaml/yml, toml).

  exchange
  |- config             Manage exchange configurations.
  |  |- export          Export an existing configuration.
  |  |  |- <file>       The path to a file to which the configuration data is written. The file extension determines the format of the configuration (json, yaml/yml, toml).
  |  |- rm              Remove an existing configuration.
  |  |  |- <name>       The name of the configuration to remove.
  |  |- ls              List all existing configurations sorted by their usage timestamps.
  |  |- import          Import a new configuration.
  |  |  |- <file>       The path to a file from which the configuration data is loaded. The file extension determines the format of the configuration (json, yaml/yml, toml).
  |- identity           Manage exchange identities.
  |  |- ls              List all existing exchange identities sorted by their creation timestamps.

Run "flapjack <command> --help" for more information on a command.

flapjack version #

Prints version information.

Usage: flapjack version

Print version information.

Flags:
  -h, --help                  Show context-sensitive help.
  -d, --db="/path/to/db"      Set the location of the local database files. It must be a directory.
  -t, --request-timeout=2m    Set the maximum duration of HTTP requests.

flapjack instance-key #

Manages the active instance key and its status.

Usage: flapjack instance-key (key) <command>

Manage the active instance key.

Flags:
  -h, --help                  Show context-sensitive help.
  -d, --db="/path/to/db"      Set the location of the local database files. It must be a directory.
  -t, --request-timeout=2m    Set the maximum duration of HTTP requests.

Commands:
  activate (use)    Activate a new instance key.
  |- <key>          The new instance key.

  status            Print the status of the active instance key.

flapjack instance-key activate #

Sets and activates a new instance key.

Usage: flapjack instance-key (key) activate (use) <key>

Activate a new instance key.

Arguments:
  <key>    The new instance key.

Flags:
  -h, --help                  Show context-sensitive help.
  -d, --db="/path/to/db"      Set the location of the local database files. It must be a directory.
  -t, --request-timeout=2m    Set the maximum duration of HTTP requests.

flapjack instance-key status #

Prints the status of the active instance key.

Usage: flapjack instance-key (key) status

Print the status of the active instance key.

Flags:
  -h, --help                  Show context-sensitive help.
  -d, --db="/path/to/db"      Set the location of the local database files. It must be a directory.
  -t, --request-timeout=2m    Set the maximum duration of HTTP requests.

flapjack user #

Manages remote access users.

Usage: flapjack user <command>

Manage remote access users.

Flags:
  -h, --help                  Show context-sensitive help.
  -d, --db="/path/to/db"      Set the location of the local database files. It must be a directory.
  -t, --request-timeout=2m    Set the maximum duration of HTTP requests.

Commands:
  new          Create a new user.
  |- <name>    The name of the new user.

  rm           Remove an existing user.
  |- <name>    The name of the user to remove.

  ls           List all existing users sorted by their creation timestamps.

flapjack user new #

Creates a new user. The following permissions can be used with the --permissions flag:

  • All the permissions specified in the API’s authorization section.
  • all-read - includes all permissions that have the -read suffix.
  • all-write - includes all permissions that have the -write suffix.
  • all - includes all permissions without any exceptions.
Usage: flapjack user new <name>

Create a new user.

Arguments:
  <name>    The name of the new user.

Flags:
  -h, --help                           Show context-sensitive help.
  -d, --db="/path/to/db"               Set the location of the local database files. It must be a directory.
  -t, --request-timeout=2m             Set the maximum duration of HTTP requests.

  -p, --permissions=PERMISSIONS,...    Set the permissions of the new user.

flapjack user rm #

Removes an existing user.

Usage: flapjack user rm <name>

Remove an existing user.

Arguments:
  <name>    The name of the user to remove.

Flags:
  -h, --help                  Show context-sensitive help.
  -d, --db="/path/to/db"      Set the location of the local database files. It must be a directory.
  -t, --request-timeout=2m    Set the maximum duration of HTTP requests.

flapjack user ls #

Lists all existing users.

Usage: flapjack user ls

List all existing users sorted by their creation timestamps.

Flags:
  -h, --help                  Show context-sensitive help.
  -d, --db="/path/to/db"      Set the location of the local database files. It must be a directory.
  -t, --request-timeout=2m    Set the maximum duration of HTTP requests.

  -p, --page=1                Specify which user page to display.
  -l, --limit=15              Set the limit of users per page.

flapjack engine run #

Starts the processing engine and its remote access server.

Usage: flapjack engine run

Start the processing engine.

Flags:
  -h, --help                                    Show context-sensitive help.
  -d, --db="/path/to/db"                        Set the location of the local database files. It must be a directory.
  -t, --request-timeout=2m                      Set the maximum duration of HTTP requests.

      --engine-config=engine-config-name        Specify the name of the engine configuration to use. If not specified, the last used/created configuration is used.
      --exchange-config=exchange-config-name    Specify the name of the exchange configuration to use. If not specified, the last used/created configuration is used.
  -n, --now                                     Start the engine without waiting for a remote start command.
  -P, --pretty                                  Enable clean, human-friendly, non-JSON logging.
      --no-browser                              Disable automatic opening of the web dashboard.
      --concurrent-symbols=15                   Specify the number of symbol processes to keep active during a cycle's execution.
  -v, --verbosity=INT                           Set the log verbosity level. 0 (default) - errors, 1 (-v) - everything in the base level plus warnings, 2 (-vv) - everything in the first level plus general information, 3 (-vvv) everything in the second level plus debug information.
  -L, --log="/path/to/logs"                     Set the location of the log files. It must be a directory. A dash (-) can be used to allow logging to the standard output (console).
  -p, --port=8985                               Specify the port that should be used by the remote access server.
  -m  --metrics                                 Enable the metrics endpoint. The server exposes metrics in Prometheus format. The metrics are disabled by default.
      --secure                                  Notify the engine that a reverse proxy with a secure connection (HTTPS) is being used.
      --db-max-cycles=100                       Specify how many completed cycles should be retained in the database.
      --db-max-unarchived-orders=2500           Specify how many unarchived orders per exchange identity should be retained in the database.
      --db-max-logs=2000                        Specify how many log events should be retained in the database.
      --db-max-cache-age=168h                   Specify how much time has to pass before old exchange cache entries are deleted.

flapjack engine config #

Manages engine configurations.

Usage: flapjack engine config <command>

Manage engine configurations.

Flags:
  -h, --help                  Show context-sensitive help.
  -d, --db="/path/to/db"      Set the location of the local database files. It must be a directory.
  -t, --request-timeout=2m    Set the maximum duration of HTTP requests.

Commands:
  export       Export an existing configuration.
  |- <file>    The path to a file to which the configuration data is written. The file extension determines the format of the configuration (json, yaml/yml, toml).

  rm           Remove an existing configuration.
  |- <name>    The name of the configuration to remove.

  ls           List all existing configurations sorted by their usage timestamps.

  import       Import a new configuration.
  |- <file>    The path to a file from which the configuration data is loaded. The file extension determines the format of the configuration (json, yaml/yml, toml).

flapjack engine config export #

Exports an existing engine configuration.

Usage: flapjack engine config export <file>

Export an existing configuration.

Arguments:
  <file>    The path to a file to which the configuration data is written. The file extension determines the format of the configuration (json, yaml/yml, toml).

Flags:
  -h, --help                  Show context-sensitive help.
  -d, --db="/path/to/db"      Set the location of the local database files. It must be a directory.
  -t, --request-timeout=2m    Set the maximum duration of HTTP requests.

  -n, --name=config-name      Specify the name of the configuration to export. If not specified, the target file's name is used.

flapjack engine config rm #

Removes an existing engine configuration.

Usage: flapjack engine config rm <name>

Remove an existing configuration.

Arguments:
  <name>    The name of the configuration to remove.

Flags:
  -h, --help                  Show context-sensitive help.
  -d, --db="/path/to/db"      Set the location of the local database files. It must be a directory.
  -t, --request-timeout=2m    Set the maximum duration of HTTP requests.

flapjack engine config ls #

Lists all existing engine configurations.

Usage: flapjack engine config ls

List all existing configurations sorted by their usage timestamps.

Flags:
  -h, --help                  Show context-sensitive help.
  -d, --db="/path/to/db"      Set the location of the local database files. It must be a directory.
  -t, --request-timeout=2m    Set the maximum duration of HTTP requests.

  -p, --page=1                Specify which configuration page to display.
  -l, --limit=15              Set the limit of configurations per page.

flapjack engine config import #

Imports a new engine configuration.

Usage: flapjack engine config import <file>

Import a new configuration.

Arguments:
  <file>    The path to a file from which the configuration data is loaded. The file extension determines the format of the configuration (json, yaml/yml, toml).

Flags:
  -h, --help                  Show context-sensitive help.
  -d, --db="/path/to/db"      Set the location of the local database files. It must be a directory.
  -t, --request-timeout=2m    Set the maximum duration of HTTP requests.

  -n, --name=config-name      Specify the name of the configuration to import. If not specified, the target file's name is used.

flapjack exchange config #

Manages exchange configurations.

Usage: flapjack exchange config <command>

Manage exchange configurations.

Flags:
  -h, --help                  Show context-sensitive help.
  -d, --db="/path/to/db"      Set the location of the local database files. It must be a directory.
  -t, --request-timeout=2m    Set the maximum duration of HTTP requests.

Commands:
  export       Export an existing configuration.
  |- <file>    The path to a file to which the configuration data is written. The file extension determines the format of the configuration (json, yaml/yml, toml).

  rm           Remove an existing configuration.
  |- <name>    The name of the configuration to remove.

  ls           List all existing configurations sorted by their usage timestamps.

  import       Import a new configuration.
  |- <file>    The path to a file from which the configuration data is loaded. The file extension determines the format of the configuration (json, yaml/yml, toml).

flapjack exchange config export #

Exports an existing exchange configuration.

Usage: flapjack exchange config export <file>

Export an existing configuration.

Arguments:
  <file>    The path to a file to which the configuration data is written. The file extension determines the format of the configuration (json, yaml/yml, toml).

Flags:
  -h, --help                  Show context-sensitive help.
  -d, --db="/path/to/db"      Set the location of the local database files. It must be a directory.
  -t, --request-timeout=2m    Set the maximum duration of HTTP requests.

  -n, --name=config-name      Specify the name of the configuration to export. If not specified, the target file's name is used.

flapjack exchange config rm #

Removes an existing exchange configuration.

Usage: flapjack exchange config rm <name>

Remove an existing configuration.

Arguments:
  <name>    The name of the configuration to remove.

Flags:
  -h, --help                  Show context-sensitive help.
  -d, --db="/path/to/db"      Set the location of the local database files. It must be a directory.
  -t, --request-timeout=2m    Set the maximum duration of HTTP requests.

flapjack exchange config ls #

Lists all existing exchange configurations.

Usage: flapjack exchange config ls

List all existing configurations sorted by their usage timestamps.

Flags:
  -h, --help                  Show context-sensitive help.
  -d, --db="/path/to/db"      Set the location of the local database files. It must be a directory.
  -t, --request-timeout=2m    Set the maximum duration of HTTP requests.

  -p, --page=1                Specify which configuration page to display.
  -l, --limit=15              Set the limit of configurations per page.

flapjack exchange identity #

Manages exchange identities.

Usage: flapjack exchange identity <command>

Manage exchange identities.

Flags:
  -h, --help                  Show context-sensitive help.
  -d, --db="/path/to/db"      Set the location of the local database files. It must be a directory.
  -t, --request-timeout=2m    Set the maximum duration of HTTP requests.

Commands:
  ls    List all existing exchange identities sorted by their creation timestamps.

flapjack exchange identity ls #

Lists all existing exchange identities.

Usage: flapjack exchange identity ls

List all existing exchange identities sorted by their creation timestamps.

Flags:
  -h, --help                  Show context-sensitive help.
  -d, --db="/path/to/db"      Set the location of the local database files. It must be a directory.
  -t, --request-timeout=2m    Set the maximum duration of HTTP requests.

  -p, --page=1                Specify which exchange identity page to display.
  -l, --limit=15              Set the limit of exchange identities per page.