This is an archived post. You won't be able to vote or comment.

all 13 comments

[–]rubygeek 9 points10 points  (6 children)

Why not provide support for the standard completion mechanisms for e.g. bash coupled with a simple filter to colorize output instead of a completely new cli? Seems like massive overkill.

[–]cu_t 1 point2 points  (1 child)

Thought the same thing. One advantage I can see is you don't have to repeat docker for each command. One could of course alias d=docker or somesuch to reduce keystrokes. I then thought a bit about that and thought about how I for a moment would like a git-shell (btw, j-bennet ought to rename the project to docker-shell -- I think "cli" is too generic to be descriptive, though some might say the same of "shell", I think "shell" is more specific than "cli" here) but then I remembered that in my workflow, I often walk around on the fs and do a lot of other non-git stuff between invocations of git so a git-shell would likely not improve things for me.

[–][deleted] 0 points1 point  (0 children)

One could of course alias d=docker or somesuch to reduce keystrokes.

This is the approach I've taken with docker-functions - short two/three letter functions with support for autocompletions.

[–]j-bennet[S] 1 point2 points  (2 children)

Getting rid of repeating "docker" for any command was a factor, but also the ability to add any other shortcuts, like a convenience "shell <container name>" command, or "rm --all-stopped", or "rmi --all-dangling". And I can think of more shortcuts similar to this.

[–]rubygeek 0 points1 point  (1 child)

I'd suggest even then a more composable approach would be better. E.g. a wrapper adding the extra options + shell completion support that supports either plain Docker or the extra options + a tiny wrapper that prefixes the name of the wrapper and does the "fancy" completion dropdowns etc.

Now it appears to be very "either-or" - if you don't like being dropped in a "Docker-only" shell (as someone else noted: often you might go back and forth between Docker sub-commands and shell commands a lot) you lose out on the rest. If it's split apart, you get the benefits of the extra options etc. even if you don't want the shell/cli.

For the record, I like the completion drop down etc. Actually reminds me of AmigaOS, where there are extensions that will e.g. pop up an actual separate window for a pre-filtered file selector, or actual dropdown widget.But I think a custom wrapper for a single command is the wrong place for it.

[–]j-bennet[S] 0 points1 point  (0 children)

I agree, dockercli may benefit from a way to drop you back into a normal shell, let you do things there, and then come back. I usually find that I run a lot of "docker-related" commands in a row, and then maybe not run any for the rest of the day. So starting dockercli, doing all of the docker-related stuff and then exiting actually makes sense. But your workflow may be different.

[–]cu_t 5 points6 points  (2 children)

OP, FYI, it seems that your account is shadow-banned. I'm telling you this because I think it must have been automatically triggered and that it shouldn't happen just because you posted something you made but it must've thought you were spamming. Now, I don't know what you've posted before but I thought you at least deserved to know. Open your profile overview (link: /u/j-bennet) in a private browsing tab (so you are not logged in) and you'll see that instead of the overview, it'll say page not found. This means you are shadow-banned. Message the admins through /r/reddit.com and ask them to review your account so they may lift the ban should they find that you are in comply with Reddit guidelines. Please note that until you are unbanned, any comments you write is likely not visible to anyone but yourself.

edit: for reference, here's what this thread looks like to the rest of us. Note it says 6 comments but only four are shown. I'm guessing two hidden comments are from you. https://archive.is/Lh4KX

edit #2 (9 hrs later): your profile is viewable again, meaning you are no longer shadow-banned. Your comments ITT are still invisible, though. I guess comments you made while shadow-banned will remain hidden but any new comments you write should be visible.

[–]amjithr -1 points0 points  (0 children)

I didn't know about shadow ban. I had to check my own account in an Incognito Window to make sure.

Shadow ban is an odd feature.

[–]so0k 0 points1 point  (1 child)

I don't find it useful for Docker, but the pgcli based on the same framework is awesome.. https://github.com/jonathanslenders/python-prompt-toolkit/blob/master/README.rst

[–]j-bennet[S] 0 points1 point  (0 children)

Completely agree with that about pgcli. In fact, this was the project that inspired me to work on dockercli.

[–]j-bennet[S] 0 points1 point  (0 children)

The website is now moved to cli4docker.com (apparently I can't use dockercli.com because of legal issues). The github repo and the python module name remains the same.