Command line tool to interact with exist-db instances.
Built on top of @existdb/node-exist.
npm install -g xst
listlist the contents of a collection in eXist-db
treelist the contents of a collection in eXist-db as a tree
uploadupload a files and folders to a collection in eXist-db
installupload and install a package into eXist-db
executeexecute queries in an eXist-db
xst install mypackage.xar
Installs a local XAR package into any database you have access to (with all its declared dependencies).
xst connects to https://localhost:8443 as user admin.
NOTE: The instance you want to connect to must be running and XML-RPC has to be enabled.
Override any of the default connection parameters by setting environment
variables prefixed with
EXISTDB. In the following table you see a list of the
parameters with their default values and a description.
||the user used to connect to the database and to execute queries with|
||empty||the password to authenticate the user against the database|
||the URL of the database instance to connect to (only http and https protocols are allowed)|
EXISTDB_SERVER=http://127.0.0.1:8080 xst ls /db/apps
dotenv(-cli) is a small script that allows you to read environment variables from a file in the filesystem.
Install dotenv-cli globally
npm install -g dotenv-cli
create .env file in a folder with the settings that you need
EXISTDB_USER=admin EXISTDB_PASS=my super secret p455w0rd! EXISTDB_SERVER=http://localhost:8080
prepend command line script with
dotenv in the folder you created the .env file in
dotenv xst ls /db/apps
Note in order to pass options to
xst you will need to separate dotenv with
-- from the
dotenv -- xst ls --extended --color /db/apps
That also works when running the tests (on a remote server maybe or a different user)
dotenv npm test