Foxx CLI Details

    Or with :

    Note: using yarn you can also run foxx-cli from your project’sdevDependencies:

    1. yarn add --dev foxx-cli
    2. yarn foxx help

    If you’re using a recent version of npm you can also use npx:

    1. npx -p foxx-cli foxx help

    After you’ve installed foxx-cli, you should be able to use the foxxprogram. You can learn more about the different commands foxx supports byusing the —help flag.

    You can also use the —help flag with commands to learn more about them, e.g.:

    1. foxx server --help # Help for the "server" command
    2. foxx server list --help # Subcommands are supported, too

    If you have no prior knowledge of Foxx, you can get started by installing ArangoDB locally and then creating a new Foxx service in the current directory using the init command:

    1. foxx init -i # answer the interactive questions

    If you want an example, you can also let init create an example service for you:

    1. foxx init -e # create an example service please

    You can also just use foxx init to create a minimal service without the example code.

    You can inspect the files created by the program and tweak them as necessary. Once you’re ready, install the service at a mount path using the install command:

    If you continue to work on your Foxx service and want to upgrade the installed version with your local changes use the upgrade command to do so.

    The manifest.json or manifest file contains a service’s meta-information. Formore information on the manifest format, see theofficial ArangoDB documentation.

    The directory containing a service’s manifest.json file is called the rootdirectory of the service.

    If you want to exclude files from the service bundle that will uploaded toArangoDB you can create a file called .foxxignore in the root directory ofyour service. Each line should specify one pattern you wish to ignore:

    • Patterns starting with ! will be treated as an explicit whitelist. Pathsmatching these patterns will not be ignored even if they would match any ofthe other patterns.

    Example: !index.js will override any pattern matching a file calledindex.js.

    • Patterns starting with / will only match paths relative to the service’sroot directory.

    Example: /package.json will not match node_modules/joi/package.json.

    • Patterns ending with / will match a directory and any files inside of it.

    Example: node_modules/ will exclude all node_modules directories andall of their contents.

    Example: .* will match any files and directories with a name startingwith a dot.

    • A double ** (globstar) will match zero or more levels of nesting.
    • Patterns starting with # are considered comments and will be ignored.

    For more details on the pattern matching behavior, see the documentation of the module (with the flagenabled).

    If no .foxxignore file is present in the service’s root directory thefollowing patterns will be ignored automatically: .git/, .svn/, .hg/,*.swp, .DS_Store.

    Should you need to include files that match these patterns for some reason, youcan override this list by creating an empty .foxxignore file.

    You can also create a .foxxignore file in the current directory using theignore command:

    1. foxx ignore # creates a file pre-populated with the defaults
    2. foxx ignore --force # creates an empty file

    To add individual patterns to the .foxxignore file just pass them asadditional arguments:

    1. foxx ignore .git/ .svn/ # you can pass multiple patterns at once
    2. foxx ignore '*.swp' # make sure to escape special characters

    If you define servers using the server commands, a .foxxrc file will becreated in your $HOME directory, which is typically one of the followingpaths:

    • /home/$USER on Linux

    • on macOS