Giter VIP home page Giter VIP logo

dbxcli's Introduction

dbxcli: A command line tool for Dropbox users and team admins [UNOFFICIAL]

Build Status Go Report Card

โš ๏ธ WARNING: This project is NOT official. What does this mean?

  • There is no formal Dropbox support for this project
  • Bugs may or may not get fixed
  • Not all SDK features may be implemented and implemented features may be buggy or incorrect

Features

  • Supports basic file operations like ls, cp, mkdir, mv (via the Files API)
  • Supports search
  • Supports file revisions and file restore
  • Chunked uploads for large files, paginated listing for large directories
  • Supports a growing set of Team operations

Installation

Download pre-compiled binaries for Mac, Windows and Linux from the releases page.

Mac OSX Installation of pre-compiled binaries

These instructions aim to help both experts and novice dbxcli users. Please submit an issue if they don't work for you.

  1. Make sure you download and place the binary in a folder that's on your $PATH. If you are unsure what this means, go to step 2. Otherwise, skip to step 3
  2. Create a bin directory under your home directory.
$ mkdir ~/bin
$ cd ~/bin
  1. Add the following line at the end of your ~/.bash_profile file. Link with instructions on how to find this file
export PATH=$PATH:$HOME/bin
  1. Download the dbxcli binary for OSX and rename it. IMPORTANT: Check that the tag v2.1.1 on the URL below is the latest release tag on the Releases page.
$ wget https://github.com/dropbox/dbxcli/releases/download/v2.1.1/dbxcli-darwin-amd64 
$ mv dbxcli-darwin-amd64 dbxcli
  1. Finally, make the binary an executable file and you are good to go!
$ chmod +x dbxcli

Instructions for building yourself

For newcomers the go build process can be a bit arcane, these steps can be followed to build dbxcli yourself.

  1. Make sure git, go, and gox are installed.
  2. Create a Go folder. For example, mkdir $HOME/go or mkdir $HOME/.go. Navigate to it.
  3. go get github.com/dropbox/dbxcli. That's right, you don't manually clone it, this does it for you.
  4. cd ~/go/src/github.com/dropbox/dbxcli (adapt accordingly based on step 2).

Now we need to pause for a second to get development keys.

  1. Head to https://www.dropbox.com/developers/apps (sign in if necessary) and choose "Create app". Use the Dropbox API and give it Full Dropbox access. Name and create the app.
  2. You'll be presented with a dashboard with an "App key" and an "App secret".
  3. Replace the value for personalAppKey in root.go with the key from the webpage.
  4. Replace the value for personalAppSecret with the secret from the webpage.

Finally we're ready to build. Run go build, and you'll see a dbxcli binary has been created in the current directory. Congrats, we're done!

Usage

dbxcli is largely self documenting. Run dbxcli -h for a list of supported commands:

$ dbxcli --help
Use dbxcli to quickly interact with your Dropbox, upload/download files,
manage your team and more. It is easy, scriptable and works on all platforms!

Usage:
  dbxcli [command]

Available Commands:
  cp          Copy files
  du          Display usage information
  get         Download a file
  ls          List files
  mkdir       Create a new directory
  mv          Move files
  put         Upload files
  restore     Restore files
  revs        List file revisions
  rm          Remove files
  search      Search
  team        Team management commands
  version     Print version information

Flags:
      --as-member string   Member ID to perform action as
  -v, --verbose            Enable verbose logging

Use "dbxcli [command] --help" for more information about a command.

$ dbxcli team --help
Team management commands

Usage:
  dbxcli team [command]

Available Commands:
  add-member    Add a new member to a team
  info          Get team information
  list-groups   List groups
  list-members  List team members
  remove-member Remove member from a team

Global Flags:
      --as-member string   Member ID to perform action as
  -v, --verbose            Enable verbose logging

Use "dbxcli team [command] --help" for more information about a command.

The --verbose option will turn on verbose logging and is useful for debugging.

Contributing

Useful Resources

dbxcli's People

Contributors

alan707 avatar anishkny avatar banool avatar bonafidehan avatar diwakergupta avatar gabrielhora avatar grantseltzer avatar greg-db avatar knakayama avatar markmichaelis avatar mattn avatar okmttdhr avatar ryan-ph avatar satori avatar szabgab avatar vaithak avatar waits avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dbxcli's Issues

Unit testing

Just wanted to start a discussion on unit testing, since @diwakergupta and @grantseltzer mentioned it and it's been on my mind as well.

Should we mock all the API responses? It'd be simpler and less fragile that way, besides the initial overhead of creating all the mocks (but those could just be a bunch of files with HTTP/JSON responses). The Dropbox API doesn't have a "test mode", anyways, so I don't see a way around this.

Should we do any integration tests? I see a small test script @diwakergupta wrote, which might be enough. It looks like it cleans up after itself too. Of course, there's always a chance of nuking your entire Dropbox when running live tests, but that's better than publishing a release with such a flaw.

Does anyone feel strongly about testing frameworks? Go already has one of the most complete testing packages I've seen in a standard library, so we might not need anything else. I've had success using just that in other projects. Ginko has some fans as well, although it's quite different and BDD-based.

Interactive mode

I wanted to share some thoughts and open a discussion about an interactive mode for this project.

The way I picture it:

dbxcli --interactive or dbxcli -i would enter a repl like environment with a prompt that would allow the user to just enter commands. There could be an exit command to leave the mode.

This alone I don't think is a huge improvement on convenience. If there were some type of cache to store information such as directory contents then there would be a huge improvement to speed/ease of use especially with Go's built in concurrency features. This would also allow for implementation of features such as cd since the pwd could be stored in memory.

ls -lR lists deleted files

Seems to me the ls -lR command seems to return old deleted files in some cases, which by the looks of it is unintentional and should probably be a separate flag.

[README.md#Mac_OSX_Installation_of_pre-compiled_binaries] Use cURL instead of Wget

macOS installation instructions should mention curl instead of wget since Wget isn't installed by default on macOS. 'Novice' users who ended here from Google may not know Homebrew. I suggest you some example of a new command line below, but I haven't tested it.

Dropbox's command lines:

$ wget https://github.com/dropbox/dbxcli/releases/download/v2.0.9/dbxcli-darwin-amd64 
$ mv dbxcli-darwin-amd64 dbxcli

My CL:

curl -J -L -H "Accept: application/octet-stream" "https://github.com/dropbox/dbxcli/releases/download/v2.1.0/dbxcli-darwin-amd64" --output "dbxcli"

Make `ls` list files in multiple columns

It would be nice if the ls command listed files in columns so more can fit on a screen. Most/all unix-based ls commands do this, for example:

$ ls /etc/alphabet
alpha  charlie  echo     golf   india
bravo  delta    foxtrot  hotel  juliett

$ ls /srv/random-rails-app
app  config     db       Gemfile.lock  log     Rakefile  tmp
bin  config.ru  Gemfile  lib           public  test      vendor

Whereas this tool's output is:

$ dbxcli ls /some-folder
alpha
bravo
charlie
delta
...

The output of the --long option would of course remain unchanged.

JSON error during login.

Version:

Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.3 LTS
Release:	16.04
Codename:	xenial

dbxcli version: v2.0.9
SDK version: 4.0.0
Spec version: 5389e5b

Dropbox: Personal plus

Error:

$ dbxcli account                                                                                              
1. Go to https://www.dropbox.com/1/oauth2/authorize?client_id=xxxxxx&response_type=code&state=state
2. Click "Allow" (you might have to log in first).
3. Copy the authorization code.
Enter the authorization code here: xxxxxxxxx
Error: json: cannot unmarshal object into Go struct field FullAccount.root_info of type common.IsRootInfo

auth.json:

{"":{"personal":"xxxxx"}}

Rename a file?

Am I doing something wrong? There doesn't seem to be a way to rename or copy a file to a new name.

I've tried the following:
dbxcli cp x.txt test/y.txt
dbxcli mv x.txt y.txt
Both end up with a folder (/test/y.txt or /y.txt respectively) with x.txt inside it.

I'd settle for a 'ren' command, but I'd like to see support with cp and mv commands.

build instructions in readme

im not familiar with go, so maybe im missing something, but shouldnt there be a makefile or some instructions in the readme as to how to build this project?

Recursive and force flags for rm

Would there be interest in this feature? I brought up the other issue about having rmdir, regardless of whether or not this is wanted there should be a blocker for removing non-empty directories.

How do I install this program?

I'm running macOS 10.12.1.

How do I install this program?

I downloaded the dbxcli-darwin-amd64 file from the releases page. I tried adding executable permissions and running it but it failed:

$ chmod +x dbxcli-darwin-amd64
$ ./dbxcli-darwin-amd64
fatal error: runtime: bsdthread_register error

runtime stack:
runtime.throw(0x148048f, 0x21)
	/home/travis/.gimme/versions/go1.8.linux.amd64/src/runtime/panic.go:596 +0x95 fp=0x7fff5fbff810 sp=0x7fff5fbff7f0
runtime.goenvs()
	/home/travis/.gimme/versions/go1.8.linux.amd64/src/runtime/os_darwin.go:108 +0xa0 fp=0x7fff5fbff840 sp=0x7fff5fbff810
runtime.schedinit()
	/home/travis/.gimme/versions/go1.8.linux.amd64/src/runtime/proc.go:486 +0xa1 fp=0x7fff5fbff880 sp=0x7fff5fbff840
runtime.rt0_go(0x7fff5fbff8b8, 0x1, 0x7fff5fbff8b8, 0x0, 0x0, 0x1, 0x7fff5fbffa58, 0x0, 0x7fff5fbffa6e, 0x7fff5fbffaaa, ...)
	/home/travis/.gimme/versions/go1.8.linux.amd64/src/runtime/asm_amd64.s:158 +0x183 fp=0x7fff5fbff888 sp=0x7fff5fbff880

Fails on most uploads and downloads

Pretty much all uploads and downloads fail and this is displayed:

panic: runtime error: index out of range

goroutine 1 [running]:
panic(0x8b7400, 0xc82000e0f0)
    /home/travis/.gimme/versions/go1.6.linux.amd64/src/runtime/panic.go:464 +0x3e6
github.com/dropbox/dbxcli/cmd.put(0xbe2860, 0xc82000eeb0, 0x1, 0x1, 0x0, 0x0)
    /home/travis/gopath/src/github.com/dropbox/dbxcli/cmd/put.go:60 +0x6a4
github.com/dropbox/dbxcli/vendor/github.com/spf13/cobra.(*Command).execute(0xbe2860, 0xc82000ee60, 0x1, 0x1, 0x0, 0x0)
    /home/travis/gopath/src/github.com/dropbox/dbxcli/vendor/github.com/spf13/cobra/command.go:565 +0x62c
github.com/dropbox/dbxcli/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xbe3260, 0xbe2860, 0x0, 0x0)
    /home/travis/gopath/src/github.com/dropbox/dbxcli/vendor/github.com/spf13/cobra/command.go:656 +0x55c
github.com/dropbox/dbxcli/vendor/github.com/spf13/cobra.(*Command).Execute(0xbe3260, 0x0, 0x0)
    /home/travis/gopath/src/github.com/dropbox/dbxcli/vendor/github.com/spf13/cobra/command.go:615 +0x2d
github.com/dropbox/dbxcli/cmd.Execute()
    /home/travis/gopath/src/github.com/dropbox/dbxcli/cmd/root.go:218 +0x23
main.main()
    /home/travis/gopath/src/github.com/dropbox/dbxcli/main.go:43 +0x14

Using Ubuntu 16.04 64bit and the 64bit dbxcli binary downloaded from GitHub (but this also occurs with older versions).

`get` does not work on folders

Neither ./dbxcli get xxx/* nor ./dbxcli get xxx/ work for downloading all files from a folder.

The error message is:
Error: unexpected end of JSON input

Is there something I'm doing wrong, or has this feature not been implemented yet? Is there an easy way to download all files in a folder?

Usage question with wildcards

Hey y'all,

Discovered this genius lil project while looking for a way to organize my Dropbox files via command line-- I have a very large folder that's not synced with my desktop, and the web interface is so slow and gross for doing heavy lifting. I'm on mac OS 10.12.5, and downloaded the latest Darwin binary (v2.0.2).

I have enough general command line knowledge to break just about anything, which ultimately means I can get around, but not well. What I'd like to do in plain English is this: "Move all files that begin with '2012-' in the 'Photos backup-- 2011-2016' folder to a subfolder there called '2012.'" I like to live on the edge, so I tried a few ways, with no success. Here's what I thought I should do, with its output.

$ dbxcli mv "Photos backup-- 2011-2016/2012-*.*" "Photos backup-- 2011-2016/2012/"
Move error: &{{/Photos backup-- 2011-2016/2012-*.* /Photos backup-- 2011-2016/2012//Photos backup-- 2011-2016/2012-*.*} false false}

Any help for my bull-in-a-china-shop technique is greatly appreciated. [smash smash]

Unable to Authorize App

I ran go get -u github.com/dropbox/dbxcli and then ./dbxcli du. This is the auth url I'm given: https://www.dropbox.com/1/oauth2/authorize?client_id=mvhz183vwqibe7q&response_type=code&state=state

and this is what I get when I visit:
screen shot 2017-02-24 at 10 07 34 pm

Am I doing something wrong here?

`get` does not work on JPG files

./dbxcli get xxx.pdf and ./dbxcli get xxx.png both work, but ./dbxcli get xxx.jpg is not working.

Error message is:
Error: json: cannot unmarshal object into Go value of type files.IsMediaMetadata

I've managed to reproduce this with different files of all types and the error message is always the same. ./dbxcli ls xxx.jpg does work.

`put` command is sending wrong client_modified timestamp

When uploading a file with the put command the client_modified timestamp isn't being set. This is causing the SDK to send a default value of "0001-01-01T00:00:00Z", which Dropbox interprets as January 1, 2001 (before accounting for time zones). This incorrect value is displayed in the various Dropbox GUI apps.

This is easily confirmed with the -v flag (note "client_modified" on both lines):

$ dbxcli put -v test.rb
...
2016/06/12 22:16:06 impl.go:1270: req: &{POST https://content.dropboxapi.com/2/files/upload HTTP/1.1 1 1 map[Content-Type:[application/octet-stream] Dropbox-Api-Arg:[{"path":"/test.rb","mode":{".tag":"overwrite"},"autorename":false,"client_modified":"0001-01-01T00:00:00Z","mute":false}]] {0xc82007a460} 0 [] false content.dropboxapi.com map[] map[] <nil> map[]   <nil> <nil>}
...
2016/06/12 22:16:08 impl.go:1287: body: {"name": "test.rb", "path_lower": "/test.rb", "path_display": "/test.rb", "id": "id:ZoeZpsEyI3AAAAAAAAAAAQ", "client_modified": "2001-01-01T00:00:00Z", "server_modified": "2016-06-13T04:50:33Z", "rev": "d2580edd0ab3", "size": 2222}

Screenshot of how https://www.dropbox.com interprets this (in PST):
screen shot 2016-06-12 at 10 22 31 pm

API docs mentioning client_modified parameter.

List deleted files and possibly recover them

Currently I can only restore a file if I know its revision.

But imagine that somehow a bunch of files got deleted and I didn't got their revision or their name, so I'd like to recovery all those deleted files.

I think I could figure out a solution if somehow I could list deleted files, so would that be possible?

Could not able to copy a tar.gz file in my dropbox folder

Unable to copy the ...tar.gz into my dropbox folder.

$ dbxcli cp -v openshift-origin.tar.gz technical_stuff
2017/04/06 19:17:04 client.go:411: arg: &{{/openshift-origin.tar.gz /technical_stuff/openshift-origin.tar.gz} false false}
2017/04/06 19:17:04 client.go:428: req: &{POST https://api.dropboxapi.com/2/files/copy HTTP/1.1 1 1 map[Content-Type:[application/json]] {0xc420019ec0} 0x6547d0 140 [] false api.dropboxapi.com map[] map[] <nil> map[]   <nil> <nil> <nil> <nil>}
2017/04/06 19:17:05 client.go:432: resp: &{409 Conflict 409 HTTP/1.1 1 1 map[Content-Type:[application/json] Content-Length:[117] Connection:[keep-alive] X-Dropbox-Request-Id:[cb0a7425e1f65da432f721bba73a62d6] Server:[nginx] Date:[Thu, 06 Apr 2017 13:47:05 GMT]] 0xc420126100 117 [] false false map[] 0xc42000ac00 0xc4201762c0}
2017/04/06 19:17:05 client.go:445: body: {"error_summary": "from_lookup/not_found/..", "error": {".tag": "from_lookup", "from_lookup": {".tag": "not_found"}}}
Copy error: &{{/openshift-origin.tar.gz /technical_stuff/openshift-origin.tar.gz} false false}

Can't authorize team management

Error message from the OAuth authorization URL:

This app is in development mode and can't be authorized by more teams. Contact the app developer and ask them to use the Dropbox API App Console to apply for production status.

I would love to use the CLI to streamline user provisioning, so would either like to get added to the development list or have production status enabled for the app.

Specify auth token as an argument

Howdy,

What about having the option to specify the auth token as an argument?

Something like:
dropboxcli put file_here destination_here -v -token token_here

Asks for authentication code on each run [Linux]

Each time I run a dbxcli command, it asks for the Dropbox authorization code. Should this be saved to some configuration file?

This occurs using the latest v0.1.1 release (binary downloaded from GitHub) under Ubuntu 16.04 64bit.

Let me know if you need more info.

Allow several profiles

I tend to use multiple accounts on Dropbox and would like to be have something like a --profile=(email) option for dbxcli to chose the account.

Have seperate commands for `rm` and `rmdir`

Would there be interest for this feature? I think most people using the CLI will be more technical and for the sake of making this cli consistent with standard coreutils would appreciate needing to rmdir a directory.

Invalid client_id when trying to get authorization code

When I copy and paste the OAuth URL I am getting this error:

Error (400)
It seems the app you were using submitted a bad request. If you would like to report this error to the app's developer, include the information below.


More details for developers

Invalid client_id: "mvhz183vwqibe7q".

Better output for ls

Hello,

When i use ls for listing all my files in a directory, the output is very strange :

capture d ecran 2017-09-08 a 09 31 07

why the amount of whitespace is not fix ? or just use tabs ?

Thank you

"Usage" section of help text is missing arguments

The "usage" section of the help text for all commands doesn't mention the argument(s) required. Example:

$ dbxcli get --help
Download a file

Usage:
  dbxcli get [flags]

It should actually say something like this:
dbxcli get [flags] source [destination]

Or this:
dbxcli get [flags] <source> [<destination>]

This seems to apply to all commands except the ones that don't take any arguments (du and version).

`put` target argument not working properly

I would assume based on the following help text that put can take a source (local file) argument, and/or an argument that represents a location on the users dropbox account for the file to go.

[*] dbxcli put --help
Upload files

Usage:
  dbxcli put [flags] <source> [<target>]

Global Flags:
      --as-member string   Member ID to perform action as
  -v, --verbose            Enable verbose logging

Instead, if a second argument is specified, the source is uploaded to the root of the dropbox account and is renamed to the second argument.

@diwakergupta is this how it was intended to be used and I'm just misinterpreting the help text?

I don't think the way it works now is very necessary. I'd like to add multiple arguments (including running them concurrently) and add a flag for destination which can specify a particular path to put all the arguments in.

v2.0.2 in Windows ls not returning results unless verbose

When I run dbxcli with the ls / it does not return anything. if I run it verbosely e.g. dbxcli ls / -v it returns:

2017/03/20 20:03:15 client.go:1510: arg: &{ false false false false}
2017/03/20 20:03:15 client.go:1527: req: &{POST https://api.dropboxapi.com/2/files/list_folder HTTP/1.1 1 1 map[Content-Type:[application/json]] {0xc042067950} 0x653400 124 [] false api.dropboxapi.com map[] map[] map[] }
2017/03/20 20:03:16 client.go:1531: resp: &{200 OK 200 HTTP/1.1 1 1 map[X-Dropbox-Http-Protocol:[None] X-Frame-Options:[SAMEORIGIN] Content-Type:[application/json] Pragma:[no-cache] X-Server-Response-Time:[186] Server:[nginx] Vary:[Accept-Encoding] X-Content-Type-Options:[nosniff] X-Dropbox-Request-Id:

plus directory information and file names.

Running on fully patched Windows 10.

Bad authorization URL generated.

URL leads to 404 error with msg below.

More details for developers

Invalid client_id: "t99asy5qf227urb".

Actual command

$ dbxcli  ls
1. Go to https://www.dropbox.com/1/oauth2/authorize?client_id=t99asy5qf227urb&response_type=code&state=state
2. Click "Allow" (you might have to log in first).
3. Copy the authorization code.
Enter the authorization code here:

Add sync command

Usecase

I'm automatically downloading files on a headless Linux server for one of our team having near to no technical knowledge from a SFTP host and providing those files (filtered) to that team in a Dropbox folder.

Current way to use dbxcli

  • Use find to list all files
  • For each file execute dbxcli put ${file} ${target}

This has multiple disadvantages:

  • DNS blocking using block-api.g1.dropbox.com
  • Requests for files not required to sync

Expected solution

  • Call dbxcli sync ${source_folder} ${target_folder}

Advantages:

  • Files are synced when required but not every time
  • Fewer DNS requests / connections to establish
  • More efficient sync (better for local system / better for Dropbox servers)
  • Sync can be executed parallel instead of sequentially saving even more time

Improve (or add?) error handling

Right now errors are very confusing. Example, get on a non-existent path fails as:

$ dbxcli get dropbox://Video/Catalina.mp4
dbxcli: unexpected end of JSON input

The response clearly indicates the error though:

$ dbxcli --verbose get dropbox://Video/Catalina.mp4
2016/01/28 21:38:58 arg: &{/Video/Catalina.mp4 }
2016/01/28 21:38:58 req: &{POST https://content.dropboxapi.com/2/files/download HTTP/1.1 1 1 map[Dropbox-Api-Arg:[{"path":"/Video/Catalina.mp4"}]] <nil> 0 [] false content.dropboxapi.com map[] map[] <nil> map[]   <nil> <nil>}
2016/01/28 21:38:58 resp: &{409 path/not_found/.. 409 HTTP/1.1 1 1 map[Connection:[keep-alive] X-Dropbox-Request-Id:[6d5831aaaa98099dcb76455a58bf94a9] X-Robots-Tag:[noindex, nofollow, noimageindex] Server:[nginx] Date:[Fri, 29 Jan 2016 05:38:58 GMT] Content-Type:[application/json]] 0xc820420100 -1 [chunked] false map[] 0xc8200b81c0 0xc8203874a0}

dbxcli download issues ( Error: unexpected EOF )

Hi Guys,

When I try to download the file using dbxcli utility, I am getting unexpected end of file error.

~]$ dbxcli version
dbxcli version: v2.0.6
SDK version: 1.0.0-beta
Spec version: 6194bea

Downloading 0 B/6.2 GiB

Downloading 2.9 KiB/6.2 GiB

Downloading 40 MiB/6.2 GiB

Downloading 87 MiB/6.2 GiB

Downloading 120 MiB/6.2 GiB

Downloading 166 MiB/6.2 GiB

Downloading 200 MiB/6.2 GiB

Downloading 248 MiB/6.2 GiB

Downloading 289 MiB/6.2 GiB

Downloading 336 MiB/6.2 GiB

Downloading 382 MiB/6.2 GiB

Downloading 420 MiB/6.2 GiB

Downloading 464 MiB/6.2 GiB

Downloading 505 MiB/6.2 GiB

Downloading 543 MiB/6.2 GiB

Downloading 576 MiB/6.2 GiB

Downloading 608 MiB/6.2 GiB

Downloading 640 MiB/6.2 GiB

Downloading 675 MiB/6.2 GiB

Downloading 708 MiB/6.2 GiB

Downloading 743 MiB/6.2 GiB

Downloading 780 MiB/6.2 GiB

Downloading 816 MiB/6.2 GiB

Downloading 853 MiB/6.2 GiB

Downloading 896 MiB/6.2 GiB

Downloading 2.9 GiB/6.2 GiB

> Error: unexpected EOF

please let us know if we need more info.

go build: Cannot use versionCmd

I'm trying to compile, but I'm running into the following error:

Daniels-MBP:dbxcli daniel$ go build
# _/Users/daniel/github/dbxcli
./main.go:43:24: cannot use versionCmd (type *"github.com/spf13/cobra".Command) as type *"github.com/dropbox/dbxcli/vendor/github.com/spf13/cobra".Command in argument to cmd.RootCmd.AddCommand

Prior to this I cloned the repo and ran these commands:

go get github.com/dropbox/dbxcli/cmd
go get github.com/dropbox/dropbox-sdk-go-unofficial/dropbox
go get github.com/spf13/cobra
go build

I feel like I should be able to just run go build on its own, but I'm not sure.

Go version: 1.9.2.

If I remove the culprit line (43 in main.go) it builds successfully. However when I try to do the auth step by running a command (where it gives me a URL to authorise the app with the API) the page gives me a 400 error saying that the request is invalid (Invalid client_id: "mvhz183vwqibe7q"). That sounds like it warrants another issue though.

improve OS nomenclature under releases page?

Maybe other people will find it useful as well. The nomenclature of the different OS releases is a bit counterintuitive for OSX users. Windows and Linux are clear, but how about changing the name from Darwin to OSX?

I am happy to add an explanation on how you can figure out if you have AMD or ARM in your system.

Generating authorization code no longer works

When you first do a command using DBXCLI, it asks you to go to the following URL:
https://www.dropbox.com/1/oauth2/authorize?client_id=mvhz183vwqibe7q&response_type=code&state=state

This URL now appears to be broken. The error is as follows:

Error (400)
It seems the app you were using submitted a bad request. If you would like to report this error to the app's developer, include the information below.

More details for developers

Invalid client_id: "mvhz183vwqibe7q".

Regex matching for arguments

I haven't put any thought into how this can be done, but I'd like to have the ability to do things like this:

dbxcli mv *.jpeg MyPictures

Go has regex matching in the standard library, the issue however becomes breaking out of bash's pattern matching.

Invalid client_id when trying to get authorization code

I've installed dbxcli via "go get" since binaries are not available for OpenBSD. When I copy and paste the OAuth URL I get this error:

Error (400)
It seems the app you were using submitted a bad request. If you would like to report this error to the app's developer, include the information below.


More details for developers
Invalid client_id: "mvhz183vwqibe7q".

Issue #62 resolved this problem by installing the latest binaries. Since those aren't available for my platform, how should I proceed? Thanks.

Authorization error - app has reached its team limit

Hi,

I'm getting an error when using the pre-built Windows binary when authorizing my dropbox account.

It's a dropbox error when I paste the url into my browser: This app has reached its team limit. Contact the app developer and ask them to use the Dropbox API App Console to increase their app's team limit.

capture

murray.grant@FE-DEV-IOS C:\Users\murray.grant\Downloads
> dbxcli-windows-amd64.exe team list-members
1. Go to https://www.dropbox.com/1/oauth2/authorize?client_id=xxe04eai4wmlitv&response_type=code&state=state
2. Click "Allow" (you might have to log in first).
3. Copy the authorization code.
Enter the authorization code here:

Can you increase your app limit, please. Or should I be doing something else to resolve this?

Regards Murray

Add `logout` or `revoke` command

There's currently no way to log out unless you know where the auth token is stashed and go delete it manually. A simple logout/revoke command would need to do two things:

  1. Call https://api.dropboxapi.com/2/auth/token/revoke to revoke the active token
  2. Delete ~/.config/dbxcli/auth.json

Support `ls` on files

Right now attempting ls on files fails:

$ ./dbxcli ls test.mp4
Error: path/not_folder/.

Build official binaries for more OS

Due to #64, we will always need an official binary to authorize dbxcli in the dropbox site. Can you build official binaries for more OS?. I think that a good example is syncthing. They build binaries for everything. I would like binaries for at least OpenBSD.

`get` command panics without second argument

The get command currently requires two arguments, a source path and destination path. Running it with one argument, e.g. dbxcli get /dir/file, throws this error:

panic: runtime error: index out of range

goroutine 1 [running]:
panic(0x4b2ce0, 0xc820010070)
    /home/travis/.gimme/versions/go1.6.2.linux.amd64/src/runtime/panic.go:481 +0x3e6
github.com/dropbox/dbxcli/cmd.get(0x7db940, 0xc820011200, 0x1, 0x1, 0x0, 0x0)
    /home/travis/gopath/src/github.com/dropbox/dbxcli/cmd/get.go:31 +0x59a
github.com/dropbox/dbxcli/vendor/github.com/spf13/cobra.(*Command).execute(0x7db940, 0xc8200111b0, 0x1, 0x1, 0x0, 0x0)
    /home/travis/gopath/src/github.com/dropbox/dbxcli/vendor/github.com/spf13/cobra/command.go:561 +0x62c
github.com/dropbox/dbxcli/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x7dd140, 0x7db940, 0x0, 0x0)
    /home/travis/gopath/src/github.com/dropbox/dbxcli/vendor/github.com/spf13/cobra/command.go:651 +0x55c
github.com/dropbox/dbxcli/vendor/github.com/spf13/cobra.(*Command).Execute(0x7dd140, 0x0, 0x0)
    /home/travis/gopath/src/github.com/dropbox/dbxcli/vendor/github.com/spf13/cobra/command.go:610 +0x2d
github.com/dropbox/dbxcli/cmd.Execute()
    /home/travis/gopath/src/github.com/dropbox/dbxcli/cmd/root.go:213 +0x23
main.main()
    /home/travis/gopath/src/github.com/dropbox/dbxcli/main.go:43 +0x14

In this situation I think it would be more intuitive to download the file into the current working directory, just like sftp and similar tools do.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.