{"id":23558015,"url":"https://github.com/lovelaced/polkacli","last_synced_at":"2025-09-16T13:15:43.803Z","repository":{"id":255082407,"uuid":"848485999","full_name":"lovelaced/polkacli","owner":"lovelaced","description":"A CLI dedicated to Polkadot Assets","archived":false,"fork":false,"pushed_at":"2024-09-11T16:08:48.000Z","size":212,"stargazers_count":12,"open_issues_count":11,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-30T10:22:47.097Z","etag":null,"topics":["assethub","nfts","polkadot","substrate","subxt"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lovelaced.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-08-27T21:08:53.000Z","updated_at":"2025-02-27T01:27:24.000Z","dependencies_parsed_at":"2024-08-27T23:00:10.347Z","dependency_job_id":"948898fb-2c97-49ae-992f-a1ec11d4a89a","html_url":"https://github.com/lovelaced/polkacli","commit_stats":null,"previous_names":["lovelaced/polkacli"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovelaced%2Fpolkacli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovelaced%2Fpolkacli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovelaced%2Fpolkacli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovelaced%2Fpolkacli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lovelaced","download_url":"https://codeload.github.com/lovelaced/polkacli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251683807,"owners_count":21627023,"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":["assethub","nfts","polkadot","substrate","subxt"],"created_at":"2024-12-26T15:19:19.637Z","updated_at":"2025-09-16T13:15:38.757Z","avatar_url":"https://github.com/lovelaced.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PolkaCLI\n\n**PolkaCLI** is a command-line interface (CLI) tool designed for interacting with AssetHub, Polkadot's official rollup dedicated to assets. With PolkaCLI, users can mint NFTs, manage collections, check balances, and perform various other operations directly from the terminal.\n\n## Features\n\n- **NFT Management**\n  - Mint new NFT collections and individual NFTs.\n  - Display detailed information about specific NFTs and collections.\n  - Set metadata of existing NFTs.\n\n- **Account Management**\n  - Configure and manage accounts using mnemonic phrases or secret URIs.\n  - Set up and use a custom RPC URL for network interactions.\n  - Check account balances and view account details.\n\n- **Transactions**\n  - Send funds to any address on the network.\n\n## Installation\n\nTo install **PolkaCLI**, clone the repository and build the project using Cargo:\n\n```bash\ngit clone https://github.com/lovelaced/polkacli.git\ncd polkacli\ncargo build --release\n```\n\nEnsure you have Rust installed on your system. If not, you can install it from [rust-lang.org](https://www.rust-lang.org/).\n\n## Configuration\n\nBefore using PolkaCLI, configure your account and RPC URL:\n\n1. **Set Account**:\n   ```bash\n   polkacli set-account --mnemonic \"\u003cyour mnemonic here\u003e\"\n   ```\n   or\n   ```bash\n   polkacli set-account --secret-uri \"\u003cyour secret URI here\u003e\"\n   ```\n   This will save your account configuration to a local file in your home directory. WARNING: this currently saves the private key in plaintext.\n\n2. **Set RPC URL**:\n   ```bash\n   polkacli set-rpc \u003cyour rpc url\u003e\n   ```\n\n   This configures the RPC endpoint used for blockchain interactions. The default RPC is Paseo AssetHub provided by Dwellir.\n\n3. **Optional Pinata JWT**:\n   If you have a Pinata account and want to use it for pinning files to IPFS, you can add your Pinata JWT to the configuration file. This will enable PolkaCLI to pin files using your Pinata account instead of the default IPFS gateway.\n\n## Usage\n\n### NFT Minting Workflow\n\n*It is recommended to use [Pinata](https://pinata.cloud/) for pinning.*\nTo enable this, please add `pinata_jwt = \"yourJWTsecret\"` to `~/.polkacli/config`.\n\nWhen minting NFTs, PolkaCLI allows you to include metadata and images, either directly or inferred from filenames:\n\n- **--json `\u003cnft.json\u003e`**:\n  - If the `--json` argument is provided, the specified JSON file is loaded.\n  - If the JSON file already contains an `\"image\"` field, PolkaCLI will use the link in that field directly.\n  - If the `\"image\"` field is absent or empty, and you provide an image using `--image \u003cimage.jpg\u003e`, PolkaCLI will pin the specified image to IPFS and update the JSON file with the IPFS link.\n  - If no image is provided via `--image`, PolkaCLI will attempt to infer the image filename based on the JSON file's name (e.g., `nft.json` -\u003e `nft.jpg`).\n  - If no image is found or provided, the minting process will fail.\n\nAn example of valid NFT JSON is as follows:\n\n```json\n{\n  \"animation_url\": \"\",\n  \"attributes\": [\"rare\"],\n  \"description\": \"a cool nft\",\n  \"external_url\": \"https://my.nft.shop\",\n  \"image\": \"ipfs://Qmf4ECDXU4g4GDhAQQQpu6QpiE7GHJmmDvxGR1AeF4Atq3\",\n  \"name\": \"Edition 1\",\n  \"type\": \"image/png\"\n}\n```\n  \n- **--image `\u003cimage.jpg\u003e`**:\n  - If the `--image` argument is provided, the specified image file is pinned to IPFS, and its link is added to the JSON file.\n  - The `--json` argument is required when using `--image`. If not provided, the process will fail.\n\n### Commands\n\nHere is a summary of the available commands in PolkaCLI:\n\n#### NFT Commands\n\n- **mint-collection**:\n  - Mint a new NFT collection. Optionally provide JSON metadata and images.\n  - Example:\n    ```bash\n    polkacli mint-collection --json ./metadata --image ./images\n    ```\n\n- **mint-nft**:\n  - Mint a new NFT within an existing collection. Supports optional metadata and image file handling as described above.\n  - Example:\n    ```bash\n    polkacli mint-nft \u003ccollection_id\u003e \u003cnft_id\u003e --json nft.json --image nft.jpg\n    ```\n\n- **set-nft-metadata**:\n  - Set the metadata for an existing NFT within an existing collection. Supports metadata and image file handling as described above.\n  - Example:\n    ```bash\n    polkacli set-nft-metadata \u003ccollection_id\u003e \u003cnft_id\u003e --json nft.json --image nft.jpg\n    ```\n\n- **show-nft**:\n  - Display details of a specific NFT, including its JSON metadata and image if requested.\n  - Example:\n    ```bash\n    polkacli show-nft \u003ccollection_id\u003e \u003cnft_id\u003e --json --image\n    ```\n\n- **show-collection**:\n  - Retrieve and display details of a specific NFT collection.\n  - Example:\n    ```bash\n    polkacli show-collection \u003ccollection_id\u003e\n    ```\n\n#### Account and Transaction Commands\n\n- **set-account**:\n  - Configure the account to use with PolkaCLI, either via a mnemonic or secret URI.\n  - Example:\n    ```bash\n    polkacli set-account --mnemonic \"\u003cyour mnemonic here\u003e\"\n    ```\n\n- **set-rpc**:\n  - Set the RPC URL for blockchain interactions.\n  - Example:\n    ```bash\n    polkacli set-rpc \"\u003crpc url\u003e\"\n    ```\n\n- **send**:\n  - Send funds to a specified address.\n  - Example:\n    ```bash\n    polkacli send \u003caddress\u003e \u003camount\u003e\n    ```\n\n- **balance**:\n  - Check the balance of the configured account or another specified address.\n  - Example:\n    ```bash\n    polkacli balance [optional: \u003caddress\u003e]\n    ```\n\n- **account**:\n  - Retrieve information about an account using its public key.\n  - Example:\n    ```bash\n    polkacli account \u003cpublic_key\u003e\n    ```\n\n## Configuration File\n\nThe configuration file for PolkaCLI is stored in your home directory under `.polkacli/config`. This file stores the mnemonic, secret URI, RPC URL, and optionally, the Pinata JWT for IPFS pinning.\n\nYou can manually edit this file if necessary, or use the CLI commands to configure it.\n\n## Contributing\n\nContributions are welcome! If you find a bug or have a feature request, feel free to open an issue or submit a pull request.\n\n## License\n\nPolkaCLI is licensed under the Apache 2.0 License. See the `LICENSE` file for more details.\n\n---\n\n**Disclaimer**: PolkaCLI comes with no warranty. Use at your own risk. The authors are not responsible for any loss of funds or other damages resulting from the use of this tool.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flovelaced%2Fpolkacli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flovelaced%2Fpolkacli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flovelaced%2Fpolkacli/lists"}