{"id":13529166,"url":"https://github.com/cleishm/libneo4j-client","last_synced_at":"2025-05-07T07:19:27.305Z","repository":{"id":49843395,"uuid":"45140919","full_name":"cleishm/libneo4j-client","owner":"cleishm","description":"neo4j-client -- Neo4j Command Line Interface (CLI)","archived":false,"fork":false,"pushed_at":"2023-05-08T02:47:43.000Z","size":3307,"stargazers_count":156,"open_issues_count":20,"forks_count":36,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-05-07T07:19:10.293Z","etag":null,"topics":["bolt","cli","driver","graph","graph-database","neo4j"],"latest_commit_sha":null,"homepage":"https://neo4j-client.net","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cleishm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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}},"created_at":"2015-10-28T20:48:47.000Z","updated_at":"2025-03-26T00:57:53.000Z","dependencies_parsed_at":"2024-01-02T23:53:52.344Z","dependency_job_id":null,"html_url":"https://github.com/cleishm/libneo4j-client","commit_stats":{"total_commits":392,"total_committers":4,"mean_commits":98.0,"dds":"0.010204081632653073","last_synced_commit":"fd7a4acbf1136839060f74cdf1aa518f5b4c1eb5"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleishm%2Flibneo4j-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleishm%2Flibneo4j-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleishm%2Flibneo4j-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleishm%2Flibneo4j-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cleishm","download_url":"https://codeload.github.com/cleishm/libneo4j-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252831271,"owners_count":21810784,"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":["bolt","cli","driver","graph","graph-database","neo4j"],"created_at":"2024-08-01T07:00:33.936Z","updated_at":"2025-05-07T07:19:27.282Z","avatar_url":"https://github.com/cleishm.png","language":"C","funding_links":[],"categories":["Connectors","C","Bolt"],"sub_categories":["Bolt"],"readme":"neo4j-client\n============\n\n\nAbout\n-----\n\nneo4j-client is a command shell (CLI) for Neo4j. It supports secure connections\nto Neo4j server, sending of statements (including multiline statements),\npersistent command history, and rendering of results to tables or CSV.\n\nneo4j-client utilizes the [Bolt Network Protocol](https://boltprotocol.org), and\nwill work with any server that supports Bolt.\n\nFor more details, see [the project page](https://neo4j-client.net) and\nthe [FAQ](https://github.com/cleishm/libneo4j-client/wiki/FAQ).\n\n\nRequirements\n------------\n\nneo4j-client is known to work on GNU/Linux, Mac OS X and FreeBSD. It\nrequires neo4j 3.0.0 or later.\n\n\nGetting Started\n---------------\n\nIf you're using Mac OS X, neo4j-client can be installed using homebrew:\n\n```console\n$ brew install cleishm/neo4j/neo4j-client\n```\n\nIf you're using Ubuntu, neo4j-client can be install using APT:\n\n```console\n$ sudo add-apt-repository ppa:cleishm/neo4j\n$ sudo apt-get update\n$ sudo apt-get install neo4j-client libneo4j-client-dev\n```\n\nThere are also packages available for other platforms, including\n[Debian](https://packages.debian.org/source/sid/libneo4j-client),\n[Fedora](https://build.opensuse.org/package/binaries/home:cleishm/libneo4j-client/Fedora_23),\n[CentOS](https://build.opensuse.org/package/binaries/home:cleishm/libneo4j-client/CentOS_7) and\n[openSUSE](https://build.opensuse.org/package/binaries/home:cleishm/libneo4j-client/openSUSE_Tumbleweed).\n\nOtherwise, please see [Building](#building) below.\n\n\nneo4j-client Usage\n------------------\n\nExample interactive usage:\n\n```console\n$ neo4j-client -u neo4j localhost\nThe authenticity of host 'localhost:7687' could not be established.\nTLS certificate fingerprint is ded0fd2e893cd0b579f47f7798e10cb68dfa2fd3bc9b3c973157da81bab451d74f9452ba99a9c5f66dadb8a360959e5ebd8abb2d7c81230841e60531a96d268.\nWould you like to trust this host (NO/yes/once)? yes\nPassword: *****\nneo4j\u003e :help\nEnter commands or cypher statements at the prompt.\n\nCommands always begin with a colon (:) and conclude at the end of the line,\nfor example `:help`. Statements do not begin with a colon (:), may span\nmultiple lines, are terminated with a semi-colon (;) and will be sent to\nthe Neo4j server for evaluation.\n\nAvailable commands:\n:quit                  Exit the shell\n:connect '\u003curl\u003e'       Connect to the specified URL\n:connect host [port]   Connect to the specified host (and optional port)\n:disconnect            Disconnect the client from the server\n:export                Display currently exported parameters\n:export name=val ...   Export parameters for queries\n:unexport name ...     Unexport parameters for queries\n:reset                 Reset the session with the server\n:set                   Display current option values\n:set option=value ...  Set shell options\n:unset option ...      Unset shell options\n:status                Show the client connection status\n:help                  Show usage information\n:format (table|csv)    Set the output format\n:width (\u003cn\u003e|auto)      Set the number of columns in the table output\n\nFor more information, see the neo4j-client(1) manpage.\nneo4j\u003e\nneo4j\u003e :status\nConnected to 'neo4j://neo4j@localhost:7687'\nneo4j\u003e\nneo4j\u003e MATCH (n:Person) RETURN n LIMIT 3;\n+----------------------------------------------------------------------------+\n| n                                                                          |\n+----------------------------------------------------------------------------+\n| (:Person{born:1964,name:\"Keanu Reeves\"})                                   |\n| (:Person{born:1967,name:\"Carrie-Anne Moss\"})                               |\n| (:Person{born:1961,name:\"Laurence Fishburne\"})                             |\n+----------------------------------------------------------------------------+\nneo4j\u003e\nneo4j\u003e :set\n echo=off           // echo non-interactive commands before rendering results\n insecure=no        // do not attempt to establish secure connections\n format=table       // set the output format (`table` or `csv`).\n outfile=           // redirect output to a file\n username=\"neo4j\"   // the default username for connections\n width=auto         // the width to render tables (`auto` for term width)\nneo4j\u003e\nneo4j\u003e :quit\n$\n```\n\nExample non-interactive usage:\n\n```console\n$ echo \"MATCH (n:Person) RETURN n.name AS name, n.born AS born LIMIT 3\" | \\\n        neo4j-client -u neo4j -P localhost \u003e result.csv\nPassword: *****\n$\n$ cat result.csv\n\"name\",\"born\"\n\"Keanu Reeves\",1964\n\"Carrie-Anne Moss\",1967\n\"Laurence Fishburne\",1961\n$\n```\n\nEvaluating source files, e.g.:\n\n```console\n$ cat query.cyp\n:set echo\n:export name='Emil'\n\n// Create a person node if it doesn't exist\nbegin;\nMERGE (:Person {name: {name}});\ncommit;\n\n// return the total number of people\nMATCH (n:Person)\nRETURN count(n);\n$\n$ neo4j-client -u neo4j -p pass -o result.out -i query.cyp\n$ cat result.out\n+:export name='Emil'\n+begin;\n+MERGE (:Person {name: {name}});\nNodes created: 1\nProperties set: 1\nLabels added: 1\n+commit;\n+MATCH (n:Person)\n RETURN count(n);\n\"count(n)\"\n137\n$\n```\n\n\nlibneo4j-client\n---------------\n\nlibneo4j-client is a client library for Neo4j, written in C, and intended as a\nfoundation on which basic tools and drivers for various languages may be built.\nlibneo4j-client takes care of all the detail of establishing a session with a\nNeo4j server, sending statements for evaluation, and retrieving results.\n\nlibneo4j-client provides a single C header file, `neo4j-client.h`, for\ninclusion in source code using the libneo4j-client API. The API is described in\nthe [API Documentation](#api_documentation).\n\nlibneo4j-client can be included in your project by linking the library at\ncompile time, typically using the linking flags\n`-lneo4j-client -lssl -lcrypto -lm`.  Alternatively, libneo4j-client ships with\na [pkg-config]( https://wiki.freedesktop.org/www/Software/pkg-config/)\ndescription file, enabling you to obtain the required flags using\n`pkg-config --libs libneo4j-client`.\n\n\nAPI Documentation\n-----------------\n\nAPI documentation for the latest release is available at\n[https://neo4j-client.net/doc/latest/neo4j-client\\_8h.html](\n[https://neo4j-client.net/doc/latest/neo4j-client_8h.html).\n\nDocumentation can be built using `make doc`, which will use doxygen to generate\ndocumentation and output it into the `doc/` directory of the libneo4j-client\nsource tree. See [Building](#building) below.\n\n\nExample\n-------\n\n```C\n#include \u003cneo4j-client.h\u003e\n#include \u003cerrno.h\u003e\n#include \u003cstdio.h\u003e\n\nint main(int argc, char *argv[])\n{\n    neo4j_client_init();\n\n    /* use NEO4J_INSECURE when connecting to disable TLS */\n    neo4j_connection_t *connection =\n            neo4j_connect(\"neo4j://user:pass@localhost:7687\", NULL, NEO4J_INSECURE);\n    if (connection == NULL)\n    {\n        neo4j_perror(stderr, errno, \"Connection failed\");\n        return EXIT_FAILURE;\n    }\n\n    neo4j_result_stream_t *results =\n            neo4j_run(connection, \"RETURN 'hello world'\", neo4j_null);\n    if (results == NULL)\n    {\n        neo4j_perror(stderr, errno, \"Failed to run statement\");\n        return EXIT_FAILURE;\n    }\n\n    neo4j_result_t *result = neo4j_fetch_next(results);\n    if (result == NULL)\n    {\n        neo4j_perror(stderr, errno, \"Failed to fetch result\");\n        return EXIT_FAILURE;\n    }\n\n    neo4j_value_t value = neo4j_result_field(result, 0);\n    char buf[128];\n    printf(\"%s\\n\", neo4j_tostring(value, buf, sizeof(buf)));\n\n    neo4j_close_results(results);\n    neo4j_close(connection);\n    neo4j_client_cleanup();\n    return EXIT_SUCCESS;\n}\n```\n\n\nBuilding\n--------\n\nTo use neo4j-client or libneo4j-client, consider installation using the package\nmanagement system for your operating system (currently\n[Mac OS X](#getting_started),\n[Debian](https://packages.debian.org/source/sid/libneo4j-client),\n[Ubuntu](#getting_started),\n[Fedora](https://build.opensuse.org/package/binaries/home:cleishm/libneo4j-client/Fedora_23),\n[CentOS](https://build.opensuse.org/package/binaries/home:cleishm/libneo4j-client/CentOS_7) and\n[openSUSE](https://build.opensuse.org/package/binaries/home:cleishm/libneo4j-client/openSUSE_Tumbleweed)).\n\nIf neo4j-client is not available via your package management system,\nplease [download the latest release](\nhttps://github.com/cleishm/libneo4j-client/releases), unpack and then:\n\n```console\n$ ./configure\n$ make clean check\n$ sudo make install\n```\n\nlibneo4j-client requires OpenSSL, although this can be disabled by invoking\nconfigure with `--without-tls`.\n\nneo4j-client also requires some dependencies to build, including\n[libedit](http://thrysoee.dk/editline/) and\n[libcypher-parser](https://git.io/libcypher-parser). If these are not available,\njust the library can be built (without neo4j-client), by invoking configure\nwith `--disable-tools`.\n\nBuilding from the GitHub repository requires a few extra steps. Firstly, some\nadditional tooling is required, including autoconf, automake and libtool.\nAssuming these are available, to checkout from GitHub and build:\n\n```console\n$ git clone https://github.com/cleishm/libneo4j-client.git\n$ cd libneo4j-client\n$ ./autogen.sh\n$ ./configure\n$ make clean check\n$ sudo make install\n```\n\nIf you encounter warnings or errors during the build, please report them at\nhttps://github.com/cleishm/libneo4j-client/issues. If you wish to proceed\ndispite warnings, please invoke configure with the `--disable-werror`.\n\nNOTE: Recent versions of Mac OS X ship without the OpenSSL header files, and\nautoconf doesn't pick this up (yet). If you used the homebrew install method,\nthis will resolve the issue. If you're using Mac OS X, want to build manually\ninstead of using homebrew, and you get a build failure related to missing\nopenssl headers, try the following:\n\n```console\n$ brew install openssl\n$ ./configure --with-libs=/usr/local/opt/openssl\n$ make clean check\n$ sudo make install\n```\n\nMore detail about this workaround can be found via `brew info openssl`.\n\n\nSupport\n-------\n\nHaving trouble with neo4j-client? Please raise any issues with usage on\n[StackOverflow](http://stackoverflow.com/questions/tagged/neo4j-client). If\nyou've found a bug in the code, please raise an issue on\n[GitHub](https://github.com/cleishm/libneo4j-client) and include details of how\nto reproduce the bug.\n\n\nContributing\n------------\n\nContributions to neo4j-client are encouraged and should be made via pull\nrequests made to the [GitHub repository](\nhttps://github.com/cleishm/libneo4j-client). Please include test cases where\npossible, and use a style and approach consistent with the rest of the library.\n\nIt may be worthwhile raising an issue on github for the contribution you\nintend to make before developing the code, to allow for discussion and feedback\non the requirements.\n\n\nLicense\n-------\n\nneo4j-client is licensed under the [Apache License, Version 2.0](\nhttp://www.apache.org/licenses/LICENSE-2.0).\n\nUnless required by applicable law or agreed to in writing, software distributed\nunder the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\nCONDITIONS OF ANY KIND, either express or implied.  See the License for the\nspecific language governing permissions and limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcleishm%2Flibneo4j-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcleishm%2Flibneo4j-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcleishm%2Flibneo4j-client/lists"}