{"id":13565560,"url":"https://github.com/digitalbazaar/did-cli","last_synced_at":"2025-05-05T18:25:37.990Z","repository":{"id":45194927,"uuid":"104657881","full_name":"digitalbazaar/did-cli","owner":"digitalbazaar","description":"A client for managing Decentralized Identifiers","archived":false,"fork":false,"pushed_at":"2022-03-30T19:34:30.000Z","size":265,"stargazers_count":43,"open_issues_count":9,"forks_count":10,"subscribers_count":16,"default_branch":"main","last_synced_at":"2024-09-19T01:12:06.384Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/digitalbazaar.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-24T16:11:44.000Z","updated_at":"2024-01-07T07:39:49.000Z","dependencies_parsed_at":"2022-09-07T01:13:05.678Z","dependency_job_id":null,"html_url":"https://github.com/digitalbazaar/did-cli","commit_stats":null,"previous_names":["digitalbazaar/did-client"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalbazaar%2Fdid-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalbazaar%2Fdid-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalbazaar%2Fdid-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalbazaar%2Fdid-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/digitalbazaar","download_url":"https://codeload.github.com/digitalbazaar/did-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223057818,"owners_count":17080823,"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":[],"created_at":"2024-08-01T13:01:50.147Z","updated_at":"2024-11-04T19:31:09.018Z","avatar_url":"https://github.com/digitalbazaar.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Decentralized Identifier client CLI _(did-cli)_\n\n\u003e A command-line client for managing Decentralized Identifiers.\n\n * [Quickstart](#quickstart)\n * [Installation](#installation)\n * [Usage](#usage)\n   * [General](#general)\n   * [Generate a DID](#generate-a-did)\n   * [Register on a Ledger](#register-on-a-ledger)\n   * [DID Information](#did-information)\n   * [Notes](#notes)\n   * [Key Management](#key-management)\n * [Examples](#examples)\n * [Roadmap](#roadmap)\n * [Support](#support)\n\n## Quickstart\n\nThe current client supports the creation of Testnet DIDs on the Veres One\nledger as well as the retrieval of those DIDs from the Testnet. You can try the\ntool out by doing the following commands on a system that has node.js installed:\n\n    npm install did-cli\n    cd node_modules/did-cli\n    ./did generate -r\n\nTo retrieve the freshly generated DID:\n\n    ./did info \u003cDID\u003e\n\nBy default, keys and DID Documents will be stored in `~/.dids/\u003cmethod\u003e/\u003cmode\u003e/`,\nsee [Setting Up Storage](STORAGE.md) for more details.\n\n## Installation\n\n### Requirements\n\n* Linux or Mac OS X\n* Node.js \u003e= 8.6.x\n* npm \u003e= 3.x\n\n### Install\n\nInstall in a development directory:\n\n    npm install did-cli\n    ./node_modules/.bin/did ...\n\nInstall globally:\n\n    npm install -g did-cli\n    did ...\n\nRun from npx:\n\n    npx did-cli ...\n\n### Developing\n\nTo download the source and install the client:\n\n    git clone https://github.com/digitalbazaar/did-cli.git\n    cd did-cli\n    npm install\n    ./did ...\n\n## Usage\n\n### General\n\nThe `did` command has many commands and options.  Help is available with the\n`--help/-h` command line option:\n\n    did -h\n    did COMMAND -h\n\nCommands can be more verbose with one ore more `--verbose/-v` options, or\nquieted more than the default with `--quiet/-q`:\n\n    did COMMAND -v ...\n    did COMMAND -vv ...\n    did COMMAND -q ...\n\nCopies of registered DIDs, keys, and metadata are all stored in your \n`$HOME/.dids/` directory.\n\nRemote commands operate on a ledger.  Various ledgers may be available.  They\ncan be selected with the `--ledger/-l` option which defaults to `veres`.\n\n    did COMMAND -l LEDGER ...\n\nRemote ledger commands also have a \"live\", \"test\", or \"dev\" mode selected with\n`--mode/-m` which defaults to `test`:\n\n    did COMMAND -m MODE ...\n\nThe combination of ledger and mode options will select the default hostnames to\nconnect to.  Specific hostnames can be selected with `--hostname/-H`:\n\n    did COMMAND -l example -m test -H host1.example.com ...\n\n### Generate a DID\n\nA DID is generated locally with the `generate` command:\n\n    did generate\n\nOther options:\n\n* `--passphrase/-p PASSPHRASE`: set a key passphrase\n* `--type/-t TYPE`: set key type (ex: `ed25519` or `rsa`)\n* `--name NAME`: set a private name [note](#notes)\n* `--description DESCRIPTION`: set a private description [note](#notes)\n* `--register/-r`: register on a ledger\n\n### Register on a Ledger\n\nBy default `generate` will only store a DID locally.  If you want to also\nimmediately register it to the default Veres One testnet ledger:\n\n    did generate -r\n\nYou can register local DIDs to a ledger with the `register` command:\n\n    did register DID\n\nSome ledgers may require DID authorization (this topic is outside of the scope\nof this tool).  You can specify an authorization DID key with `--auth/-a`:\n\n    did register DID -a AUTHDID\n\nSome ledgers may require proof-of-work to accept a DID request.  Others may\nallow \"accelerators\" to be used.  These are specified with `--accelerator/-A`\nand require an authorization DID:\n\n    did register DID -a AUTHDID -A ACCELERATORHOSTNAME\n\n### DID Information\n\nPending (created but not registered) and registered DIDs can be listed with the \n`list` command:\n\n    did list\n\nInformation on a DID can be found with the `info` command:\n\n    did info DID\n\n### Notes\n\nIt can be useful to store **private** local notes about DIDs which are\notherwise somewhat opaque identifiers.  The `notes` command adds this ability\nwith simple key/value pairs.\n\nAll notes for all DIDs can be shown with:\n\n    did notes\n\nNotes for specific DID can be shown:\n\n    did notes DID\n\nVarious notes operations are available:\n\n* `--clear`: remove all notes\n* `--add KEY VALUE`: append VALUE to an array for KEY\n* `--remove`: remove VALUE from array for KEY\n* `--get KEY`: get KEY value\n* `--set KEY VALUE`: set single VALUE for KEY\n* `--delete`: delete all values for KEY\n* `--find KEY VALUE`: find DIDs with VALUE set for KEY\n\nIf a DID is not specified the commands will operate on *all* DIDs.  As this can\nbe dangerous, any operation with operates on many DIDs must use the `--all`\noption.\n\n    did notes --delete old-property --all\n\nYou can choose any KEY values you wish, although simple strings will be easiest\nto use.  The `generate` and `register` commands have an \"auto\" feature to write\nsome notes.  The \"name\" note is useful to assign simple names to DIDs.  The\n\"ledger\" note is useful to keep track of where DIDs have been sent.\n\n    $ did notes did:example:test:1234 --set name shortname\n    $ did notes did:example:test:1234 --get name\n    did:example:test:1234 name\n    $ did notes --find name shortname\n    did:example:test:1234\n\n    $ did notes did:example:test:A --add url https://example.com/\n    $ did notes did:example:test:B --add url https://example.com/\n    $ did notes did:example:test:C --add url https://example.org/\n    $ did notes --find url https://example.com/\n    did:example:test:A\n    did:example:test:B\n    $ did notes --get url\n    did:example:test:A url https://example.com/\n    did:example:test:B url https://example.com/\n    did:example:test:C url https://example.org/\n\nThe notes data is stored in the `config.jsonld` file in your local DID dir.  It\ncan be freely edited as needed.  **Warning**: This file is *not* currently safe\nto write to concurrently!\n\n### Key Management\n\nA DID has a number of application suite parameters that can store keys.  Keys\nare managed with the with the `authn-*` commands.  To inspect the keys use\n`info`:\n\n    # show the DID JSON including keys\n    did info did:example:1234\n\n    # show more readable summary\n    did info did:example:1234 -f human\n\n    # show summary with public keys\n    did info did:example:1234 -f human --public-key\n\n    # show local summary with private keys\n    did info did:example:1234 -f human -L local --private-key\n\nKey material can be added with `ed25519-key-add`.  A unique cryptonym key id\nwill be generated.  Note that the updates will be automatically\nregistered on the ledger unless `--no-register` is provided:\n\n    # add a public and private key\n    did ed25519-key-add did:example:1234 -p authentication --pub PUBLICKEYINFO \\\n    --pvt PRIVATEKEYINFO\n\n## Examples\n\nBasic generate and check DID is on ledger:\n\n    # generate and register on ledger\n    did generate -r # generate and register on ledger\n    # wait a few moments\n    # ...\n    did info DID\n\nMore extreme checking if ledger has details of multiple hosts. As of this\nwriting, Veres One has multiple testnet hosts hardcoded, but you can specify\nyour own with multiple `-H` options:\n\n    # generate and register on ledger\n    did generate -r # generate and register to ledger\n    did info DID\n\nDepending on the ledger, you may be able to see consensus happening after a\ngenerate:\n\n    # start a retry loop, see info --help for other options\n    did info DID -f found -L all --retry\n\nUse an accelerator to register a DID faster. This assumes you have registered\n`did:ex:my-did` at the accelerator:\n\n    did generate -r -a did:ex:test:my-did -A accelerator.example.com\n\nSplit creation and later register to multiple ledgers (because you are an\nexpert and have solid reasons for doing this):\n\n    # generate with a private name, do not register\n    did generate --name my-did\n    # ... time passes\n    # ...\n    # ... grrr, I forgot the long DID name\n    did list\n    ... many many DIDs ...\n    # hmm... lots of random DID names, which one is it?\n    did notes --get name\n    ... many other DIDs with names ...\n    did:example:test:1234 name my-did\n    # ah! there it is!\n    # register on a ledger\n    did register did:example:test:1234\n    # i'd like to use on other ledgers too\n    did register -H ledger2.example.com did:example:test:1234\n\nShow which DIDs have a note about being on a ledger:\n\n    did notes --get ledger\n\nTips and tricks:\n\n    # reload DIDs on a dev ledger after a wipe\n    did notes --find ledger veres:dev | xargs -I {} did register -m dev {}\n    # alternative\n    for d in `did notes --find ledger veres:dev`; do did register -m dev $did; done\n\n## Roadmap\n\nThere are plans to support the following other commands and features:\n\n  * Rotating authentication credentials\n  * Adding and removing authorization capability descriptions\n  * Adding and removing service descriptions\n  * Checking the validity of a DID (deep blockchain check)\n\n## Support\n\nBugs, suggestions, requests, and code issues:\n\n  * https://github.com/digitalbazaar/did-cli/issues\n\nCommercial support is available upon request from [Digital Bazaar][]:\n\n  * support@digitalbazaar.com\n\n[Digital Bazaar]: https://digitalbazaar.com/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalbazaar%2Fdid-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdigitalbazaar%2Fdid-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalbazaar%2Fdid-cli/lists"}