{"id":22511529,"url":"https://github.com/jrnd-io/jr","last_synced_at":"2025-10-07T19:20:26.793Z","repository":{"id":66851492,"uuid":"600550589","full_name":"jrnd-io/jr","owner":"jrnd-io","description":"JR: streaming quality random data from the command line","archived":false,"fork":false,"pushed_at":"2025-03-19T17:04:47.000Z","size":2885,"stargazers_count":133,"open_issues_count":30,"forks_count":29,"subscribers_count":16,"default_branch":"main","last_synced_at":"2025-03-29T10:04:46.306Z","etag":null,"topics":["avro","datagen","json-schema","kafka","kafka-producer","mongodb","protobuf","random-generation","redis","schema-registry","template"],"latest_commit_sha":null,"homepage":"https://jrnd.io","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jrnd-io.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":"2023-02-11T20:49:41.000Z","updated_at":"2025-03-19T17:04:52.000Z","dependencies_parsed_at":"2023-02-21T05:00:31.874Z","dependency_job_id":"739684e1-7301-4be9-9b31-28100b0b9ef8","html_url":"https://github.com/jrnd-io/jr","commit_stats":null,"previous_names":["jrnd-io/jr"],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrnd-io%2Fjr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrnd-io%2Fjr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrnd-io%2Fjr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrnd-io%2Fjr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jrnd-io","download_url":"https://codeload.github.com/jrnd-io/jr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247325693,"owners_count":20920714,"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":["avro","datagen","json-schema","kafka","kafka-producer","mongodb","protobuf","random-generation","redis","schema-registry","template"],"created_at":"2024-12-07T02:13:06.831Z","updated_at":"2025-10-07T19:20:26.787Z","avatar_url":"https://github.com/jrnd-io.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JR: streaming Quality Random Data from the Command line\n\nJR is a CLI program that helps you to stream quality random data for your applications\n\n![jr](https://user-images.githubusercontent.com/89472/235927141-87632730-90d6-469f-97b0-8b638077dd4e.png)\n\n\n[![img.png](images/goreport.png)](https://goreportcard.com/report/github.com/ugol/jr)\n![Build](https://github.com/jrnd-io/jr/actions/workflows/go-linux.yml/badge.svg)\n![Build](https://github.com/jrnd-io/jr/actions/workflows/go-mac.yml/badge.svg)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Go Reference](https://pkg.go.dev/badge/github.com/jrnd-io/jr.svg)](https://pkg.go.dev/github.com/ugol/jr)\n[![Docker](https://img.shields.io/badge/docker-latest-blue.svg)](https://hub.docker.com/r/jrndio/jr)\n\n![JR-simple](https://user-images.githubusercontent.com/89472/229626362-70ddc95d-1090-4746-a20a-fbffba4193cd.gif)\n\n## Documentation\n\nFor full documentation about emitters, referential integrity, how to write templates and more, pls see the full [JR Documentation](https://jrnd.io).\n\n## Building and compiling\n\nJR requires Go 1.24\n\nyou can use the `make_install.sh` to install JR. This script does everything needed in one simple command.\n\n```bash\n./make_install.sh\n```\n\nThese are the steps in the `make_install.sh` script if you want to use them separately:\n\n```bash\n# generates the code and compile everything\nmake all\n# copy the templates and data directory in your $JR_SYSTEM_DIR, which defaults to $XDG_CONFIGDIR for your OS\nmake copy_templates  \n# copy the jr bin in /usr/local/bin\nsudo make install\n```\n\nIf you want to run the Unit tests, you have a `make` target for that too:\n\n```bash\nmake test\n```\n\n## Basic usage\n\nJR is very straightforward to use. Here are some examples:\n\n### Listing existing templates\n```bash\njr template list\n````\nTemplates are in the directory `$JR_SYSTEM_DIR/templates`. JR_SYSTEM_DIR defaults to `$XDG_CONFIGDIR` and can be changed to a different dir, for example:\n\n```bash\nJR_SYSTEM_DIR=~/jrconfig/ jr template list\n````\n\nTemplates with parsing issues are showed in \u003cfont color='red'\u003ered\u003c/font\u003e, Templates with no parsing issues are showed in \u003cfont color='green'\u003egreen\u003c/font\u003e\n\n### Create random data from one of the provided templates\n\nUse for example the predefined `net_device` template to generate a random JSON network device\n\n```bash\njr template run net_device\n````\n\nor, with a shortcut:\n\n```bash\njr run net_device\n````\n\n### Using Docker\n\nYou can also use a [![Docker](https://img.shields.io/badge/docker-latest-blue.svg)](https://hub.docker.com/r/jrndio/jr)\nimage if you prefer.\n\n```bash\ndocker run -it jrndio/jr:latest jr run net_device\n```\n\n### Other options for templates\n\nIf you want to use your own template, you can:\n\n- put it in the templates directory\n- embed it directly in the command using the `--embedded` flag\n\nFor a quick and dirty test, the best option is to embed directly a template in the command:\n\n```bash\njr run --embedded \"name:{{name}}\"\n```\n\n### Create more random data \n\nUsing `-n` option you can create more data in each pass. \nThis example creates 3 net_device objects at once:\n\n```bash\njr run net_device -n 3\n```\n### Continuous streaming data\n\nUsing `--frequency` option you can repeat the creation every `f` milliseconds\n\nThis example creates 2 net_device every second, for ever:\n\n```bash\njr run net_device -n 2 -f 1s \n```\n\nUsing `--duration` option you can time bound the entire object creation.\n\nThis example creates 2 net_device every 100ms for 1 minute:\n\n```bash\njr run net_device -n 2 -f 100ms -d 1m \n```\n\nResults are by default written on standard out (`--output \"stdout\"`) with this output template:\n\n```\n\"{{.V}}\\n\"\n```\n\nwhich means that only the \"Value\" is in the output. You can change this behaviour embedding a different template with `--outputTemplate`\n\nIf you want syntax colouring and your output is just json, you can pipe to [jq](https://jqlang.github.io/jq/)\n\n```bash\njr run net_device -n 2 -f 100ms -d 1m | jq\n```\n\nBeware that if you, for example, include the key in the output, it won't be possible to use jq:\n\n```bash\njr run net_device -n 2 -f 100ms -d 1m --kcat | jq\n\nparse error: Expected value before ',' at line 1, column 5\n```\n\n## Producing to Kafka \n\nJust use the `--output kafka` (which defaults to `console`) flag and `--topic` flag to indicate the topic name:\n\n```bash\njr run net_device -n 5 -f 500ms -o kafka -t test\n```\n\n## Producing to other stores\n\nYou can use JR to stream data to many different stores, not only Kafka.\nJR supports natively several different producers: you can also easily `jr run template | CLI-tool-to-your-store` if your preferred store is not natively supported.\nIf you think that your preferred store should be supported, why not [implement it](#implementing-other-producers)? Or just open up [an issue](https://github.com/jrnd-io/jr/issues) and we'll do that for you!\n\n```bash\njr producer list\n```\n\nYou'll get an output similar to:\n```\nList of JR producers:\n\nConsole * (--output = stdout)\nKafka (--output = kafka)\nHTTP (--output = http)\nRedis (--output = redis)\nMongodb (--output = mongo)\nElastic (--output = elastic)\nS3 (--output = s3)\nGCS (--output = gcs)\nAZBlobStorage (--output = azblobstorage)\nAZCosmosDB (--output = azcosmosdb)\nCassandra (--output = cassandra)\nLUA Script (--output = luascript)\nWASM Function (--output = wasm)\nAWS DynamoDB (--output = awsdynamodb)\n\n```\nto use a producer, just set the corresponding value in `--output`\n\n\n## Distributed Testing\n\nJR can be run as a distributed data generation. \nAt the moment the following testing tools are supported:\n\n- [k6](./k6/exec/)\n- [locust](./locust/)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjrnd-io%2Fjr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjrnd-io%2Fjr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjrnd-io%2Fjr/lists"}