{"id":21273493,"url":"https://github.com/graphaware/neo4j-config-cli","last_synced_at":"2025-07-11T06:33:18.695Z","repository":{"id":69925638,"uuid":"403734592","full_name":"graphaware/neo4j-config-cli","owner":"graphaware","description":"neo4j-config-cli is a Neo4j utility to ensure the desired configuration state of a Neo4j database based on a json file definition.","archived":false,"fork":false,"pushed_at":"2023-12-11T19:53:30.000Z","size":200,"stargazers_count":14,"open_issues_count":0,"forks_count":1,"subscribers_count":6,"default_branch":"develop","last_synced_at":"2023-12-11T20:32:11.964Z","etag":null,"topics":["cli","docker","kubernetes","neo4j","neo4j-database"],"latest_commit_sha":null,"homepage":"","language":"Java","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/graphaware.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-09-06T19:16:28.000Z","updated_at":"2023-02-10T22:52:36.000Z","dependencies_parsed_at":"2023-12-11T20:31:20.477Z","dependency_job_id":"14f8cdf0-ad4e-41d4-9629-709ce113da32","html_url":"https://github.com/graphaware/neo4j-config-cli","commit_stats":null,"previous_names":[],"tags_count":19,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaware%2Fneo4j-config-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaware%2Fneo4j-config-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaware%2Fneo4j-config-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaware%2Fneo4j-config-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/graphaware","download_url":"https://codeload.github.com/graphaware/neo4j-config-cli/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225700876,"owners_count":17510448,"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","docker","kubernetes","neo4j","neo4j-database"],"created_at":"2024-11-21T09:15:02.812Z","updated_at":"2025-07-11T06:33:18.689Z","avatar_url":"https://github.com/graphaware.png","language":"Java","readme":"[![GitHub license](https://img.shields.io/github/license/graphaware/neo4j-config-cli)](https://github.com/graphaware/neo4j-config-cli/blob/main/LICENSE.txt)\n[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/graphaware/neo4j-config-cli?logo=github\u0026sort=semver)](https://github.com/graphaware/neo4j-config-cli/releases/latest)\n[![Docker Pulls](https://img.shields.io/docker/pulls/graphaware/neo4j-config-cli?logo=docker)](https://hub.docker.com/r/graphaware/neo4j-config-cli)\n\n# neo4j-config-cli\n\n`neo4j-config-cli` is a [Neo4j](https://neo4j.com) utility to ensure the desired configuration state of a Neo4j database \nbased on a json file definition.\n\nDocker : https://hub.docker.com/repository/docker/graphaware/neo4j-config-cli\n\nThe following `docker-compose.yml` : \n\n```yaml\nversion: '3'\nservices:\n  neo4j:\n    image: neo4j:5.14.0-enterprise\n    ports:\n      - \"7474:7474\"\n      - \"7687:7687\"\n    environment:\n      - NEO4J_ACCEPT_LICENSE_AGREEMENT=yes\n      - NEO4J_AUTH=neo4j/${NEO4J_PASSWORD:-password}\n  neo4j-config-cli:\n    image: graphaware/neo4j-config-cli:2.5.0\n    environment:\n      - NEO4J_USER=neo4j\n      - NEO4J_PASSWORD=password\n      - NEO4J_URI=bolt://neo4j:7687\n      - IMPORT_PATH=/config\n    volumes:\n      - \"./config:/config\"\n```\n\nwith the following json definition in `config/simple-db-create.json`\n\n```json\n{\n    \"kind\": \"Database\",\n    \"name\": \"movies\",\n    \"dropIfExists\": true\n}\n```\n\nwill wait Neo4j is started then drop the `movies` database and recreate it, once done the `neo4j-config-cli` container will stop : \n\n```text\n$ docker-compose up\nCreating network \"neo4j-config-demo_default\" with the default driver\nCreating neo4j-config-demo_neo4j_1 ... done\nCreating neo4j-config-demo_neo4j-config-cli_1 ... done\nAttaching to neo4j-config-demo_neo4j-config-cli_1, neo4j-config-demo_neo4j_1\nneo4j_1             | Selecting JVM - Version:11.0.12, Name:OpenJDK 64-Bit Server VM, Vendor:Oracle Corporation\nneo4j-config-cli_1  |\nneo4j-config-cli_1  |   .   ____          _            __ _ _\nneo4j-config-cli_1  |  /\\\\ / ___'_ __ _ _(_)_ __  __ _ \\ \\ \\ \\\nneo4j-config-cli_1  | ( ( )\\___ | '_ | '_| | '_ \\/ _` | \\ \\ \\ \\\nneo4j-config-cli_1  |  \\\\/  ___)| |_)| | | | | || (_| |  ) ) ) )\nneo4j-config-cli_1  |   '  |____| .__|_| |_|_| |_\\__, | / / / /\nneo4j-config-cli_1  |  =========|_|==============|___/=/_/_/_/\nneo4j-config-cli_1  |  :: Spring Boot ::                (v2.5.4)\nneo4j-config-cli_1  |\nneo4j-config-cli_1  | 2021-09-07 08:02:40.342  INFO 1 --- [main] c.g.n.config.Neo4jConfigCliApplication   : Starting Neo4jConfigCliApplication v1.1.0-SNAPSHOT using Java 11.0.11 on 4daf472cb393 with PID 1 (/opt/app.jar started by appuser in /)\nneo4j-config-cli_1  | 2021-09-07 08:02:40.344  INFO 1 --- [main] c.g.n.config.Neo4jConfigCliApplication   : No active profile set, falling back to default profiles: default\nneo4j-config-cli_1  | 2021-09-07 08:02:40.975  INFO 1 --- [main] org.neo4j.driver.Driver                  : Direct driver instance 841262455 created for server address neo4j:7687\nneo4j-config-cli_1  | 2021-09-07 08:02:41.160  INFO 1 --- [main] c.g.n.config.Neo4jConfigCliApplication   : Started Neo4jConfigCliApplication in 1.29 seconds (JVM running for 1.677)\nneo4j-config-cli_1  | 2021-09-07 08:02:41.162  INFO 1 --- [main] c.g.neo4j.config.Neo4jConfigRunner       : Starting command line application\nneo4j-config-cli_1  | 2021-09-07 08:02:41.168  INFO 1 --- [main] c.g.neo4j.config.GraphDatabaseImport     : Detecting neo4j server availability\nneo4j-config-cli_1  | 2021-09-07 08:02:41.300 ERROR 1 --- [main] c.g.neo4j.config.GraphDatabaseImport     : Neo4j server not yet available, waiting for 2 seconds...\nneo4j_1             | Changed password for user 'neo4j'.\nneo4j-config-cli_1  | 2021-09-07 08:02:43.309 ERROR 1 --- [main] c.g.neo4j.config.GraphDatabaseImport     : Neo4j server not yet available, waiting for 2 seconds...\nneo4j_1             | 2021-09-07 08:02:44.228+0000 INFO  Starting...\nneo4j-config-cli_1  | 2021-09-07 08:02:45.313 ERROR 1 --- [main] c.g.neo4j.config.GraphDatabaseImport     : Neo4j server not yet available, waiting for 2 seconds...\nneo4j_1             | 2021-09-07 08:02:45.959+0000 INFO  ======== Neo4j 4.3.3 ========\nneo4j-config-cli_1  | 2021-09-07 08:02:47.303 ERROR 1 --- [main] c.g.neo4j.config.GraphDatabaseImport     : Neo4j server not yet available, waiting for 2 seconds...\nneo4j_1             | 2021-09-07 08:02:47.731+0000 INFO  Sending metrics to CSV file at /var/lib/neo4j/metrics\nneo4j_1             | 2021-09-07 08:02:48.012+0000 INFO  Bolt enabled on 0.0.0.0:7687.\nneo4j_1             | 2021-09-07 08:02:48.917+0000 INFO  Remote interface available at http://localhost:7474/\nneo4j_1             | 2021-09-07 08:02:48.919+0000 INFO  Started.\nneo4j-config-cli_1  | 2021-09-07 08:02:49.694  INFO 1 --- [main] c.g.neo4j.config.Neo4jConfigRunner       : Will import from file /config/simple-db-create.json\nneo4j-config-cli_1  | 2021-09-07 08:02:49.781  INFO 1 --- [main] c.g.n.c.service.CreateDatabaseService    : Dropping database movies\nneo4j-config-cli_1  | 2021-09-07 08:02:50.048  INFO 1 --- [main] c.g.n.c.service.CreateDatabaseService    : Creating database movies\nneo4j-config-cli_1  | 2021-09-07 08:02:51.648  INFO 1 --- [main] c.g.neo4j.config.Neo4jConfigRunner       : Ended command line application\nneo4j-config-cli_1  | 2021-09-07 08:02:51.654  INFO 1 --- [main] org.neo4j.driver.Driver                  : Closing driver instance 841262455\nneo4j-config-cli_1  | 2021-09-07 08:02:51.657  INFO 1 --- [main] org.neo4j.driver.ConnectionPool          : Closing connection pool towards neo4j:7687\nneo4j-config-demo_neo4j-config-cli_1 exited with code 0\n```\n\n## Config files\n\nTwo `kind` of config files are supported today : \n\n- `Database` kind\n- `Role` kind\n\n### Database Config File\n\n**Structure**\n\n```json\n{\n  \"kind\": \"Database\",\n  \"name\": \"movies\",\n  \"dropIfExists\": \"true\",\n  \"indexes\": {\n    \"nodes\" : [\n      {\n        \"labels\": [\"Person\"],\n        \"properties\": [\"name\"],\n        \"name\": \"Person\",\n        \"type\": \"FULLTEXT\"\n      }\n    ],\n  },\n  \"constraints\": {\n    \"nodes\": [\n      {\n        \"label\": \"Person\",\n        \"property\": \"name\",\n        \"type\": \"UNIQUE\"\n      },\n      {\n        \"labels\": [\"FacebookEvent\"],\n        \"properties\": [\"date\"],\n        \"type\": \"PROPERTY_TYPE\",\n        \"propertyType\": \"DATE\",\n        \"name\": \"facebook_event_date_type\"\n      }\n    ]\n  },\n  \"seeds\": [\"movies.cypher\"]\n}\n```\n\n#### Property type enum values\n\n```\nBOOLEAN(\"BOOLEAN\"),\nSTRING\nINTEGER\nFLOAT\nDATE\nLOCAL_TIME\nZONED_TIME\nLOCAL_DATETIME\nZONED_DATETIME\nDURATION\nPOINT\nLIST_OF_BOOLEAN\nLIST_OF_STRING\nLIST_OF_INTEGER\nLIST_OF_FLOAT\nLIST_OF_DATETIME\nLIST_OF_LOCAL_TIME\nLIST_OF_ZONED_TIME\nLIST_OF_LOCAL_DATETIME\nLIST_OF_DATE\nLIST_OF_DURATION\nLIST_OF_POINT\n```\n\n### Role Config File\n\n**Structure**\n\n```json\n{\n  \"kind\": \"Role\",\n  \"name\": \"ut1\",\n  \"dropIfExists\": true,\n  \"privileges\": [\n    {\n      \"graph\": \"*\",\n      \"access\": true,\n      \"rules\": [\n        {\n          \"target\": \"node\",\n          \"labels\": \"*\",\n          \"action\": \"match\",\n          \"resource\": \"all_properties\",\n          \"access\": \"GRANTED\"\n        },\n        {\n          \"target\": \"node\",\n          \"labels\": \"Person\",\n          \"action\": \"read\",\n          \"resource\": \"born\",\n          \"access\": \"DENIED\"\n        }\n      ]\n    }\n  ]\n}\n```\n\n---\n\n## Neo4j Aura\n\nThe command `CREATE DATABASE` is not available on Neo4j aura, you thus have to skip the step where this tool will \nexecute that command by specifying `skipCreate = true` : \n\n```json\n{\n  \"kind\": \"Database\",\n  \"name\": \"neo4j\",\n  \"skipCreate\": true\n}\n```\n\nA full working example with Aura is available [here](./examples/aura) after inserting your Neo4j Aura credentials in \nthe docker-compose file.\n\n---\n\n## Importing from remote files\n\nYou can let your config files on the web, for eg as a `Github Gist` : https://gist.github.com/ikwattro/f99c1ed085673065fcb4e850526ccd49\n\nYou will need to specify the raw versions of it, for eg :\n\n```yaml\nversion: '3.7'\nservices:\n  neo4j:\n    image: neo4j:4.4.15-enterprise\n    ports:\n      - \"7474:7474\"\n      - \"7687:7687\"\n    environment:\n      - NEO4J_ACCEPT_LICENSE_AGREEMENT=yes\n      - NEO4J_AUTH=neo4j/${NEO4J_PASSWORD:-password}\n  neo4j-config-cli:\n    image: graphaware/neo4j-config-cli:1.2.0\n    environment:\n      - NEO4J_PASSWORD=password\n      - NEO4J_URI=bolt://neo4j:7687\n      - IMPORT_PATH=https://gist.githubusercontent.com/ikwattro/f99c1ed085673065fcb4e850526ccd49/raw/35f077b71e3f7a9fd95b0288cf6d622eea3d6501/db-demo.json\n```\n\n## Seeding only an existing database\n\n```shell\ndocker run --rm -it \\\n    -e NEO4J_URI=neo4j+s://18894d85.databases.neo4j.io \\\n    -e NEO4J_PASSWORD=tT3h3ieK4sw-MATaEaimFFHY9YqkgYNo9WNYcEBqMZ4 \\\n    -e seed-only=true \\\n    -e seed-url=https://bit.ly/2XnJzFn \\\n    graphaware/neo4j-config-cli:1.3.0\n```\n\n## Seeding a database from a Neo4j 5 backup ( seedFromUri )\n\nThis feature requires that your Neo4j configuration allows seeding from uri's\n\n```yaml\n- NEO4J_dbms_databases_seed__from__uri__providers=URLConnectionSeedProvider\n```\n\n```json\n{\n  \"kind\": \"Database\",\n  \"name\": \"world.cup\",\n  \"dropIfExists\": \"false\",\n  \"seedFromUri\": \"https://downloads.graphaware.com/neo4j-db-seeds/world-cup-2022-neo4j.backup\"\n}\n```\n\n## Licence\n\nRefer to the `LICENSE.txt` file shipped in this repository\n\n## Support\n\nThis repository is supported on best-effort basis.\n\n\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphaware%2Fneo4j-config-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraphaware%2Fneo4j-config-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphaware%2Fneo4j-config-cli/lists"}