digitalocean / doctl

The official command line interface for the DigitalOcean API.
https://docs.digitalocean.com/reference/doctl/
Apache License 2.0
3.26k stars 397 forks source link

support for inline repl/shell? #66

Closed klauern closed 7 years ago

klauern commented 8 years ago

Would it be possible to have something equivalent to a shell for this tool? I find myself typing doctl compute droplet <action> a lot, and it'd be nice if I could do something like cd compute/droplet or cd compute and then just droplet <action> or droplet-action <action> directly.

aybabtme commented 8 years ago

hi @klauern ! I made an experimental REPL. If you want to try it out, I'd love to know if it matches what you're looking for:

https://github.com/aybabtme/godotto/#repl

klauern commented 8 years ago

Hello @aybabtme ! This looks neat. Unfortunately, my primary machine is a Windows box, so I can't do much in the way of testing this:

> go get github.com/aybabtme/godotto/cmd/dorepl
# github.com/aybabtme/godotto/internal/godojs
golang\src\github.com\aybabtme\godotto\internal\godojs\godojs.go:108: unknown godo.Droplet field 'DriveIDs' in struct literal
golang\src\github.com\aybabtme\godotto\internal\godojs\godojs.go:148: req.Drives undefined (type *godo.DropletCreateRequest has no field or method Drives)
golang\src\github.com\aybabtme\godotto\internal\godojs\godojs.go:148: undefined: godo.DropletCreateDrive
golang\src\github.com\aybabtme\godotto\internal\godojs\godojs.go:329: undefined: godo.Drive
golang\src\github.com\aybabtme\godotto\internal\godojs\godojs.go:336: undefined: godo.Drive
golang\src\github.com\aybabtme\godotto\internal\godojs\godojs.go:346: undefined: godo.DriveCreateRequest
golang\src\github.com\aybabtme\godotto\internal\godojs\godojs.go:374: undefined: godo.SnapshotCreateRequest
golang\src\github.com\aybabtme\godotto\internal\godojs\godojs.go:388: undefined: godo.Snapshot
golang\src\github.com\aybabtme\godotto\internal\godojs\godojs.go:573: undefined: godo.Drive
golang\src\github.com\aybabtme\godotto\internal\godojs\godojs.go:587: undefined: godo.Snapshot
golang\src\github.com\aybabtme\godotto\internal\godojs\godojs.go:336: too many errors
# github.com/aybabtme/godotto/pkg/extra/do/cloud/drives
golang\src\github.com\aybabtme\godotto\pkg\extra\do\cloud\drives\client.go:55: undefined: godo.DriveCreateRequest

I will see if I can get this working on my MB at home and get back to you. Do you have plans on cross-compilation support for windows?

aybabtme commented 8 years ago

I can try building it for windows but I have no way of testing that it'll work 😄

On Thursday, 9 June 2016, Nick Klauer notifications@github.com wrote:

Hello @aybabtme https://github.com/aybabtme ! This looks neat. Unfortunately, my primary machine is a Windows box, so I can't do much in the way of testing this:

go get github.com/aybabtme/godotto/cmd/dorepl# github.com/aybabtme/godotto/internal/godojs golang\src\github.com\aybabtme\godotto\internal\godojs\godojs.go:108: unknown godo.Droplet field 'DriveIDs' in struct literal golang\src\github.com\aybabtme\godotto\internal\godojs\godojs.go:148: req.Drives undefined (type *godo.DropletCreateRequest has no field or method Drives) golang\src\github.com\aybabtme\godotto\internal\godojs\godojs.go:148: undefined: godo.DropletCreateDrive golang\src\github.com\aybabtme\godotto\internal\godojs\godojs.go:329: undefined: godo.Drive golang\src\github.com\aybabtme\godotto\internal\godojs\godojs.go:336: undefined: godo.Drive golang\src\github.com\aybabtme\godotto\internal\godojs\godojs.go:346: undefined: godo.DriveCreateRequest golang\src\github.com\aybabtme\godotto\internal\godojs\godojs.go:374: undefined: godo.SnapshotCreateRequest golang\src\github.com\aybabtme\godotto\internal\godojs\godojs.go:388: undefined: godo.Snapshot golang\src\github.com\aybabtme\godotto\internal\godojs\godojs.go:573: undefined: godo.Drive golang\src\github.com\aybabtme\godotto\internal\godojs\godojs.go:587: undefined: godo.Snapshot golang\src\github.com\aybabtme\godotto\internal\godojs\godojs.go:336: too many errors# github.com/aybabtme/godotto/pkg/extra/do/cloud/drives golang\src\github.com\aybabtme\godotto\pkg\extra\do\cloud\drives\client.go:55: undefined: godo.DriveCreateRequest

I will see if I can get this working on my MB at home and get back to you. Do you have plans on cross-compilation support for windows?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/digitalocean/doctl/issues/66#issuecomment-225015350, or mute the thread https://github.com/notifications/unsubscribe/ABInVK6NG7N29nIv5g_yRN4lugDIISgsks5qKHadgaJpZM4IVUVn .

Cheers,

Antoine Grondin

Live long and prosper

aybabtme commented 8 years ago

@klauern let me know if this works https://github.com/aybabtme/godotto#windows-not-tested-ymmv

klauern commented 8 years ago

I created an issue for the windows test I ran: aybabtme/godotto#1