{"id":29016515,"url":"https://github.com/memgraph/mgconsole","last_synced_at":"2026-03-14T07:33:11.735Z","repository":{"id":45032520,"uuid":"184210188","full_name":"memgraph/mgconsole","owner":"memgraph","description":"mgconsole is a command-line interface (CLI) used to interact with Memgraph from any terminal or operating system.","archived":false,"fork":false,"pushed_at":"2024-09-17T12:06:50.000Z","size":199,"stargazers_count":44,"open_issues_count":18,"forks_count":7,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-09-17T14:36:40.385Z","etag":null,"topics":["cli","memgraph"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/memgraph.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-30T07:07:19.000Z","updated_at":"2024-09-17T12:06:53.000Z","dependencies_parsed_at":"2024-01-12T22:15:59.173Z","dependency_job_id":"0775c0db-b74a-4fb8-acbe-374b07298173","html_url":"https://github.com/memgraph/mgconsole","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/memgraph/mgconsole","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memgraph%2Fmgconsole","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memgraph%2Fmgconsole/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memgraph%2Fmgconsole/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memgraph%2Fmgconsole/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/memgraph","download_url":"https://codeload.github.com/memgraph/mgconsole/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memgraph%2Fmgconsole/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261962053,"owners_count":23236859,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","memgraph"],"created_at":"2025-06-25T22:30:32.019Z","updated_at":"2026-03-14T07:33:11.729Z","avatar_url":"https://github.com/memgraph.png","language":"C++","readme":"[![Actions Status](https://github.com/memgraph/mgconsole/workflows/CI/badge.svg)](https://github.com/memgraph/mgconsole/actions)\n\n# mgconsole\n\nmgconsole is a command line interface for [Memgraph](https://memgraph.com)\ndatabase.\n\n\u003cimg width=\"630\" alt=\"mgconsole\" src=\"https://github.com/memgraph/mgconsole/assets/4950251/b7ce1a0d-097c-4a2f-81b5-4049a307668b\"\u003e\n\n\n## Running mgconsole  \n\nFor MacOs and Windows users, there is a prebuilt version of mgconsole available on [Memgraph download hub](https://memgraph.com/download), Linux users need to build native version. \n\nThere is also a docker version of the same container available on the [Docker Hub](https://hub.docker.com/repository/docker/memgraph/mgconsole/general). \n\nYou can start `mgconsole` locally by running the following command: \n\n```\ndocker run -it memgraph/mgconsole:latest\n```\n\n## Building and installing\n\nTo build and install mgconsole from source you will need:\n  - CMake version \u003e= 3.10\n  - OpenSSL version \u003e= 1.0.2\n  - C compiler supporting C11\n  - C++ compiler supporting C++20\n\nTo install compile dependencies on Debian / Ubuntu:\n\n```\napt-get install -y git cmake make gcc g++ libssl-dev ninja-build\n```\n\nOn RedHat / CentOS / Fedora:\n\n```\nyum install -y git cmake make gcc gcc-c++ openssl-devel libstdc++-static ninja-build\n```\n\nOn MacOS, first make sure you have [XCode](https://developer.apple.com/xcode/) and [Homebrew](https://brew.sh) installed. Then, in the terminal, paste:\n\n```\nbrew install git cmake make openssl ninja\n```\n\nOn Windows, you need to install the MSYS2. Just follow the [instructions](https://www.msys2.org), up to step 6.\nIn addition, OpenSSL must be installed. You can easily install it with an\n[installer](https://slproweb.com/products/Win32OpenSSL.html). The Win64\nversion is required, although the \"Light\" version is enough. Both EXE and MSI\nvariants should work.\nThen, you'll need to install the dependencies using the MSYS2 MINGW64 terminal,\nwhich should be available from your Start menu. Just run the following command\ninside the MSYS2 MINGW64 terminal:\n\n```\npacman -Syu --needed base-devel git mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake mingw-w64-x86_64-openssl\n```\n\nOnce everything is in place, configure the build by running CMake as follows:\n\n* on Linux:\n```\ncmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release .\n```\n\n* on MacOS:\n```\ncmake -B build -G Ninja -DOPENSSL_ROOT_DIR=\"$(brew --prefix openssl)\" -DCMAKE_BUILD_TYPE=Release .\n```\n\n* on Windows, from the MSYS2 MINGW64 terminal:\n```\ncmake -B build -G \"MinGW Makefiles\" -DCMAKE_BUILD_TYPE=Release .\n```\n\nAfter running CMake, you can build the project by running:\n```\ncmake --build build\n```\n\nThis will build the `mgconsole` binary. To install it, run:\n```\ncmake --install build\n```\n\nThis will install to system default installation directory. If you want to\nchange this location, use `-DCMAKE_INSTALL_PREFIX` option when running CMake.\n\nNOTE: If you have issues compiling `mgconsole` using your compiler, please try to use\n[Memgraph official toolchain](https://memgraph.notion.site/Toolchain-37c37c84382149a58d09b2ccfcb410d7).\nIn case you encounter any problem, please create\n[a new GitHub issue](https://github.com/memgraph/mgconsole/issues/new).\n\n## Example usage\n\n```\n$ mgconsole --host 127.0.0.1 --port 7687 --use-ssl=false\nmgconsole 0.1\nType :help for shell usage\nQuit the shell by typing Ctrl-D(eof) or :quit\nConnected to 'memgraph://127.0.0.1:7687'\nmemgraph\u003e :help\nIn interactive mode, user can enter cypher queries and supported commands.\n\nCypher queries can span through multiple lines and conclude with a\nsemi-colon (;). Each query is executed in the database and the results\nare printed out.\n\nThe following interactive commands are supported:\n\n        :help    Print out usage for interactive mode\n        :quit    Exit the shell\n\nmemgraph\u003e\nmemgraph\u003e MATCH (t:Turtle) RETURN t;\n+-------------------------------------------+\n| t                                         |\n+-------------------------------------------+\n| (:Turtle {color: \"blue\", name: \"Leo\"})    |\n| (:Turtle {color: \"purple\", name: \"Don\"})  |\n| (:Turtle {color: \"orange\", name: \"Mike\"}) |\n| (:Turtle {color: \"red\", name: \"Raph\"})    |\n+-------------------------------------------+\n4 rows in set (0.000 sec)\nmemgraph\u003e :quit\nBye\n```\n\n## Export \u0026 import into Memgraph\n\nAn interesting use-case for `mgconsole` is exporting and importing data.\nYou can close the loop by running the following example queries:\n\n```\n# Export to cypherl formatted data file\necho \"DUMP DATABASE;\" | mgconsole --output-format=cypherl \u003e data.cypherl\n\n# Import from cypherl file\ncat data.cypherl | mgconsole\n```\n\n## Batched and parallelized import (EXPERIMENTAL)\n\nSince Memgraph v2 expects vertices to come first (vertices has to exist to\ncreate an edge), and serial import can be slow, the goal with batching and\nparallelization is to improve the import speed when ingesting queries in the\ntext format.\n\nTo enable faster import, use `--import-mode=\"batched-parallel\"` flag when\nrunning `mgconsole` + put Memgraph into the `STORAGE MODE\nIN_MEMORY_ANALYTICAL;` (could be part of the `.cypherl` file) to be able to\nleverage parallelism in the best possible way.\n\n```\ncat data.cypherl | mgconsole --import-mode=batched-parallel\n# STORAGE MODE IN_MEMORY_ANALYTICAL; is optional\n```\n\nIMPORTANT NOTE: Inside the import file, vertices always have to come first\nbecause `mgconsole` will read the file serially and chunk by chunk.\n\nAdditional useful runtime flags are:\n  - `--batch-size=10000`\n  - `--workers-number=64`\n\n### Memgraph in the TRANSACTIONAL mode\n\nIn [TRANSACTIONAL\nmode](https://memgraph.com/docs/memgraph/reference-guide/storage-modes#transactional-storage-mode-default),\nbatching and parallelization might help, but since there are high chances for\nserialization errors, the execution times might be similar or even slower\ncompared to the serial mode.\n\n### Memgraph in ANALYTICAL mode\n\nIn [ANALYTICAL\nmode](https://memgraph.com/docs/memgraph/reference-guide/storage-modes#analytical-storage-mode),\nbatching and parallelization will mostly likely help massively because\nserialization errors don't exist, but since Memgraph will accept any query\n(e.g., on edge create failure, vertices could be created multiple times),\nspecial care is required:\n  - queries with pure create vertices have to be specified first\n  - please use only import statements using simple MATCH, CREATE, MERGE\n    statements.\n\nIf you encounter any issue, please create a new [mgconsole GitHub issue](https://github.com/memgraph/mgconsole/issues).\n","funding_links":[],"categories":["C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmemgraph%2Fmgconsole","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmemgraph%2Fmgconsole","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmemgraph%2Fmgconsole/lists"}