The shell is an interactive tool in which you can
- Experiment with Angle queries
- Explore the data in a Glean database
- Experiment with schema changes and derived predicates
- Create experimental databases and query them
Invoking the shell
glean shell --service HOST:PORT
to connect to a server, or
glean shell --db-root DIR
to use local databases from directory
See shell options for more command-line options.
- List the available databases with
- Select a database with
- See the contents of the database with
- Type queries in Angle to see the results.
The shell accepts all the common options. Additionally:
Perform the given
:COMMANDand then exit. If multiple commands or queries are given on the command line, they will be performed in left-to-right order.
Load the database
Set the default limit for queries; equivalent to the
Set the terminal width for pretty-printing results.
Enable automatic paging of results longer than a page.
Enabled verbosity at level
Note that you can abbreviate commands as long as the abbreviation is
unique. For example,
:edit can be abbreviated as
List available databases which match
List available databases, and restorable backups, which match
:index LANGUAGE DIR
Index some source code for
DIR, creating a new database. This command is only available with the
--db-rootoption. Currently the only supported languages are
Enable query debugging;
:debug irshows the intermediate representation of the query after optimisation;
:debug bytecodeshows the compiled bytecode.
:list, but show more details
:list-all, but show more details
Show schema for the given
TYPE, or the whole schema if no predicate or type is given.
With no arguments, shows the available schemas and the current setting. With an argument, selects the schema to use for queries and inspecting with the
current: selects the current schema.
stored: selects the schema stored in the current DB.
<schema-id>: selects the specified schema.
Edit a query in an external editor. Set the
EDITORenvironment variable to choose an editor.
Set limit on the number of query results. If there are more results than the limit, then you can type
:moreto fetch the next
Set the query time budget. If the time limit expires, the results so far are returned, and you can type
:moreto see more results.
Recursively expand nested facts in the response.
Enable/disable result paging.
Show only a count of query results, not the results themselves
Fetch more results from the previous query
Show query profiling information; see Query Debugging.
Reload the schema (when using
--schema). This command is useful when making changes to the schema, including derived predicates. Edit the schema source files,
:reloadand then test your changes.
Show statistics for the current database.
Leave the shell.