All Projects → franckverrot → Trek

franckverrot / Trek

Licence: mit
Trek is a CLI/ncurses explorer for HashiCorp Nomad clusters.

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Trek

Awesome Nomad
A curated list of amazingly awesome Nomad tools and shiny things.
Stars: ✭ 530 (+1938.46%)
Mutual labels:  hashicorp, nomad
Laminas Cli
Console command runner, exposing commands written in Laminas MVC and Mezzio components and applications
Stars: ✭ 25 (-3.85%)
Mutual labels:  command-line-tool, command-line
Cli
A command-line interface for Hetzner Cloud
Stars: ✭ 542 (+1984.62%)
Mutual labels:  command-line-tool, command-line
K2tf
Kubernetes YAML to Terraform HCL converter
Stars: ✭ 477 (+1734.62%)
Mutual labels:  command-line-tool, hashicorp
Ripgrep
ripgrep recursively searches directories for a regex pattern while respecting your gitignore
Stars: ✭ 28,564 (+109761.54%)
Mutual labels:  command-line-tool, command-line
Cbt
CBT - fun, fast, intuitive, compositional, statically checked builds written in Scala
Stars: ✭ 489 (+1780.77%)
Mutual labels:  command-line-tool, command-line
Jsonui
jsonui is an interactive JSON explorer on your command line
Stars: ✭ 583 (+2142.31%)
Mutual labels:  command-line-tool, command-line
Performance
⏱ PHP performance tool analyser your script on time, memory usage and db query. Support Laravel and Composer for web, web console and command line interfaces.
Stars: ✭ 429 (+1550%)
Mutual labels:  command-line-tool, command-line
Papis
Powerful and highly extensible command-line based document and bibliography manager.
Stars: ✭ 636 (+2346.15%)
Mutual labels:  command-line-tool, command-line
Spicetify Cli
Commandline tool to customize Spotify client. Supports Windows, MacOS and Linux.
Stars: ✭ 9,316 (+35730.77%)
Mutual labels:  command-line-tool, command-line
Node.cli Progress
⌛️ easy to use progress-bar for command-line/terminal applications
Stars: ✭ 466 (+1692.31%)
Mutual labels:  command-line-tool, command-line
Stronghold
Easily configure macOS security settings from the terminal.
Stars: ✭ 813 (+3026.92%)
Mutual labels:  command-line-tool, command-line
Dateutils
nifty command line date and time utilities; fast date calculations and conversion in the shell
Stars: ✭ 458 (+1661.54%)
Mutual labels:  command-line-tool, command-line
Levant
An open source templating and deployment tool for HashiCorp Nomad jobs
Stars: ✭ 510 (+1861.54%)
Mutual labels:  hashicorp, nomad
Jl
Functional sed for JSON
Stars: ✭ 449 (+1626.92%)
Mutual labels:  command-line-tool, command-line
Broot
A new way to see and navigate directory trees : https://dystroy.org/broot
Stars: ✭ 6,362 (+24369.23%)
Mutual labels:  command-line-tool, command-line
Sendmidi
Multi-platform command-line tool to send out MIDI messages
Stars: ✭ 411 (+1480.77%)
Mutual labels:  command-line-tool, command-line
Azure Devops Cli Extension
Azure DevOps Extension for Azure CLI
Stars: ✭ 420 (+1515.38%)
Mutual labels:  command-line-tool, command-line
Sultan
Sultan: Command and Rule over your Shell
Stars: ✭ 625 (+2303.85%)
Mutual labels:  command-line-tool, command-line
Terjira
Terjira is a very interactive and easy to use CLI tool for Jira.
Stars: ✭ 713 (+2642.31%)
Mutual labels:  command-line-tool, command-line

Trek

Trek is a CLI/ncurses explorer for HashiCorp Nomad clusters.

In Action

SETUP

Binary Release

Get to revisions, and download a binary.

From Source

git clone https://github.com/franckverrot/trek.git
cd trek
make trek

USAGE

TL;DR Start ./trek -help to get the usage prompt.

CLI

The CLI can be used without a UI. This allows scripting to access IP, ports, and other info exposed by Nomad.

Options

Here's a list of options available:

  • nomad-address: address of the nomad cluster

  • list-jobs: list jobs running on the cluster
λ ./trek -list-jobs
* example
* example34

NOTE : this option also works in conjunction with display-format

  • job: select a specific job
λ trek -job example34
* cache34
* cache56

  • task-group: select a specific task group
λ trek -job example34 -task-group cache56
* example34.cache56[0]

  • allocation: select a specific allocation number
λ trek -job example34 -task-group cache56 -allocation 0
(0) redis5
(1) redis6

  • task-name: select a specific task name
λ trek -job example34 -task-group cache56 -allocation 0 -task-name redis6
* Name: redis6
* Node Name: feynman.local
* Node IP: 127.0.0.1
* Driver: docker
        * image: redis:3.2
        * port_map: [map[db:6379]]
* Dynamic Ports: 24832 (db)

  • display-format: Use the Go templating language to format output when describing a specific job, task group, allocation or task
    • Context-specific data made available:
      • Job
        • TaskGroups (array of task groups): task groups part of the job definition
      • Task Group
        • Allocations (array of allocations): allocations run by that task group
      • Allocation
        • IP (string): node onto which we're running the selected allocation
        • Tasks (array of tasks): tasks being run by that allocation
      • Task
        • IP (string): node onto which we're running the selected task
        • Network: network information (like ports)
        • Environment: environment variables provided to the task
    • Available functions:
      • {{Debug <x>}} : show raw representation of the data <x>
      • {{DebugAll}} : show raw representation of everything provided to the template
    • Examples:
λ trek -job example34 -task-group cache56 -allocation 0 -task-name redis6 -display-format "{{DebugAll}}"
DEBUG ALL: {IP:127.0.0.1 Network:{Ports:map[db:{Value:23109 Reserved:false}]} Environment:map[FOO_BAR:{Value:baz_bat}]}

λ trek -job example34 -task-group cache56 -allocation 0 -task-name redis6 -display-format "{{Debug .Environment}}"
DEBUG: map[FOO_BAR:{Value:baz_bat}]

λ trek -job example34 -task-group cache56 -allocation 0 -task redis6 -display-format "{{range .Network.Ports}}{{$.IP}}:{{.Value}}{{println}}{{end}}"
127.0.0.1:31478
127.0.0.1:25142

ncurses UI

./trek -ui=true

Trek Configuration File

Example

{ "Environments" : [ { "Name" : "development" , "Address" : "http://127.0.0.1:4646" }
                   ]
}

Options

  • Environments: List of environments (given a name and address) Trek can connect to

FAQ

  • How do I ssh into an allocation's node?

    λ ssh $(trek -job ... -task-group ... -allocation 0 -display-format "{{.IP}}")

Note on Patches/Pull Requests

  • Fork the project.
  • Make your feature addition or bug fix.
  • Add tests for it. This is important so I don't break it in a future version unintentionally.
  • Commit.
  • Send me a pull request. Bonus points for topic branches.

Copyright

Copyright (c) 2019 Franck Verrot. MIT LICENSE. See LICENSE for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].