{"id":13522449,"url":"https://github.com/franckverrot/trek","last_synced_at":"2025-05-07T03:24:24.591Z","repository":{"id":57657653,"uuid":"164382272","full_name":"franckverrot/trek","owner":"franckverrot","description":"Trek is a CLI/ncurses explorer for HashiCorp Nomad clusters.","archived":false,"fork":false,"pushed_at":"2023-08-30T14:01:00.000Z","size":136,"stargazers_count":33,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-27T11:02:54.071Z","etag":null,"topics":["command-line","command-line-tool","distributed-systems","docker","go","golang","hashicorp","hashicorp-nomad","ncurses","nomad"],"latest_commit_sha":null,"homepage":"","language":"Go","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/franckverrot.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":"2019-01-07T05:24:38.000Z","updated_at":"2024-08-04T04:56:15.000Z","dependencies_parsed_at":"2024-06-20T00:19:52.397Z","dependency_job_id":"8807d2a9-3c66-484b-bbdb-3128c760200b","html_url":"https://github.com/franckverrot/trek","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franckverrot%2Ftrek","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franckverrot%2Ftrek/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franckverrot%2Ftrek/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franckverrot%2Ftrek/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/franckverrot","download_url":"https://codeload.github.com/franckverrot/trek/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252805157,"owners_count":21806936,"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":["command-line","command-line-tool","distributed-systems","docker","go","golang","hashicorp","hashicorp-nomad","ncurses","nomad"],"created_at":"2024-08-01T06:00:47.414Z","updated_at":"2025-05-07T03:24:24.568Z","avatar_url":"https://github.com/franckverrot.png","language":"Go","funding_links":[],"categories":["Table of Contents","\u003ca name=\"system\"\u003e\u003c/a\u003eSystem tools","Infrastructure setup"],"sub_categories":["Tools and Utilities"],"readme":"# Trek\n\nTrek is a CLI/ncurses explorer for [HashiCorp Nomad][nomad-url] clusters.\n\n![In Action](https://raw.githubusercontent.com/franckverrot/trek/master/assets/jan-15-screenshot.png)\n\n\n## SETUP\n\n### Binary Release\n\nGet to revisions, and download a binary.\n\n### From Source\n\n    git clone https://github.com/franckverrot/trek.git\n    cd trek\n    make trek\n\n\n## USAGE\n\n\n*TL;DR* Start `./trek -help` to get the usage prompt.\n\n\n### CLI\n\nThe CLI can be used without a UI. This allows scripting to access IP, ports,\nand other info exposed by Nomad.\n\n#### Options\n\nHere's a list of options available:\n\n\u003ca name=\"nomad-address\"\u003e\u003c/a\u003e\n* `nomad-address`: address of the nomad cluster\n\n\u003ca name=\"list-jobs\"\u003e\u003c/a\u003e\n* `list-jobs`: list jobs running on the cluster\n\n```\nλ ./trek -list-jobs\n* example\n* example34\n```\n\n*NOTE* : this option also works in conjunction with [`display-format`](#display-format)\n\n\n\u003ca name=\"job\"\u003e\u003c/a\u003e\n* `job`: select a specific job\n\n```\nλ trek -job example34\n* cache34\n* cache56\n```\n\n\u003ca name=\"task-group\"\u003e\u003c/a\u003e\n* `task-group`: select a specific task group\n\n```\nλ trek -job example34 -task-group cache56\n* example34.cache56[0]\n```\n\n\u003ca name=\"allocation\"\u003e\u003c/a\u003e\n* `allocation`: select a specific allocation number\n\n```\nλ trek -job example34 -task-group cache56 -allocation 0\n(0) redis5\n(1) redis6\n```\n\n\u003ca name=\"task-name\"\u003e\u003c/a\u003e\n* `task-name`: select a specific task name\n\n```\nλ trek -job example34 -task-group cache56 -allocation 0 -task-name redis6\n* Name: redis6\n* Node Name: feynman.local\n* Node IP: 127.0.0.1\n* Driver: docker\n        * image: redis:3.2\n        * port_map: [map[db:6379]]\n* Dynamic Ports: 24832 (db)\n```\n\n\u003ca name=\"display-format\"\u003e\u003c/a\u003e\n* `display-format`: Use the [Go templating language][go-templating] to format output when describing a specific job, task group, allocation or task\n  * Context-specific data made available:\n    * Job\n      * `TaskGroups` (array of task groups): task groups part of the job definition\n    * Task Group\n      * `Allocations` (array of allocations): allocations run by that task group\n    * Allocation\n      * `IP` (string): node onto which we're running the selected allocation\n      * `Tasks` (array of tasks): tasks being run by that allocation\n    * Task\n      * `IP` (string): node onto which we're running the selected task\n      * `Network`: network information (like ports)\n      * `Environment`: environment variables provided to the task\n  * Available functions:\n    * `{{Debug \u003cx\u003e}}` : show raw representation of the data `\u003cx\u003e`\n    * `{{DebugAll}}` : show raw representation of everything provided to the template\n  * Examples:\n\n```\nλ trek -job example34 -task-group cache56 -allocation 0 -task-name redis6 -display-format \"{{DebugAll}}\"\nDEBUG ALL: {IP:127.0.0.1 Network:{Ports:map[db:{Value:23109 Reserved:false}]} Environment:map[FOO_BAR:{Value:baz_bat}]}\n\nλ trek -job example34 -task-group cache56 -allocation 0 -task-name redis6 -display-format \"{{Debug .Environment}}\"\nDEBUG: map[FOO_BAR:{Value:baz_bat}]\n\nλ trek -job example34 -task-group cache56 -allocation 0 -task redis6 -display-format \"{{range .Network.Ports}}{{$.IP}}:{{.Value}}{{println}}{{end}}\"\n127.0.0.1:31478\n127.0.0.1:25142\n```\n\n\n\n### ncurses UI\n\n    ./trek -ui=true\n\n\n### Trek Configuration File\n\n#### Example\n\n```\n{ \"Environments\" : [ { \"Name\" : \"development\" , \"Address\" : \"http://127.0.0.1:4646\" }\n                   ]\n}\n```\n\n#### Options\n\n  * `Environments`: List of environments (given a name and address) Trek can connect to\n\n\n## FAQ\n\n* How do I ssh into an allocation's node?\n\n    λ ssh $(trek -job ... -task-group ... -allocation 0  -display-format \"{{.IP}}\")\n\n\n## Note on Patches/Pull Requests\n\n* Fork the project.\n* Make your feature addition or bug fix.\n* Add tests for it. This is important so I don't break it in a\n  future version unintentionally.\n* Commit.\n* Send me a pull request. Bonus points for topic branches.\n\n\n## Copyright\n\nCopyright (c) 2019 Franck Verrot. MIT LICENSE. See LICENSE for details.\n\n\n[go-templating]: https://golang.org/pkg/text/template/\n[nomad-url]: https://www.nomadproject.io/","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffranckverrot%2Ftrek","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffranckverrot%2Ftrek","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffranckverrot%2Ftrek/lists"}