{"id":30799376,"url":"https://github.com/triole/astrolaunch","last_synced_at":"2025-09-05T19:11:46.827Z","repository":{"id":256394924,"uuid":"850776676","full_name":"triole/astrolaunch","owner":"triole","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-10T07:54:30.000Z","size":48,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-10T08:19:39.314Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/triole.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,"zenodo":null}},"created_at":"2024-09-01T18:40:36.000Z","updated_at":"2025-06-10T07:54:34.000Z","dependencies_parsed_at":"2025-06-10T08:19:38.209Z","dependency_job_id":"6fbe1861-f7ee-4320-b138-98e593479131","html_url":"https://github.com/triole/astrolaunch","commit_stats":null,"previous_names":["triole/astrolaunch"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/triole/astrolaunch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/triole%2Fastrolaunch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/triole%2Fastrolaunch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/triole%2Fastrolaunch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/triole%2Fastrolaunch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/triole","download_url":"https://codeload.github.com/triole/astrolaunch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/triole%2Fastrolaunch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273806204,"owners_count":25171568,"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-05T02:00:09.113Z","response_time":402,"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-09-05T19:11:31.945Z","updated_at":"2025-09-05T19:11:46.817Z","avatar_url":"https://github.com/triole.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Astrolaunch ![build](https://github.com/triole/astrolaunch/actions/workflows/build.yaml/badge.svg) ![test](https://github.com/triole/astrolaunch/actions/workflows/test.yaml/badge.svg)\n\n## Synopsis\n\nAstrolaunch is able to run commands based on the position of the sun. It compares the time at which is is run with the events in the configured operations. If the run time equals the event considering the given range, the commands are run. It enables you to run stuff based on the sun's position so to say.\n\nAstrolaunch may get other event data in the future. For data listed below are available.\n\n```go mdox-exec=\"r calc -d 20240601\"\n{\n  \"time\": {\n    \"time\": \"2024-06-01T00:00:00Z\"\n  },\n  \"location\": {\n    \"lat\": 52.5200066,\n    \"lon\": 13.404954\n  },\n  \"sun\": {\n    \"dawn\": \"2024-06-01T04:03:10.163053568+02:00\",\n    \"dusk\": \"2024-06-01T22:08:15.888291328+02:00\",\n    \"golden_hour\": \"2024-06-01T20:26:13.681104128+02:00\",\n    \"golden_hour_end\": \"2024-06-01T05:45:12.370240768+02:00\",\n    \"nadir\": \"2024-06-01T01:05:43.025672448+02:00\",\n    \"nautical_dawn\": \"2024-06-01T02:49:58.605823488+02:00\",\n    \"nautical_dusk\": \"2024-06-01T23:21:27.445521152+02:00\",\n    \"night\": \"0001-01-01T00:53:28+00:53\",\n    \"night_end\": \"0001-01-01T00:53:28+00:53\",\n    \"solar_noon\": \"2024-06-01T13:05:43.025672448+02:00\",\n    \"sunrise\": \"2024-06-01T04:50:47.40565248+02:00\",\n    \"sunrise_end\": \"2024-06-01T04:55:18.451255552+02:00\",\n    \"sunset\": \"2024-06-01T21:20:38.64569216+02:00\",\n    \"sunset_start\": \"2024-06-01T21:16:07.600089344+02:00\"\n  },\n  \"moon\": {\n    \"rise\": \"2024-06-01T00:00:00Z\",\n    \"set\": \"2024-06-01T13:00:00Z\"\n  }\n}\n```\n\n## How to\n\nBesides from your `location` the `operations` that you would like to run are configured in a configuration file. Every `operation` has four attributes.\n\n| entry | explanation                                                |\n|-------|------------------------------------------------------------|\n| name  | operation name that will occur the logs                    |\n| at    | event at which the operation should be run                 |\n| range | time span in which the event is considered to be happening |\n| exec  | list of commands to execute                                |\n\n### At\n\nBasically works like a JSON selector referring to the astro data available. See above or run `astrolaunch -a` to see this set of data. Examples: sun.dawn, sun.nadir etc.\n\n### Range\n\nLet's say astrolaunch is run two minutes before `sun.dusk`. Only if `range` is at least these two minutes, operations that should run at `sun.dusk` will be executed. Range only accounts to the time before. If an event is over, nothing will be run. Use a string to define a time range. Examples: 1h, 30m, 120s etc.\n\n## Configurations\n\n## Main config\n\n```go mdox-exec=\"tail -n+2 example/conf.yaml\"\noperations_dir: \"{{.SELFDIR}}/operations\"\n\nlocation:\n  lat: 51.50808063275697\n  lon: -0.12806528535354245\n\ndefault_range:\n  pre: 2m\n  post: 10m\n```\n\n## Operations config\n\n```go mdox-exec=\"tail -n+2 example/operations/test1.yaml\"\nname: test\nat: sun.dawn\nrange:\n  pre: 2m\n  post: 4h\nexec:\n  - [\"date\"]\n  - [\"echo\", \"this is dawn\"]\n```\n\n## Usage examples\n\n```go mdox-exec=\"tail -n+3 example/usage.sh\"\n# calc diff and print\nastrolaunch calc -d 20241112\nastrolaunch calc -d 20241112 -r 3\n\n# execute command given as cli arg\nastrolaunch exec -a sun.dawn -p 1m -q 2h ls -la /tmp\nastrolaunch exec --log-level debug -w -a sun.dawn -p 1m -q 1m ls -la /tmp\n\n# process config file and run operations defined in there\nastrolaunch ops -f test\n```\n\n## Help\n\n```go mdox-exec=\"r -h\"\nUsage: astrolaunch \u003ccommand\u003e [flags]\n\nlaunch commands at sun rise, sun dawn or other astro related times\n\nFlags:\n  -h, --help                      Show context-sensitive help.\n  -c, --conf=\"/home/ole/.conf/astrolaunch/conf.yaml\"\n                                  path to config file\n      --log-file=\"/dev/stdout\"    log file\n      --log-level=\"info\"          log level\n      --log-no-colors             disable output colours, print plain text\n      --log-json                  enable json log, instead of text one\n  -n, --dry-run                   dry run, just print operations that would run\n  -V, --version-flag              display version\n\nCommands:\n  calc       print astro calculation for a certain date\n  exec       execute given command, if event trigger matches, exit if not\n  ops        load operations specified in config file and execute them or not\n  list       list available astro events\n  version    display version\n\nRun \"astrolaunch \u003ccommand\u003e --help\" for more information on a command.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftriole%2Fastrolaunch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftriole%2Fastrolaunch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftriole%2Fastrolaunch/lists"}