CLI & TUI Guide¶
GoGraph provides a feature-rich and out-of-the-box command-line tool (CLI) that you can use to quickly connect to a local graph database, execute Cypher statements, and view data results in an intuitive table format.
1. Installation¶
Method A: Using Homebrew (Recommended)¶
macOS / Linux:
Method B: Building from Source (For Developers)¶
Execute the following in the project root directory:
The compiled binary will be located atbin/gograph.
2. Basic Command Structure¶
The CLI starts in interactive terminal (TUI) mode by default.
- Running without arguments: Opens
default.dband enters interactive mode. - Specifying a database path:
gograph ./mygraph.db.
Command Mode (Non-Interactive)¶
If you want to invoke GoGraph in shell scripts, you can use the following subcommands:
2.1 Data Modification (exec)¶
2.2 Data Query (query)¶
3. Interactive Terminal Interface (TUI Mode)¶
The TUI is the best tool for daily debugging and query exploration, providing a REPL (Read-Eval-Print Loop) environment.
3.1 Core Features¶
- ASCII Art Banner: Displays version and copyright information on startup.
- Auto Routing: Directly typing Cypher statements will be automatically recognized and executed.
- Auto Completion: Press the
TABkey to complete keywords. - Table Rendering: Query results are presented in a beautiful ASCII table.
3.2 TUI Internal Commands¶
| Command | Description |
|---|---|
/help |
Print available command help |
/exit |
Safely exit the TUI |
/query <cypher> |
Force execution in query mode |
/exec <cypher> |
Force execution in mutation mode |