{"id":26432557,"url":"https://github.com/tlinden/watson-starship","last_synced_at":"2025-09-10T05:37:06.584Z","repository":{"id":281176787,"uuid":"944450988","full_name":"TLINDEN/watson-starship","owner":"TLINDEN","description":"Starship custom plugin","archived":false,"fork":false,"pushed_at":"2025-03-07T11:32:31.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T06:18:58.819Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TLINDEN.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,"publiccode":null,"codemeta":null}},"created_at":"2025-03-07T11:15:44.000Z","updated_at":"2025-03-07T11:32:34.000Z","dependencies_parsed_at":"2025-03-07T12:27:39.908Z","dependency_job_id":"dd0a93b9-6dec-48ba-8f21-9509c92a0bdd","html_url":"https://github.com/TLINDEN/watson-starship","commit_stats":null,"previous_names":["tlinden/watson-starship"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TLINDEN/watson-starship","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TLINDEN%2Fwatson-starship","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TLINDEN%2Fwatson-starship/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TLINDEN%2Fwatson-starship/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TLINDEN%2Fwatson-starship/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TLINDEN","download_url":"https://codeload.github.com/TLINDEN/watson-starship/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TLINDEN%2Fwatson-starship/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274417408,"owners_count":25281108,"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","status":"online","status_checked_at":"2025-09-10T02:00:12.551Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-03-18T06:19:00.180Z","updated_at":"2025-09-10T05:37:01.569Z","avatar_url":"https://github.com/TLINDEN.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# watson-starship\n\nA simple plugin for [Starship](https://github.com/starship/starship),\nwhich  shows the elapsed time of the current [watson](https://github.com/jazzband/Watson) project.\n\n## Why?\n\nUnfortunately `watson status` itself is  just too verbose. I only need\nthe hours elapsed. Manipulating the output were too slow, it lead to a partially hanging prompt.\n\nI tried several variants, among these:\n\n```toml\n# using sed\ncommand = \"watson status -e | sed -e 's/ ago//' -e 's/ seconds/s/' -e 's/ minutes/m/' -e 's/ hours/h/' -e 's/just now/0/'\"\n\n# use perl to parse the status file directly\ncommand = 'perl -n -e \"if (/start.: (\\d+)/) { \\$diff = (time - \\$1) / 3600; printf \\\"%.02fh\\n\\\", \\$diff; }\" \u003c ~/.config/watson/state'\n\n# use bash, date and https://github.com/TLINDEN/rpnc direclty on the status file\ncommand = 'if [[ \"$(grep start ~/.config/watson/state)\" =~ ([0-9]+) ]]; then echo $((\"$(date +%s)\" - \"${BASH_REMATCH[1]}\")) 3600 / | rpn; fi'\n```\n\nThis lille tool here is written  in go, reasonably fast, it parses the\nwatson JSON  status file directly,  calculates the elapsed  time since\nthe start of the running project and prints it. Pretty simple.\n\n## Setup\n\nYou'll need the Golang toolchain for this (version 1.23+).\n\nTo build:\n\n```shell\ngit clone https://github.com/TLINDEN/watson-starship.git\ncd watson-starship\nmake\nmake install\n```\n\nThen add this to your `~/.config/starship.toml`:\n\n```toml\n[custom.watson]\nwhen = \"watson status  -e | grep -v 'No project'\"\nstyle = \"green\"\ncommand = 'watson-starship'\nformat = '\\[[$output]($style)\\]'\n```\n\nAnd add `${custom.watson}\\` to your global `format` setting.\n\n## Getting help\n\nAlthough I'm happy to hear from watson-starship users in private email, that's the\nbest way for me to forget to do something.\n\nIn order to report a bug,  unexpected behavior, feature requests or to\nsubmit    a    patch,    please    open   an    issue    on    github:\nhttps://github.com/TLINDEN/watson-starship/issues.\n\n## Copyright and license\n\nThis software is licensed under the GNU GENERAL PUBLIC LICENSE version 3.\n\n## Authors\n\nT.v.Dein \u003ctom AT vondein DOT org\u003e\n\n## Project homepage\n\nhttps://github.com/TLINDEN/watson-starship\n\n## Copyright and License\n\nLicensed under the GNU GENERAL PUBLIC LICENSE version 3.\n\n## Author\n\nT.v.Dein \u003ctom AT vondein DOT org\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftlinden%2Fwatson-starship","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftlinden%2Fwatson-starship","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftlinden%2Fwatson-starship/lists"}