{"id":15427560,"url":"https://github.com/vrypan/fario","last_synced_at":"2025-04-19T15:27:14.016Z","repository":{"id":202809766,"uuid":"707860075","full_name":"vrypan/fario","owner":"vrypan","description":"Farcaster command-line tools","archived":false,"fork":false,"pushed_at":"2023-11-23T18:30:14.000Z","size":169,"stargazers_count":25,"open_issues_count":1,"forks_count":1,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-05-30T02:34:23.790Z","etag":null,"topics":["farcaster"],"latest_commit_sha":null,"homepage":"","language":"Python","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/vrypan.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-20T20:35:29.000Z","updated_at":"2024-04-09T12:48:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"fa6108fd-2cc3-4985-969e-376860ceca70","html_url":"https://github.com/vrypan/fario","commit_stats":null,"previous_names":["vrypan/fario"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vrypan%2Ffario","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vrypan%2Ffario/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vrypan%2Ffario/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vrypan%2Ffario/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vrypan","download_url":"https://codeload.github.com/vrypan/fario/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249726198,"owners_count":21316360,"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":["farcaster"],"created_at":"2024-10-01T18:00:46.712Z","updated_at":"2025-04-19T15:27:13.993Z","avatar_url":"https://github.com/vrypan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fario\n\nFarcaster command-line tools.\n\n**Warning: These scripts have not been tested extensively. Use them at your own risk!**\n\n# Installation\n\n## Using Homebrew (macOS)\n\n`fario` is still a \"tap\" (a third-party repository). This means that installing it **will\ncompile everything** and it will take some time, depending on your computer.\n\nThat said, you can try:\n\n- `brew tap vrypan/fario` to configure the tap.\n- `brew install fario` to install.\n\n## Using pip (python)\n\n`pip install fario`\n\n(Any help packaging these scripts as a brew recipe, apt package, etc., will be appreciated!)\n\nCommands: `fario-out`, `fario-in`, `fario-signers`, `fario-cast`, `fario-config`, `fario2json`, `json2fario`, `fario-id-byname`, `fario-account`.\n\nMost of these command will require you to have access to a Farcaster hub: [How to get access to a hub](HOWTO/How_to_get_access_to_a_hub.md).\n\n## After installing\n\nMost of the commands need a number of parameters (such as keys, fids, endpoints, etc.) and typing them again\nand agian is taxing. Run `fario-config make` to create a configuration. Save it to `~/.fario` and add the\nvalues you don't want to type every time.\n\n## Teaser\n\n`fario` has become quite powerful. Using with other cli tools available on a unix system, you can do things like this just using your terminal and a farcaster hub.\n\n  ```\n  fario-out --casts $(fario-fid-byname vrypan.eth) | \\\n  fario2json | \\\n  jq '.[].data.timestamp' | \\\n  sort -r | \\\n  xargs -L1 -I {} dc -e \"{} 1609459200 + p\"  | \\\n  xargs -L1 -I{}  date -r {} +\"%Y-%m\" | \\\n  uniq -c | \\\n  awk '{ print $2, $1}' | termgraph\n\n2023-10: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 282.00\n2023-09: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 271.00\n2023-08: ▇▇▇▇▇▇▇▇▇ 55.00\n2023-07: ▇▇▇▇ 24.00\n2023-06: ▇▇ 12.00\n2023-05: ▏ 4.00\n2023-04: ▇ 11.00\n2023-03: ▇▇▇▇▇▇ 39.00\n2023-02: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 85.00\n2023-01: ▇▇▇▇▇▇▇ 44.00\n2022-12: ▇ 9.00\n2022-11: ▇▇▇▇▇▇▇▇ 46.00\n2022-10: ▇▇▇▇▇▇▇▇▇▇▇▇ 72.00\n2022-09: ▇▇▇ 20.00\n2022-08: ▇▇▇▇ 26.00\n2022-07: ▇ 10.00\n```\n\nVisit the [HOWTO folder](HOWTO/) to learn more.\n\n# Data format\nMost of the scripts bellow pipe farcaster `Message` objects in and/or out. To make the payload command-line friendly, we serialize it and encode it using base64. So where \"`far` data\" is mentioned bellow, this is a protobuf Message converted like this: `base64(serialize(Message))`.\nSee: [Working with \"far\"-encoded data](HOWTO/Working_with_far_data_encoding.md).\n\n# fario-out\n\n`fario-out` is used to export data from a farcaster hub.\n\n```\nusage: fario-out [-h] [--version] [--casts] [--links] [--recasts] [--likes] [--inlinks] [--profile] [--all] [--limit LIMIT] [--hub HUB] [--wait WAIT] fid\n\nExport Farcaster data.\n\npositional arguments:\n  fid            Export messages from fid=FID\n\noptions:\n  -h, --help     show this help message and exit\n  --version      show program's version number and exit\n  --casts        User casts\n  --links        User links\n  --recasts      User recasts\n  --likes        User likes\n  --inlinks      Inbound links for user\n  --profile      User profile data\n  --all          Equivalent to --casts --links --recasts --likes --profile\n  --limit LIMIT  Number of records. If more than one types of data are exported, the limit applies to each one separately.\n  --hub HUB      Use the hub at \u003cHUB\u003e. Ex. --hub 192.168.1.1:2283\n  --wait WAIT    Wait for \u003cWAIT\u003e milliseconds between reads.\n```\n\nExample:\n\n```\nfario-out --casts --limit=3 280\n\nCqUBCAEQmAIYhOWVKiABKpYBGhkIiDMSFFjk62TSNRH2rMWwEezWa3Xb33x2IktBZ3JlZSEgSGVyZSBpcyBvbmUgdGFrZSBvbiB0aGlzLiBodHRwczovL3dhcnBjYXN0LmNvbS92cnlwYW4uZXRoLzB4ODI3Njc0NzEyLAoqaHR0cHM6Ly93YXJwY2FzdC5jb20vdnJ5cGFuLmV0aC8weDgyNzY3NDcxEhTILBREMcmuwueQCDk9x61xVV1tMhgBIkCWEPcLABM+JJ8BM+BneFimHlbUpwfB0F6MqmQzKkMN++raovDlVrUzUcvoxggyHjBZV3UbXXMhKpjvwZ6jdf0JKAEyIGojm0P59c/uG4Is6+7zhoo5SXFmMNoxXWaWWNDLn59I\nCpIDCAEQmAIYzNqVKiABKoMDEgEBIq8CQSBjb29sIGZlYXR1cmUgb2YgdGhlIEZhcmNhc3RlciBwcm90b2NvbCBpcyB0aGF0IHlvdSBjYW4gdXNlIGl0IG9mZi1saW5lISEhCgpXaGF0IEkgbWVhbjogWW91IGNhbiBjcmVhdGUgeW91ciBjYXN0cyBvZmYtbGluZSwgc3RvcmUgdGhlbSBpbiBhbiBhcHAsIGFuZCB3aGVuIHlvdSBhcmUgY29ubmVjdGVkLCBhbmQgdGhlIGFwcCBjYW4gc2VuZCB0aGVtIHRvIHRoZSBuZXR3b3JrICh3aXRoIGNvcnJlY3QgY3JlYXRpb24gdGltZXN0YW1wKS4gU2FtZSBmb3IgbGlrZXMsIHJlY2FzdHMsIGV0Yy4KCldoZW4gIGFpcnBsYW5lIG1vZGU/KgKgAjpIY2hhaW46Ly9laXAxNTU6Nzc3Nzc3Ny9lcmM3MjE6MHg0Zjg2MTEzZmMzZTk3ODNjZjNlYzlhNTUyY2JiNTY2NzE2YTU3NjI4EhSpd9GxFia8jwlXEaRJG27wsJlBNxgBIkA8jGq404X1287WN8p3Aswq+p/CuBEBzpnuHtLg6Oo7NWVuwLThb728I4t0fJTWoCh/OSPK1jr2bTrh7dI1Ft4DKAEyIGojm0P59c/uG4Is6+7zhoo5SXFmMNoxXWaWWNDLn59I\nCr8BCAEQmAIYr7mUKiABKrABGhgICBIUe0F3y5CCsYTflRJCWGEDmXqAk4QikwFJJ20gbW9yZSBpbnRlcmVzdGVkIGluIGRldiBzdHVmZi4gQVBJcywgbmV3IGNvbnRyYWN0cywgZXRjLiBUaGlua3MgSSBjb3VsZCB1c2UgdG8gYnVpbGQgb24gdG9wL3dpdGggWm9yYSBpbmZyYXN0cnVjdHVyZS4gUHJvZHVjdCBhbm5vdW5jZW1lbnRzIHRvby4SFKAZaHILx+EzYryjBDsSoGG2S3/eGAEiQEOQGEt1NjWdIQbISDElhoa5lvV/Pl2MYaVgfnTMrQl3NThLgxNHHG5xdY2x94VkgS7ApU7F4x4IcRLfK6N8jgUoATIgaiObQ/n1z+4bgizr7vOGijlJcWYw2jFdZpZY0Mufn0g=\n```\n\nThe result is 3 lines of text. Each line is the corresponding farcaster message serialized and base64 encoded.\n\nIt is easy to decode a message using `fario2json`.\n\n```\necho \"CqUBCAEQmAIYhOWVKiABKpYBGhkIiDMSFFjk62TSNRH2rMWwEezWa3Xb33x2IktBZ3JlZSEgSGVyZSBpcyBvbmUgdGFrZSBvbiB0aGlzLiBodHRwczovL3dhcnBjYXN0LmNvbS92cnlwYW4uZXRoLzB4ODI3Njc0NzEyLAoqaHR0cHM6Ly93YXJwY2FzdC5jb20vdnJ5cGFuLmV0aC8weDgyNzY3NDcxEhTILBREMcmuwueQCDk9x61xVV1tMhgBIkCWEPcLABM+JJ8BM+BneFimHlbUpwfB0F6MqmQzKkMN++raovDlVrUzUcvoxggyHjBZV3UbXXMhKpjvwZ6jdf0JKAEyIGojm0P59c/uG4Is6+7zhoo5SXFmMNoxXWaWWNDLn59I\" | ./fario2json | jq\n[\n  {\n    \"data\": {\n      \"type\": 1,\n      \"fid\": 280,\n      \"timestamp\": 88437380,\n      \"network\": 1,\n      \"cast_add_body\": {\n        \"parent_cast_id\": {\n          \"fid\": 6536,\n          \"hash\": \"0x58e4eb64d23511f6acc5b011ecd66b75dbdf7c76\"\n        },\n        \"text\": \"Agree! Here is one take on this. https://warpcast.com/vrypan.eth/0x82767471\",\n        \"embeds\": [\n          {\n            \"url\": \"https://warpcast.com/vrypan.eth/0x82767471\"\n          }\n        ]\n      }\n    },\n    \"hash\": \"0xc82c144431c9aec2e79008393dc7ad71555d6d32\",\n    \"hash_scheme\": 1,\n    \"signature\": \"0x9610f70b00133e249f0133e0677858a61e56d4a707c1d05e8caa64332a430dfbeadaa2f0e556b53351cbe8c608321e305957751b5d73212a98efc19ea375fd09\",\n    \"signature_scheme\": 1,\n    \"signer\": \"0x6a239b43f9f5cfee1b822cebeef3868a3949716630da315d669658d0cb9f9f48\"\n  }\n]\n```\n\nTry: `fario-out --all --limit=5 2 | fario2json | jq`\n\n# fario-in\n\n`fario-in` is used to post data (messages) to a farcaster hub. Input is read from stdin and it is expected to be base64 encoded serialized protobuf messages, like the ones exported by `fario-out`.\n\n```\nfario-in --help\n\nusage: fario-in [-h] [--version] [--hub HUB] [--wait WAIT]\n\nSend messages to Farcaster hub.\n\noptions:\n  -h, --help   show this help message and exit\n  --version    show program's version number and exit\n  --hub HUB    Use the hub at \u003cHUB\u003e. Ex. --hub 192.168.1.1:2283\n  --wait WAIT  Wait for \u003cWAIT\u003e milliseconds between message submissions.\n```\n\n# fario-signers\n\nAdd, remove, list signers and sign farcaster messages.\n\n```\nfario-signers --help\n\nusage: fario-signers [-h] [--version] [--raw] {add,remove,list,sign} ...\n\npositional arguments:\n  {add,remove,list,sign}\n\noptions:\n  -h, --help            show this help message and exit\n  --version             show program's version number and exit\n  --raw                 Output raw values, tab separated.\n```\n## fario-signers add\n\nCreate a new signer for an application and approve it using a user's private key.\n\n```\nfario-signers add --help\n\nusage: fario-signers add [-h] [--provider PROVIDER] [--user-fid USER_FID] [--user-key USER_KEY] [--app-fid APP_FID] [--app-key APP_KEY]\n\nCreate a new signer. Using --raw will output tx_hash, user_fis, app_fid, signer_bublic_key, signer_private_key as a tab-separated list.\n\noptions:\n  -h, --help           show this help message and exit\n  --provider PROVIDER  OP Eth provider endpoint\n  --user-fid USER_FID  User's fid.\n  --user-key USER_KEY  User's private key in hex.\n  --app-fid APP_FID    Application's fid.\n  --app-key APP_KEY    Application's private key in hex.\n```\n\n## fario-signers remove\n\nRemove a signer already approved by a user.\n\n```\nfario-signers remove --help\n\nusage: fario-signers remove [-h] [--op_eth_provider OP_ETH_PROVIDER] [--user-key USER_KEY] signer\n\nRemove a signer. Using --raw will output only the tx_hash.\n\npositional arguments:\n  signer                Signer's public key in hex.\n\noptions:\n  -h, --help            show this help message and exit\n  --op_eth_provider OP_ETH_PROVIDER\n                        OP Eth provider endpoint\n  --user-key USER_KEY   User's private key in hex.\n  ```\n\n## fario-signers sign\n\nIt reads messages in \"far\" format from stdin, signs them using a new signer, and outputs them in `far` format to stdout.\n\n```\nfario-signers sign --help\n\nusage: fario-signers sign [-h] [--signer SIGNER] [--keep-hash]\n\nRead messages and sign (or re-sign) using a new signer. Reads from stdin, writes to stdout. In and out are in fario format.\n\noptions:\n  -h, --help       show this help message and exit\n  --signer SIGNER  Signer's private key\n  --keep-hash      Do not change the message hash.\n```\n\nExample:\nCompare the output (hashes, signers and signatures) of the following commands:\n\n1. ```fario-out --casts --limit=5 280 | fario2json | jq```\n2. ```fario-out --casts --limit=5 280 | fario-signers sign \u003ckey\u003e | fario2json```\n\nYou could pipe the output of `fario-signers sign` to `fario-in` to post the new messages to a hub. \n\nPosting these messages to a hub can fail for various reasons:\n1. Message hash is already posted. (i.e. you can repost the same message, even if the signature is changed)\n2. Signer is not approved by the user: You can't post messages from an `fid` that has not approved the signer.\n3. Message deleted: in many cases, deleting a cast leaves a \"remove\" message on the hubs, containing the removed messages hash. You can't post a new message with the same hash.\n\n**VERY INTERESTING USE CASE**\n\nHowever, you can use `fario-out` to backup your content, remove a signer (which results in all mesages signed by it to be removed!), then use `fario-signers sign` and `fario-in` to re-sign them with a new signer and upload them to farcaster!\n\n## fario-account\n\nDisplays detailed information about an fid.\n\n```\nusage: fario-account [-h] [--version] [--raw] [--hub HUB] [--fid] [--fname] [--name] [--addr] [--storage-rent] [--storage-limits] [--storage-usage] [--recovery] [--all] {byfid,byname} ...\n\npositional arguments:\n  {byfid,byname,fromsecret}\n\noptions:\n  -h, --help        show this help message and exit\n  --version         show program's version number and exit\n  --raw             Output raw values, tab separated.\n  --hub HUB         Use the hub at \u003cHUB\u003e. Ex. --hub 192.168.1.1:2283\n  --fid             Print fid\n  --fname           Print fname\n  --name            Print name\n  --addr            Print custody address\n  --storage-rent    Print storage rent events\n  --storage-limits  Print storage limits\n  --storage-usage   Print storage usage\n  --recovery        Print recovery address\n  --all             Print all available information\n```\n\nExample\n\n```\n$ fario-account --all byname dwr\n\naddress         0x6b0bda3f2ffed5efc83fa8c024acff1dd45793f1\nfname           dwr\nname            dwr.eth\n\nStorage Units Rented\n====================\nUnits           Date                Paid by\n2               2024-08-29T01:23:13 0x00000000fc94856f3967b047325f88d47bc225d0\n10              2024-09-19T00:02:45 0xd7029bdea1c17493893aafe29aad69ef892b8ff2\n1               2024-10-08T21:03:49 0x2d93c2f74b2c4697f9ea85d0450148aa45d4d5a2\n\nCurrent Storage Limits\n======================\ncasts           65000\nlinks           32500\nreactions       32500\nuser_data       650\nusername_proofs 65\nverifications   325\n\nCurrent Usage\n=============\ncasts           15115\nlinks           2684\nlikes           16467\nrecasts         2001\nuser_data       4\nproofs          3\nverifications   4\n```\n\n## fario-account fromsecret\n\n`fario-account fromsecret` will ask for your secret phrase (\"seed\", \"mnemonic\") and will calculate\nyour custody wallet private key.\n\nUnlike other commands in `fario`, this command DOES NOT read from stdin, but will prompt the user.\nThis is done on purpose to avoid leaving traces of your seed phrase in shell history, and also to\ndiscourage using this command as part of automated flows where the user is expected to use their\nseed phrase.\n\n```\n$ fario-account fromsecret \n\n=== DANGER!!! ===\nRevealing your secret phrase (seed or mnemonic) to someone, gives\nthem full control over your Farcaster account, including the ability\nto move your fid to an other wallet!\n\nThis script will calculate your privet key using your secret phrase.\nThis script runs locally and does not send ANY data to any third party.\n\nDo your own research before trusting anyone with your account's key\nor mnemonic. This includes this script too.\n\n\nEnter secret phrase:\n```\n\n# Other commands\n\n- `fario-cast`: cast plain text messages (no mentions, or embeds).\n- `fario-fid-byname`: Get a username's fid\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvrypan%2Ffario","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvrypan%2Ffario","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvrypan%2Ffario/lists"}