{"id":20669654,"url":"https://github.com/fox-one/mixin-cli","last_synced_at":"2025-04-19T18:13:11.746Z","repository":{"id":45877585,"uuid":"240761068","full_name":"fox-one/mixin-cli","owner":"fox-one","description":"Interactive command-line applications to manage mixin dapps","archived":false,"fork":false,"pushed_at":"2024-03-13T13:12:20.000Z","size":238,"stargazers_count":14,"open_issues_count":1,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-29T11:34:30.404Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","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/fox-one.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}},"created_at":"2020-02-15T17:48:37.000Z","updated_at":"2024-04-12T14:16:16.000Z","dependencies_parsed_at":"2023-12-04T04:22:39.420Z","dependency_job_id":"450a7830-e36e-4904-8f6e-88dfc952e294","html_url":"https://github.com/fox-one/mixin-cli","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fox-one%2Fmixin-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fox-one%2Fmixin-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fox-one%2Fmixin-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fox-one%2Fmixin-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fox-one","download_url":"https://codeload.github.com/fox-one/mixin-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249760150,"owners_count":21321843,"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-11-16T20:15:18.670Z","updated_at":"2025-04-19T18:13:11.725Z","avatar_url":"https://github.com/fox-one.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mixin-cli\nCommand-line applications to manage mixin dapps\n\n## Install\n\n### Go Install\n\n```bash\n$ go install github.com/fox-one/mixin-cli/v2@latest\n````\n\n### From Source Code\n\n```bash\n$ git clone git@github.com:fox-one/mixin-cli.git\n$ cd mixin-cli\n$ go install\n```\n\n## KeyStore\n\n### Format\n\n```json5\n{\n  \"client_id\": \"\",\n  \"session_id\": \"\",\n  \"private_key\": \"\",\n  \"pin_token\": \"\",\n  \"pin\": \"\", // optional\n}\n```\n\nThere are three ways to specify the keystore:\n\n1. Use the ```--file``` option to specify the keystore file path.\n2. Use ```--stdin``` option to read keystore content from os.Stdin.\n3. Use the name of keystore file in ```~/.mixin-cli```, for example, ```mixin-cli bot``` will use ~/.mixin-cli/bot.json.\n4. Use the ```--pin``` to specify the pin code.\n\n## Commands\n\n### List assets with balance\n\n```bash\n$ mixin-cli asset list\n\nAssetId                               Symbol  Name         Balance\n965e5c6e-434c-3fa9-b780-c50f43cd955c  CNB     Chui Niu Bi  9998898.552\nTotal USD Value: 0.09998898552\n```\n\n### Search asset with asset id or symbol\n\nsearch by asset id:\n```bash\n$ mixin-cli asset search 965e5c6e-434c-3fa9-b780-c50f43cd955c\n\nAssetId   965e5c6e-434c-3fa9-b780-c50f43cd955c\nSymbol    CNB\nName      Chui Niu Bi\nChainId   43d61dcd-e413-450d-80b8-101d5e903357\nPriceUsd  0.00000001\nIconUrl   https://mixin-images.zeromesh.net/0sQY63dDMkWTURkJVjowWY6Le4ICjAFuu3ANVyZA4uI3UdkbuOT5fjJUT82ArNYmZvVcxDXyNjxoOv0TAYbQTNKS=s128\n```\n\nsearch by asset symbol:\n```bash\n$ mixin-cli asset search BOX\n\nAssetId                               Symbol  Name       ChainId                               PriceUsd\nf5ef6b5d-cc5a-3d90-b2c0-a2fd386e7a3c  BOX     BOX Token  43d61dcd-e413-450d-80b8-101d5e903357  7.2782709\n2fea3c35-7fb7-3e01-91b1-99b3c744a729  BOX     BOX Token  43d61dcd-e413-450d-80b8-101d5e903357  0\n20b8c101-dffa-31c9-bf6e-d93a086686af  BOX     BOX Token  43d61dcd-e413-450d-80b8-101d5e903357  0\n```\n\n### Custom http request of mixin api\n\nget request with query:\n```bash\n# GET /users/25566?foo=bar\n$ mixin-cli http /users/25566 foo==bar\n\n{\n  \"type\": \"user\",\n  \"user_id\": \"fcb87491-4fa0-4c2f-b387-262b63cbc112\",\n  \"identity_number\": \"25566\",\n  \"phone\": \"\",\n  \"full_name\": \"人\",\n  \"biography\": \"Send me any transfer to start a conversation 💰\",\n  \"avatar_url\": \"https://mixin-images.zeromesh.net/MiGX1hgHm7cpLznNYlaxgPTcj8LisYjAUUwcmOrZcwBgIZqaAUSfeuirJ2hAcZES9y3T6dDy31ljbbD2dpJHaHFgn_kkXlAZm_o=s256\",\n  \"relationship\": \"FRIEND\",\n  \"mute_until\": \"2020-05-25T08:23:09.409520437Z\",\n  \"created_at\": \"2017-11-27T02:27:58.398423112Z\",\n  \"is_verified\": false,\n  \"is_scam\": false\n}\n```\n\npost request with simple body:\n```bash\n$ mixin-cli http post /attachments number:=1 foo=bar\n\n{\n  \"type\": \"attachment\",\n  \"attachment_id\": \"a3bde58a-4861-418b-860d-aa26a001ac7b\",\n  \"upload_url\": \"https://moments-shou-tv.s3.amazonaws.com/mixin/attachments/1638364433-4c67c4840fa610cb2570702a76c03fc79d46f29a8947bd24264fa624f2d51543?X-Amz-Algorithm=AWS4-HMAC-SHA256\\u0026X-Amz-Credential=AKIAJW6D5Q3Z5WYA2KRQ%2F20211201%2Fus-east-1%2Fs3%2Faws4_request\\u0026X-Amz-Date=20211201T131353Z\\u0026X-Amz-Expires=21600\\u0026X-Amz-SignedHeaders=content-type%3Bhost%3Bx-amz-acl\\u0026X-Amz-Signature=90d8e950f17b87af94010d24e6a35f89c5325d6373afe5cfc7fe451eb32babd2\",\n  \"view_url\": \"https://mixin-assets.zeromesh.net/mixin/attachments/1638364433-4c67c4840fa610cb2570702a76c03fc79d46f29a8947bd24264fa624f2d51543\",\n  \"created_at\": \"2021-12-01T13:13:53.756443264Z\"\n}\n```\n\npost request with raw json body\n```bash\n$ mixin-cli http post /attachments --raw '{\"foo\":\"bar\"}'\n\n{\n  \"type\": \"attachment\",\n  \"attachment_id\": \"db3e616e-8e91-4e08-b75c-890ad579649e\",\n  \"upload_url\": \"https://moments-shou-tv.s3.amazonaws.com/mixin/attachments/1638364537-9b603a75c11768e1193401048fcf5ae5f01fff97ef7eeca40ecc0908407e7788?X-Amz-Algorithm=AWS4-HMAC-SHA256\\u0026X-Amz-Credential=AKIAJW6D5Q3Z5WYA2KRQ%2F20211201%2Fus-east-1%2Fs3%2Faws4_request\\u0026X-Amz-Date=20211201T131537Z\\u0026X-Amz-Expires=21600\\u0026X-Amz-SignedHeaders=content-type%3Bhost%3Bx-amz-acl\\u0026X-Amz-Signature=4458a68e361c72f0ba17de9902ca4eddf407ea6dd89512c9bd7008100ae4ccc0\",\n  \"view_url\": \"https://mixin-assets.zeromesh.net/mixin/attachments/1638364537-9b603a75c11768e1193401048fcf5ae5f01fff97ef7eeca40ecc0908407e7788\",\n  \"created_at\": \"2021-12-01T13:15:37.515308839Z\"\n}\n```\n\n### Generate mixin auth token with custom path \u0026 expire duration\n\n```bash\n$ mixin-cli sign /fiats --exp 262800h\n\nsign GET /fiats with request id b1785af1-6974-4cbe-a8e0-4b1f6d4680ea \u0026 exp 262800h0m0s\n\neyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.eyJleHAiOjI1ODQ0NDQ2MzQsImlhdCI6MTYzODM2NDYzNCwianRpIjoiYjE3ODVhZjEtNjk3NC00Y2JlLWE4ZTAtNGIxZjZkNDY4MGVhIiwic2NwIjoiRlVMTCIsInNpZCI6ImRiMmYzMmJiLWYyYTUtNDJiMS1iOTQ2LTYzYTRlMTI5YjAyYyIsInNpZyI6ImNjNWY5ZjNlYjVmYTdlZWQ3NzlmZGYyMWQwNmY5MTQzYmNhMjNhNjEyZTE0M2E1YzFjZjhmZDQzNWFmNmEwYzEiLCJ1aWQiOiI1YzRmMzBhNi0xZjQ5LTQzYzMtYjM3Yi1jMDFhYWU1MTkxYWYifQ.LEQqG4Ae0I1ep-fabSGDM-ITfKrWjX21gTdQvFpnpAfbn_0N_m7vN3JIy453TMVKn6s7S0ngAYBfS0SuFxSvVPMYOMyvUnKadNVxgCWP9wu2DLRa_dzzJGzjLuvJStNnl7xk6HlKdRxFQ5xvGXe6MLijeaOOUuo6Sr2ceZ7tprk\n```\n\n### Transfer to any opponent\n\n```\n$ mixin-cli transfer --asset 965e5c6e-434c-3fa9-b780-c50f43cd955c \\\n --amount 100 \\\n --opponent 8017d200-7870-4b82-b53f-74bae1d2dad7 \\\n --memo hahaha\n\n{\n  \"snapshot_id\": \"fbc06508-1d8d-49cb-b17b-af7c1532e06c\",\n  \"created_at\": \"2021-12-01T13:20:34.81424Z\",\n  \"trace_id\": \"6e0e4349-8f30-4f18-96da-0f0264cf3149\",\n  \"asset_id\": \"965e5c6e-434c-3fa9-b780-c50f43cd955c\",\n  \"opponent_id\": \"8017d200-7870-4b82-b53f-74bae1d2dad7\",\n  \"amount\": \"-100\",\n  \"opening_balance\": \"9998898.552\",\n  \"closing_balance\": \"9998798.552\",\n  \"memo\": \"hahaha\",\n  \"type\": \"transfer\"\n}\n```\n\n### Transfer to a multisig group\n\n```bash\n$ mixin-cli transfer --asset 965e5c6e-434c-3fa9-b780-c50f43cd955c \\\n--amount 100 \\\n--receivers 8017d200-7870-4b82-b53f-74bae1d2dad7 \\\n--receivers 170e40f0-627f-4af2-acf5-0f25c009e523 \\\n--threshold 2 \\\n--memo hahaha\n\n{\n  \"type\": \"raw\",\n  \"snapshot\": \"\",\n  \"opponent_key\": \"\",\n  \"asset_id\": \"965e5c6e-434c-3fa9-b780-c50f43cd955c\",\n  \"amount\": \"-100\",\n  \"trace_id\": \"917ec61f-d703-472f-afd4-6f32c99ea8af\",\n  \"memo\": \"hahaha\",\n  \"state\": \"signed\",\n  \"created_at\": \"1970-01-01T00:03:39+00:03\",\n  \"transaction_hash\": \"941bd691338f8077cfe7edb53a0315c0299e514921f1af9964828629f413ee95\",\n  \"snapshot_at\": \"0001-01-01T00:00:00Z\"\n}\n```\n\n### Upload a file as attachment\n\n```bash\n$ mixin-cli upload ~/path/to/the/file\n\n# attachment id\n9b490939-9daf-4f09-8296-54f995f143d7\nhttps://mixin-assets.zeromesh.net/mixin/attachments/1638365395-614893646cab4f829ac6936ea57345bc27e6751f36e22b06dbbbd9df30c7c754\n```\n\n### Create a new user\n\n```bash\n$ mixin-cli user create haha --pin 123456\n\n{\n  \"client_id\": \"041d9a17-fb5d-33fb-9efc-182dcc68b58f\",\n  \"session_id\": \"b6a3430c-0b00-4bba-9f8f-555d0ef3c9c2\",\n  \"private_key\": \"DTev80bjzTas1kkSxYH34jQcjVc2FviMTaf3KrDtPIptz8...\",\n  \"pin_token\": \"BcuNLJHM5OdZ6UPcSaxNgsP8HHU873nJjlB+CEKFims=\",\n  \"scope\": \"\",\n  \"pin\": \"123456\"\n}\n```\n\n### Show own profile\n\n```bash\n$ mixin-cli user me\n\n{\n  \"user_id\": \"5c4f30a6-1f49-43c3-b37b-c01aae5191af\",\n  \"identity_number\": \"7000101692\",\n  \"phone\": \"5c4f30a6-1f49-43c3-b37b-c01aae5191af\",\n  \"full_name\": \"echo\",\n  \"biography\": \"我是群消息通知机器人 echo。\\r\\n群主拉我进群，开始使用吧！\",\n  \"avatar_url\": \"https://mixin-images.zeromesh.net/kQ4h_g2V8VRcl4DjqAhWJcthV4yEXl8Ytjrc8fx777LIA3ernaxU7UqcFolYKvWXJOtY7pkMG8NvKCtAhEJM3ptW=s256\",\n  \"relationship\": \"ME\",\n  \"mute_until\": \"0001-01-01T00:00:00Z\",\n  \"created_at\": \"2018-12-23T14:20:34.188140494Z\",\n  \"session_id\": \"db2f32bb-f2a5-42b1-b946-63a4e129b02c\",\n  \"code_id\": \"7d97440b-fb4f-4ddd-a74b-58d8806835e0\",\n  \"code_url\": \"https://mixin.one/codes/7d97440b-fb4f-4ddd-a74b-58d8806835e0\",\n  \"has_pin\": true,\n  \"receive_message_source\": \"EVERYBODY\",\n  \"accept_conversation_source\": \"EVERYBODY\",\n  \"accept_search_source\": \"EVERYBODY\",\n  \"fiat_currency\": \"USD\",\n  \"app\": {\n    \"updated_at\": \"2021-08-08T17:05:19.73808177Z\",\n    \"app_id\": \"5c4f30a6-1f49-43c3-b37b-c01aae5191af\",\n    \"app_number\": \"7000101692\",\n    \"redirect_uri\": \"https://ocean.one/auth\",\n    \"home_uri\": \"https://workflow.yiplee.com\",\n    \"name\": \"echo\",\n    \"icon_url\": \"https://mixin-images.zeromesh.net/6EoTjFGVMyPQJOz3JaCkGssmPbwLZviBEmLqmgXqLITQW_Q3DWiOAjmEHvGk8R53qebinHePo1Dq4ngTSD5fRw=s256\",\n    \"description\": \"我是群消息通知机器人 echo。\\r\\n群主拉我进群，开始使用吧！\",\n    \"capabilities\": [\n      \"GROUP\",\n      \"IMMERSIVE\",\n      \"CONTACT\"\n    ],\n    \"resource_patterns\": [],\n    \"category\": \"TOOLS\",\n    \"creator_id\": \"8017d200-7870-4b82-b53f-74bae1d2dad7\"\n  }\n}\n```\n\n### Search user by mixin id or identity number\n\n```bash\n$ mixin-cli user search 25566\n\n{\n  \"user_id\": \"fcb87491-4fa0-4c2f-b387-262b63cbc112\",\n  \"identity_number\": \"25566\",\n  \"full_name\": \"人\",\n  \"biography\": \"Send me any transfer to start a conversation 💰\",\n  \"avatar_url\": \"https://mixin-images.zeromesh.net/MiGX1hgHm7cpLznNYlaxgPTcj8LisYjAUUwcmOrZcwBgIZqaAUSfeuirJ2hAcZES9y3T6dDy31ljbbD2dpJHaHFgn_kkXlAZm_o=s256\",\n  \"relationship\": \"FRIEND\",\n  \"mute_until\": \"2020-05-25T08:23:09.409520437Z\",\n  \"created_at\": \"2017-11-27T02:27:58.398423112Z\"\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffox-one%2Fmixin-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffox-one%2Fmixin-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffox-one%2Fmixin-cli/lists"}