Last updated 7 months ago

Environment variables




bblfshd endpoint, default ""


maximum blob size to return in MiB, default 5 MiB


enable retrieval of binary blobs, default false


do not stop queries on git errors, default disabled


directory to save indexes, default /var/lib/gitbase/index


enable jaeger tracing, default disabled


allow read queries only, disabling creating and deleting indexes, default disabled


size of the cache for the language UDF. The size is the maximum number of elements kept in the cache, 10000 by default


size of the cache for the uast and uast_mode UDFs. The size is the maximum number of elements kept in the cache, 10000 by default


size of the cache for git objects specified as MB


timeout in seconds used for client connections on write and reads. No timeout by default.


JSON file with user credentials


Max size of blobs to send to be parsed by bblfsh. Default: 5242880 (5MB)

Jaeger tracing variables

Extracted from




The service name


The hostname for communicating with agent via UDP


The port for communicating with agent via UDP


Whether the reporter should also log the spans


The reporter's maximum queue size


The reporter's flush interval (ms)


The sampler type


The sampler parameter (number)


The host name and port when using the remote controlled sampler


The maximum number of operations that the sampler will keep track of


How often the remotely controlled sampler will poll jaeger-agent for the appropriate sampling strategy


A comma separated list of name = value tracer level tags, which get added to all reported spans. The value can also refer to an environment variable using the format ${envVarName:default}, where the :default is optional, and identifies a value to be used if the environment variable cannot be found


Whether the tracer is disabled or not. If true, the default opentracing.NoopTracer is used.


Whether to store RPC metrics

Command line arguments

Please specify one command of: server or version
gitbase [OPTIONS] <server | version>
Help Options:
-h, --help Show this help message
Available commands:
server Starts a gitbase server instance
version Show the version information

server command contains the following options:

gitbase [OPTIONS] server [server-OPTIONS]
Starts a gitbase server instance
By default when gitbase encounters an error in a repository it
stops the query. With GITBASE_SKIP_GIT_ERRORS variable it won't
complain and just skip those rows or repositories.
Help Options:
-h, --help Show this help message
[server command options]
-d, --directories= Path where the git repositories are located (standard and siva), multiple directories can be
defined. Accepts globs.
--depth= load repositories looking at less than <depth> nested subdirectories. (default: 1000)
--host= Host where the server is going to listen (default: localhost)
-p, --port= Port where the server is going to listen (default: 3306)
-u, --user= User name used for connection (default: root)
-P, --password= Password used for connection
-U, --user-file= JSON file with credentials list [$GITBASE_USER_FILE]
-t, --timeout= Timeout in seconds used for connections [$GITBASE_CONNECTION_TIMEOUT]
-i, --index= Directory where the gitbase indexes information will be persisted. (default:
/var/lib/gitbase/index) [$GITBASE_INDEX_DIR]
--cache= Object cache size in megabytes (default: 512) [$GITBASE_CACHESIZE_MB]
--parallelism= Maximum number of parallel threads per table. By default, it's the number of CPU cores. 0
means default, 1 means disabled.
--no-squash Disables the table squashing.
--trace Enables jaeger tracing [$GITBASE_TRACE]
-r, --readonly Only allow read queries. This disables creating and deleting indexes as well. Cannot be used
with --user-file. [$GITBASE_READONLY]
--no-git disable the load of git standard repositories.
--no-siva disable the load of siva files.
-v Activates the verbose mode

User credentials

User credentials can be specified in the command line or using a user file. For single user this can be done with parameters --user and --password:

gitbase server --user root --password r00tp4ssword! -d /my/repositories/path

If you want to have more than one user or do not have the password in plain text you can use a user file with this format:

"name": "root",
"password": "*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19",
"permissions": ["read", "write"]
"name": "user",
"password": "plain_passw0rd!"

You can either specify a plain text password or hashed. Hashed version uses the same format as MySQL 5.x passwords. You can generate the native password with this command, remember to prefix the hash with *:

echo -n password | openssl sha1 -binary | openssl sha1 | tr '[:lower:]' '[:upper:]'

There are two permissions you can set to users, read and write. read only allows to execute queries. write is needed to create and delete indexes or lock tables. If no permissions are set for a user the default permission is read.

Then you can specify which user file to use with parameter --user-file:

gitbase server --user-file /path/to/user-file.json -d /my/repositories/path