<@U05K5AUL8PQ> I am extremely excited for the list...
# atmos-dev
e
@Michael I am extremely excited for the list commands you implemented! ❤️ https://github.com/cloudposse/atmos/pull/797
👍 1
m
Thank you! I am going to move some of the logic into pkg/utils if that's okay to simplify the command logic!
👍 1
e
I'm always sensitive what we can ask for from outside contributors, but since I was just working on defining the requirements for a separate
atmos list vendor
command, thought I would share what I was thinking
So for the list vendor command, wanted to do something like this in
atmos.yaml
image.png
I think the
list stacks
and
list components
could benefit from the same configurability
And then using lipgloss for display
image.png
Just throwing this out there in the event I successfully nerd snipe you into implementing it! But if not, this is still a step up.
E.g.
Copy code
stacks:
  list:
    columns:
      - name: Stack
        value: '{{ .Stack }}'
      - name: Tenant
        value: '{{ .vars.tenant }}' 
      - name: Environment
        value: '{{ .vars.environment }}'
Copy code
Stack           Tenant        Environment
plat-ue2-dev    plat          ue2
m
That's fancy! Would it be useful to include an option for plain or pretty printing? I was also thinking this function could be leveraged for autocompletion in the future, such as with
atmos describe component <tab>
, where autocompletion is based on the output of listing stacks and components
e
Yes, I think if there's no TTY, it would degrade to plain output, so standard pipelining works well (e.g. atmos list stacks | grep foo)
Re: tab completion, yes, we have to improve that!
It should work like you describe
for components and --stack
m
Sounds good, I will periodically work on those additions today
🙏 1
@Erik Osterman (Cloud Posse) From a user perspective, we utilize the custom command every day because it's hard to keep track of the amount of stacks and components we have. The current pain point with the command is that it takes about 8 seconds to complete with our current setup. The general workflow when using the command is:
Copy code
√ . [devops] (HOST) infra ⨠ atmos list stacks -c eks/cluster
plat-ue2-dev

 √ . [devops] (HOST) infra ⨠ atmos terraform apply eks/cluster -s plat-ue2-dev
I can see having the pretty-print output as beneficial, but being able to quickly copy into the next command makes for a streamlined workflow. Is your vision to have it default to a "plain" output if not specified in
atmos.yaml
?
e
No, so this is very common in command line tools. If you run, for example:
Copy code
cat /etc/passwd | more | grep root
The
more
detects there's no TTY and does nothing
👍 1
If you use
bcat
and display a file on the command line, it's pretty printed
If you run
bcat | pbcopy
then it's not pretty printed
That said, not asking/suggesting that you have to implement this 😃 I can add it to our backlog. But we will implement this, as we're trying to make a push to polish off atmos so it continues to operate like a modern TUI CLI
(and, I'm not opposed to a
atmos.yaml
flag to disable TUI; but regardless, we'll need to degrade TUIs with or without that flag)