terminusdb [command subcommand positional_arguments] flags
The terminusdb(1) command line tool allows users to interact with a database, allowing common operations such as querying (and updating), database creation, data ingestion and maintainence.
terminusdb accepts a command, sometimes followed by a subcommand. The accepted commands are given here, along with their arguments.
terminusdb help
Display help regarding terminusdb.
-m
,--markdown
=[value]: generate help as markdown
terminusdb test OPTIONS
Run internal TerminusDB tests.
-
-h
,--help
=[value]: print help fortest
command -
-t
,--test
=[value]: Run a specific test
terminusdb serve OPTIONS
Run the TerminusDB server.
-
-h
,--help
=[value]: print help forserve
command -
-i
,--interactive
=[value]: run server in interactive mode
terminusdb list OPTIONS
List databases.
-h
,--help
=[value]: print help for thelist
command
terminusdb optimize OPTIONS
Optimize a database (including _system and _meta).
-h
,--help
=[value]: print help for theoptimize
command
terminusdb query DB_SPEC QUERY OPTIONS
Query a database.
-
-h
,--help
=[value]: print help for thequery
command -
-m
,--message
=[value]: message to associate with the commit -
-a
,--author
=[value]: author to place on the commit
terminusdb push DB_SPEC
Push a branch.
-
-h
,--help
=[value]: print help for thepush
command -
-b
,--branch
=[value]: set the origin branch for push -
-e
,--remote-branch
=[value]: set the branch on the remote for push -
-r
,--remote
=[value]: the name of the remote to use -
-x
,--prefixes
=[value]: send prefixes for database -
-u
,--user
=[value]: the user on the remote -
-p
,--password
=[value]: the password on the remote
terminusdb clone URI <DB_SPEC>
Clone a database (into DB_SPEC).
-
-h
,--help
=[value]: print help for theclone
command -
-u
,--user
=[value]: the user on the remote -
-p
,--password
=[value]: the password on the remote -
-o
,--organization
=[value]: organizational owner of the cloned database -
-l
,--label
=[value]: label to use for this database -
-c
,--comment
=[value]: long description of the cloned database -
-b
,--public
=[value]: whether the cloned database is to be public
terminusdb pull BRANCH_SPEC
Pull a branch from a database.
-
-h
,--help
=[value]: print help for thepull
command -
-e
,--remote-branch
=[value]: set the branch on the remote for push -
-r
,--remote
=[value]: the name of the remote to use -
-u
,--user
=[value]: the user on the remote -
-p
,--password
=[value]: the password on the remote
terminusdb fetch BRANCH_SPEC
fetch data from a remote.
-
-h
,--help
=[value]: print help for thefetch
command -
-r
,--remote
=[value]: the name of the remote to use -
-u
,--user
=[value]: the user on the remote -
-p
,--password
=[value]: the password on the remote
terminusdb rebase TO_DATABASE_SPEC FROM_DATABASE_SPEC OPTIONS
Rebase a database with commits from FROM_DATABASE_SPEC into TO_DATABASE_SPEC.
-
-h
,--help
=[value]: print help for therebase
command -
-a
,--author
=[value]: The author of the rebase
terminusdb rollup DATABASE_SPEC OPTIONS
Creates an optimisation layer for queries on the given commit.
-h
,--help
=[value]: print help for therollup
command
terminusdb bundle DATABASE_SPEC OPTIONS
Create a pack for a given DATABASE_SPEC that can then be reconsistuted with terminusdb unpack
.
-
-h
,--help
=[value]: print help for thebundle
command -
-o
,--output
=[value]: file name to use for pack output file (defaults to descriptor based name).
terminusdb unbundle FILE DATABASE_SPEC OPTIONS
Unpack .
-h
,--help
=[value]: print help for theunbundle
command
terminusdb branch create BRANCH_SPEC OPTIONS
Create a branch.
-
-h
,--help
=[value]: print help for thebranch create
sub command -
-o
,--origin
=[value]: the origin branch to use
terminusdb branch delete BRANCH_SPEC OPTIONS
Delete a branch.
-h
,--help
=[value]: print help for thebranch delete
sub command
terminusdb db create DATABASE_SPEC OPTIONS
Create a database.
-
-h
,--help
=[value]: print help for thedb create
sub command -
-o
,--organization
=[value]: organizational owner of the database -
-l
,--label
=[value]: label to use for this database -
-c
,--comment
=[value]: long description of this database -
-p
,--public
=[value]: whether this database is to be public -
-k
,--schema
=[value]: whether to use a schema -
-d
,--data-prefix
=[value]: uri prefix to use for data -
-s
,--schema-prefix
=[value]: uri prefix to use for schema -
-x
,--prefixes
=[value]: additional defined prefixes in JSON
terminusdb db delete DATABASE_SPEC OPTIONS
Delete a database.
-
-h
,--help
=[value]: print help for thedb delete
sub command -
-o
,--organization
=[value]: organizational owner of the database -
-f
,--force
=[value]: force the deletion of the database (unsafe)
terminusdb store init OPTIONS
Initialize a store for TerminusDB.
-
-h
,--help
=[value]: print help for thestore init
sub command -
-k
,--key
=[value]: key to use for admin login -
-f
,--force
=[value]: force the creation of a new store even when one already exists
terminusdb csv list DB_SPEC
List CSVs in the given DB.
-h
,--help
=[value]: print help for thecsv load
sub command
terminusdb csv delete DB_SPEC FILE OPTIONS
Delete a CSV file from the given database.
-
-h
,--help
=[value]: print help for thecsv load
sub command -
-m
,--message
=[value]: message to associate with the commit -
-a
,--author
=[value]: author to place on the commit
terminusdb csv load DB_SPEC FILES OPTIONS
Load a CSV file (appends new lines if already existing).
-
-h
,--help
=[value]: print help for thecsv load
sub command -
-m
,--message
=[value]: message to associate with the commit -
-a
,--author
=[value]: author to place on the commit
terminusdb csv update DB_SPEC FILES OPTIONS
Update a CSV file (equivalent to delete / load but with a minimal delta).
-
-h
,--help
=[value]: print help for thecsv update
sub command -
-m
,--message
=[value]: message to associate with the commit -
-a
,--author
=[value]: author to place on the commit
terminusdb csv dump DB_SPEC FILES OPTIONS
Dump a CSV file from the database.
-
-h
,--help
=[value]: print help for thecsv dump
sub command -
-o
,--output
=[value]: file name to use for csv output
terminusdb triples dump GRAPH_SPEC
Dump an RDF string.
-
-h
,--help
=[value]: print help for thetriples dump
sub command -
-f
,--format
=[value]: format of RDF (can be one of: [turtle])
terminusdb triples update GRAPH_SPEC FILE
Update from an RDF file (replaces current content).
-
-h
,--help
=[value]: print help for thetriples update
sub command -
-m
,--message
=[value]: message to associate with the commit -
-a
,--author
=[value]: author to place on the commit -
-f
,--format
=[value]: format of RDF (can be one of: [turtle])
terminusdb triples load GRAPH_SPEC FILE
Load triples from RDF file (Appending new).
-
-h
,--help
=[value]: print help for thetriples load
sub command -
-m
,--message
=[value]: message to associate with the commit -
-a
,--author
=[value]: author to place on the commit -
-f
,--format
=[value]: format of RDF (can be one of: [turtle])
terminusdb remote add DATABASE_SPEC REMOTE_NAME REMOTE_LOCATION OPTIONS
Add a remote.
-h
,--help
=[value]: print help for theremote add
sub command
terminusdb remote delete DATABASE_SPEC REMOTE_NAME OPTIONS
Remove a remote.
-h
,--help
=[value]: print help for theremote remove
sub command
terminusdb remote set-url DATABASE_SPEC REMOTE_NAME REMOTE_LOCATION OPTIONS
Set the URL of a remote.
-h
,--help
=[value]: print help for theremote set-url
sub command
terminusdb remote get-url DATABASE_SPEC REMOTE_NAME OPTIONS
Get the URL of a remote.
-
-h
,--help
=[value]: print help for theremote get-url
sub command -
-r
,--remote
=[value]: the name of the remote to use
terminusdb remote list DATABASE_SPEC OPTIONS
List remotes.
-h
,--help
=[value]: print help for theremote list
sub command
The designation of databases, repositories, the associated commit graph of a database, and various graphs as used in the above command requires the use of an appropriate descriptor path.
-
_system
: This is the system meta-data, which contains the user information, organization information and database records. -
<organization>/<database>
: This is the most basic descriptor path and actually refers to the more specific default path<organization>/<database>/local/branch/main
. -
<organization>/<database>/_meta
: This is the repository graph associated withdatabase
. It contains information about the local repository and all known remotes. -
<organization>/<database>/<repository>
: This is a longer form database designator which specifies which respository we would like to address. It refers implicitly to<organization>/<database>/<repository>/branch/main
. -
<organization>/<database>/<repository>/_commits
: The commit graph associated with a given database. This graph contains metadata about branch histories with their commit objects including the authorship and time. -
<organization>/<database>/<repository>/branch/<branch>
: The most specific branch descriptor, allows you to address a branch other than main. -
<organization>/<database>/<repository>/commit/<commit>
: The descriptor which allows an individual commit to be addressed directly.
-
TERMINUSDB_SERVER_NAME
: Set the servername to use forterminusdb serve
. Default is127.0.0.1
. -
TERMINUSDB_SERVER_PORT
: Set the port to use forterminusdb serve
. Default is6363
. -
TERMINUSDB_SERVER_WORKERS
: Set the number of worker threads to use forterminusdb serve
. Default is8
. -
TERMINUSDB_SERVER_MAX_TRANSACTION_RETRIES
: Set the transaction retry count. Default is3
. -
TERMINUSDB_SERVER_DB_PATH
: Set the location of the storage volume to be used byterminusdb
operations. Can be addressed relative to current path using./
. Default is./storage/db
. -
TERMINUSDB_SERVER_JWT_PUBLIC_KEY_PATH
: Set the public key path for JWT. Default is''
. -
TERMINUSDB_SERVER_JWT_PUBLIC_KEY_ID
: Set the public key identifier for JWT. Default is''
. -
TERMINUSDB_CONSOLE_BASE_URL
: Set the console javascript load URL. Default ishttps://dl.bintray.com/terminusdb/terminusdb/dev
. -
TERMINUSDB_HTTPS_ENABLED
: Iftrue
then use HTTPS for all API operations. Default istrue
. -
TERMINUSDB_SSL_CERT
: Path to SSL certificate if using HTTPS. -
TERMINUSDB_SSL_CERT_KEY
: Path to SSL certificate key if using HTTPS. -
TERMINUSDB_AUTOLOGIN_ENABLED
: Iftrue
then attempt to login automatically with default password. Default istrue
. -
TERMINUSDB_SERVER_PACK_DIR
: Location of the prolog pack directory if loading third party modules. -
TERMINUSDB_SERVER_TMP_PATH
: Path to use for temporary files. -
TERMINUSDB_IGNORE_REF_AND_REPO_SCHEMA
: Assume that ref and repo operations are inherently correct.
-
0: Successfully program execution. Associated with
api:success
. -
1: A generic failure of the API to carry out the operation. Associated with
api:failure
. -
2: The resource which was being requested was not found. Associated with
api:not_found
. -
13: The user attempted to carry out an operation without appropriately authorizing or without permission. Associated with
api:unauthorized
orapi:forbidden
. -
13: Unauthorized access attempted. Associated with
api:unauthorized
. -
126: An api command was attempted which is not possible. Associated with
api:method_not_allowed
. -
131: Internal server error. Associated with
api:server_error
.
-
terminusdb db create admin/foo
: Create a database in the organizationadmin
with the identifierfoo
. -
terminusdb db create admin/foo --label="Foo"
: Create a database in the organizationadmin
with the identifierfoo
and nameFoo
.
Copyright 2021 TerminusDB
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Gavin Mendel-Gleason gavin@terminusdb.com
Matthijs van Otterdijk matthijs@terminusdb.com
Robin de Rooij robin@terminusdb.com
Anne Ogborn anne@swi-prolog.org
Dmytri Kleiner dk@terminusdb.com