{"_id":"@archethicjs/collection-generator-cli","_rev":"4-bdcb777dab7c5e32af6884cd17ef2055","name":"@archethicjs/collection-generator-cli","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.1":{"name":"@archethicjs/collection-generator-cli","version":"1.0.1","author":{"name":"Archethic Foundation","email":"dev@archethic.net"},"license":"AGPL-3.0-or-later","_id":"@archethicjs/collection-generator-cli@1.0.1","maintainers":[{"name":"bchamagne","email":"bastien@archethic.net"},{"name":"neylix","email":"julien@uniris.io"},{"name":"sam_manza","email":"samuel@uniris.io"}],"homepage":"https://github.com/archethic-foundation/collection-generator-cli#readme","bugs":{"url":"https://github.com/archethic-foundation/collection-generator-cli/issues"},"bin":{"aenft-collection":"index.js"},"pkg":{"assets":["layers/**/*","node_modules/**/*","src/**/*"]},"dist":{"shasum":"8dd2cd778fca1f83d810a614f8d0d4f09e28c638","tarball":"https://registry.npmjs.org/@archethicjs/collection-generator-cli/-/collection-generator-cli-1.0.1.tgz","fileCount":35,"integrity":"sha512-oXdaxhvGEOxXtOdWqK0sXKxhxbq3a7ND6I9KzGCmAEtcut9R79B93V8no2AvXkTv6ehWkFidmZBzPyNnw5tgdQ==","signatures":[{"sig":"MEUCIGqzJMSc7H9qfu5JaeBkvoHvCmUclXempFf1TG+/iU/yAiEA9/GOZ0c4Xhj7XwBZDksr/Yi1UerVTfSZPzi68AntOhc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1193663},"main":"index.js","type":"module","gitHead":"bef7b1a86d6cceac209bd61cf287d1548a3809c4","_npmUser":{"name":"sam_manza","email":"samuel@uniris.io"},"repository":{"url":"git+https://github.com/archethic-foundation/collection-generator-cli.git","type":"git"},"_npmVersion":"9.5.1","description":"Archethic NFT Collection Generator CLI","directories":{},"_nodeVersion":"19.8.1","dependencies":{"sha1":"^1.1.1","chalk":"^4.1.1","yargs":"^17.6.2","canvas":"^2.8.0","figlet":"^1.5.2","minimist":"^1.2.8","@archethicjs/sdk":"^1.19.0","@archethicjs/aeweb-cli":"^0.7.3"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/collection-generator-cli_1.0.1_1697020028791_0.056712535792520224","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"@archethicjs/collection-generator-cli","version":"1.0.2","author":{"name":"Archethic Foundation","email":"dev@archethic.net"},"license":"AGPL-3.0-or-later","_id":"@archethicjs/collection-generator-cli@1.0.2","maintainers":[{"name":"bchamagne","email":"bastien@archethic.net"},{"name":"neylix","email":"julien@archethic.net"},{"name":"sam_manza","email":"samuel@uniris.io"}],"homepage":"https://github.com/archethic-foundation/collection-generator-cli#readme","bugs":{"url":"https://github.com/archethic-foundation/collection-generator-cli/issues"},"bin":{"aenft-collection":"index.js"},"pkg":{"assets":["layers/**/*","node_modules/**/*","src/**/*"]},"dist":{"shasum":"5bb0ab419a5b7e1294ab40f79dc84072395e7b62","tarball":"https://registry.npmjs.org/@archethicjs/collection-generator-cli/-/collection-generator-cli-1.0.2.tgz","fileCount":35,"integrity":"sha512-+21RG6HZtQAII+LJYpwIoXGJjsBAfSMhzC110AxOUyUfd6uwYpIm+QF/xqSYqgM0mTnSN4EinTZMNA8T5RM6Dw==","signatures":[{"sig":"MEUCIQDcdNLCIXeMyWjbgg0nb18nyee/gDbZClRwNCk+nVaESQIgJWdOmG3PULUjRI7Yyg23cMNROaFQ6wb8Bs82Fx8vw/E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1193628},"main":"index.js","type":"module","gitHead":"dd02b96d9e67f0873a1b952e7fae6e7ef524dd47","_npmUser":{"name":"sam_manza","email":"samuel@uniris.io"},"repository":{"url":"git+https://github.com/archethic-foundation/collection-generator-cli.git","type":"git"},"_npmVersion":"8.19.4","description":"Archethic NFT Collection Generator CLI","directories":{},"_nodeVersion":"16.20.2","dependencies":{"sha1":"^1.1.1","chalk":"^5.3.0","yargs":"^17.7.2","bcrypt":"^5.1.1","figlet":"^1.7.0","minimist":"^1.2.8","@napi-rs/canvas":"^0.1.44","@archethicjs/sdk":"^1.20.1","@archethicjs/aeweb-cli":"^0.7.3"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/collection-generator-cli_1.0.2_1702852657964_0.1578164006888445","host":"s3://npm-registry-packages"}}},"time":{"created":"2023-10-11T10:27:08.665Z","modified":"2025-05-29T15:39:58.978Z","1.0.1":"2023-10-11T10:27:08.969Z","1.0.2":"2023-12-17T22:37:38.286Z"},"bugs":{"url":"https://github.com/archethic-foundation/collection-generator-cli/issues"},"author":{"name":"Archethic Foundation","email":"dev@archethic.net"},"license":"AGPL-3.0-or-later","homepage":"https://github.com/archethic-foundation/collection-generator-cli#readme","repository":{"url":"git+https://github.com/archethic-foundation/collection-generator-cli.git","type":"git"},"description":"Archethic NFT Collection Generator CLI","maintainers":[{"email":"samuel@uniris.io","name":"sam_manza"},{"email":"julien.leclerc05@protonmail.com","name":"neylix"},{"email":"philippe.archethic@gmail.com","name":"archethic-maintener"}],"readme":"# Collection Generator CLI 🔥\n\nWelcome to Collection Generator CLI, this repository lets you generate, upload and mint NFT collection on Archethic Public Blockchain.\n\n## Installation 🛠️\n\n```sh\nnpm install -g @archethicjs/collection-generator-cli\n```\n\nTo check if project is installed successfully, run the following command -\n\n```sh\nnode index.js about\n```\n\n## Usage ℹ️\nFirst, create a ``config.json`` file with this structure (for example at the root of your project):\n\n```json\n{\n  \"namePrefix\": \"Your Collection\",\n  \"description\": \"Remember to replace this description\",\n  \"baseUri\": \"\",\n  \"supply\": 500000000,\n  \"name\": \"AE Collection\",\n  \"symbol\": \"AE05\",\n  \"layerConfigurations\": [\n    {\n      \"growEditionSizeTo\": 5,\n      \"layersOrder\": [\n        { \"name\": \"Background\" },\n        { \"name\": \"Eyeball\" },\n        { \"name\": \"Eye color\" },\n        { \"name\": \"Iris\" },\n        { \"name\": \"Shine\" },\n        { \"name\": \"Bottom lid\" },\n        { \"name\": \"Top lid\" },\n      ]\n    }\n  ],\n  \"shuffleLayerConfigurations\": false,\n  \"debugLogs\": false,\n  \"format\": {\n    \"width\": 512,\n    \"height\": 512,\n    \"smoothing\": false\n  },\n  \"text\": {\n    \"only\": false,\n    \"color\": \"#ffffff\",\n    \"size\": 20,\n    \"xGap\": 40,\n    \"yGap\": 40,\n    \"align\": \"left\",\n    \"baseline\": \"top\",\n    \"weight\": \"regular\",\n    \"family\": \"Courier\",\n    \"spacer\": \" => \"\n  },\n  \"pixelFormat\": {\n    \"ratio\": 0.015625\n  },\n  \"background\": {\n    \"generate\": true,\n    \"brightness\": \"80%\",\n    \"static\": false,\n    \"default\": \"#000000\"\n  },\n  \"extraMetadata\": {},\n  \"rarityDelimiter\": \"#\",\n  \"uniqueDnaTolerance\": 10000,\n  \"addDnaToMetadata\": false,\n  \"addEditionToMetadata\": false\n}\n```\n\nCreate your different layers as folders in a 'layers' directory (this directory must be in the root), and add all the layer assets in these directories. You can name the assets anything as long as it has a rarity weight attached in the file name like so: `example element#70.png`. You can optionally change the delimiter `#` to anything you would like to use in the variable `rarityDelimiter` in the `config.json` file.\n\nOnce you have all your layers, go into your `config.json` and update the `layerConfigurations` objects `layersOrder` array to be your layer folders name in order of the back layer to the front layer.\n\n_Example:_ If you were creating a portrait design, you might have a background, then a head, a mouth, eyes, eyewear, and then headwear, so your `layersOrder` would look something like this:\n\n```json\n\"layerConfigurations\": [\n    {\n      \"growEditionSizeTo\": 100,\n      \"layersOrder\": [\n        { \"name\": \"Head\" },\n        { \"name\": \"Mouth\" },\n        { \"name\": \"Eyes\" },\n        { \"name\": \"Eyeswear\" },\n        { \"name\": \"Headwear\" },\n      ]\n    }\n  ],\n```\n\nThe `name` of each layer object represents the name of the folder (in `/layers/`) that the images reside in.\n\nOptionally you can now add multiple different `layerConfigurations` to your collection. Each configuration can be unique and have different layer orders, use the same layers or introduce new ones. This gives the artist flexibility when it comes to fine tuning their collections to their needs.\n\n_Example:_ If you were creating a portrait design, you might have a background, then a head, a mouth, eyes, eyewear, and then headwear and you want to create a new race or just simple re-order the layers or even introduce new layers, then you're `layerConfigurations` and `layersOrder` would look something like this:\n\n```jsonc\n  \"layerConfigurations\": [\n    {\n      // Creates up to 50 artworks\n      \"growEditionSizeTo\": 50,\n      \"layersOrder\": [\n        { \"name\": \"Background\" },\n        { \"name\": \"Head\" },\n        { \"name\": \"Mouth\" },\n        { \"name\": \"Eyes\" },\n        { \"name\": \"Eyeswear\" },\n        { \"name\": \"Headwear\" },\n      ]\n    },\n    {\n      // Creates an additional 100 artworks\n      \"growEditionSizeTo\": 150,\n      \"layersOrder\": [\n        { \"name\": \"Background\" },\n        { \"name\": \"Head\" },\n        { \"name\": \"Mouth\" },\n        { \"name\": \"Eyes\" },\n        { \"name\": \"Eyeswear\" },\n        { \"name\": \"Headwear\" },\n      ]\n    }\n  ]\n```\n\nUpdate your `format` size, ie the outputted image size, and the `growEditionSizeTo` on each `layerConfigurations` object, which is the amount of variation outputted.\n\nYou can mix up the `layerConfigurations` order on how the images are saved by setting the variable `shuffleLayerConfigurations` in the `config.js` file to true. It is false by default and will save all images in numerical order.\n\nIf you want to have logs to debug and see what is happening when you generate images you can set the variable `debugLogs` in the `config.json` file to true. It is false by default, so you will only see general logs.\n\n\nWhen you are ready, run the following command and your outputted art will be in the `build/images` directory and the json in the `build/json` directory:\n\n```sh\nnode index.js generate --config ./config.json\n```\n\n- `config` is the path of your `config.json` file.\n- `layers` is the path to your NFT layers folder (optional, default to: `./layers`)\n- `output` is the path of your NFT collection building output (optional, default to: `./build`)\n  \nThe program will output all the images in the `build/images` directory along with the metadata files in the `build/json` directory. Each collection will have a `_metadata.json` file that consists of all the metadata in the collection inside the `build/json` directory. The `build/json` folder also will contain all the single json files that represent each image file. The single json file of a image will look something like this:\n\n```json\n{\n  \"name\": \"Your Collection #1\",\n  \"description\": \"Remember to replace this description\",\n  \"image\": \"http://localhost:4000/api/web_hosting/0000c11d9aba1cf7228230c479e3c85f370065b0a7dddc99035e635de78faff263cb/1.png\",\n  \"dna\": \"f696ea4c20ab1ee434ba5b8e99a4af0f4f10a4b0\",\n  \"edition\": 1,\n  \"date\": 1676285790212,\n  \"attributes\": [\n    {\n      \"trait_type\": \"Background\",\n      \"value\": \"Black\"\n    },\n    {\n      \"trait_type\": \"Eyeball\",\n      \"value\": \"White\"\n    },\n    {\n      \"trait_type\": \"Eye color\",\n      \"value\": \"Cyan\"\n    },\n    {\n      \"trait_type\": \"Iris\",\n      \"value\": \"Medium\"\n    },\n    {\n      \"trait_type\": \"Shine\",\n      \"value\": \"Shapes\"\n    },\n    {\n      \"trait_type\": \"Bottom lid\",\n      \"value\": \"Low\"\n    },\n    {\n      \"trait_type\": \"Top lid\",\n      \"value\": \"Middle\"\n    }\n  ]\n}\n```\n\nYou can also add extra metadata to each metadata file by adding your extra items, (key: value) pairs to the `extraMetadata` object variable in the `config.js` file.\n\n```js\nconst extraMetadata = {\n  creator: \"Manuj Varma\",\n};\n```\n\nIf you don't need extra metadata, simply leave the object empty. It is empty by default.\n\n```js\nconst extraMetadata = {};\n```\n\nThat's it, you're done.\n\n## Upload & Mint on Archethic\n\n### Upload the generated images to Archethic Public Blockchain\n\nTo upload images - \n\n- `seed` is a string representing the transaction chain entropy to be able to derive and generate the keys\n- `endpoint` is the URL of a welcome node to receive the transaction\n- `build-path` is the path of the NFT collection generation output (optional, default to: `./build`)\n  \n```bash\nnode index.js upload --seed myseedphrase --endpoint https://testnet.archethic.net\n```\n\n### Mint a collection on Archethic Public Blockchain\n\nTo mint a NFT collection on Archethic Public Blockchain - \n\n- `seed` is a string representing the transaction chain entropy to be able to derive and generate the keys\n- `endpoint` is the URL of a welcome node to receive the transaction\n- `build-path` is the path of the NFT collection generation output (optional, default to: `./build`)\n\n```bash\nnode index.js mint --seed myseedphrase --endpoint https://testnet.archethic.net\n```\n\nHope you will create some awesome artworks with this code.\n","readmeFilename":"README.md"}