sgeb / acdcli Goto Github PK
View Code? Open in Web Editor NEWCommand line tool for Amazon Cloud Drive
License: ISC License
Command line tool for Amazon Cloud Drive
License: ISC License
% acdcli get Documents/Subfolder/file.txt
It should:
Documents/Subfolder/file.txt
and store as file.txt
in the current working directory/
as optional in the command argumentfile.txt
already exists in current working directory/
is presentCopy a single file for now, support globs and whole folders at a later point.
For example:
% acdcli cp /Documents/Samples/sample.jpg /Documents/Pictures
Currently acdcli storage
displays used storage, grouped by category. It should also display quota information.
% acdcli ls /Documents
--- AnotherFolder/
--- SubFolder/
1.2 MiB example.jpg
4 B sample.txt
% acdcli get /Documents/Subfolder/file.txt ~/Desktop/anotherfile.txt
It should:
Documents/Subfolder/file.txt
and store as anotherfile.txt
in directory $HOME/Desktop
/
as optional in the remote node path argument~
, /
, .
, etc)anotherfile.txt
already exists in target directory/
is present in remote node pathDepends on issue #7.
Hi,
I noticed that you plan to embed Amazon's client id and secret in the binary. While this is convinient, this is also insecure.
wmn@cratos ~/code/src/github.com/sgeb/acdcli [master] ± % ACD_API_CLIENTID="amzn1.application-oa2-client.this_is_a_hash" ACD_API_SECRET="this_is_a_secret" make dev
==> Getting dependencies...
>> Getting package github.com/sgeb/go-acd
>> Getting package golang.org/x/oauth2
>> Getting package github.com/mitchellh/cli
>> Getting package github.com/dustin/go-humanize
>> Getting package github.com/mitchellh/gox
package github.com/mitchellh/cli
imports golang.org/x/crypto/ssh/terminal: golang.org/x/crypto is a custom import path for https://go.googlesource.com/crypto, but /Users/wmn/code/src/golang.org/x/crypto is checked out from https://code.google.com/p/go.crypto
>> Setting github.com/dustin/go-humanize to version
>> Setting golang.org/x/oauth2 to version
>> Setting github.com/mitchellh/cli to version
>> Setting github.com/sgeb/go-acd to version
>> Setting github.com/mitchellh/gox to version
>> Building package github.com/sgeb/go-acd
>> Building package golang.org/x/oauth2
>> Building package github.com/mitchellh/cli
>> Building package github.com/dustin/go-humanize
>> Building package github.com/mitchellh/gox
>> All Done
==> Removing old directory...
==> Building...
Number of parallel builds: 8
--> darwin/amd64: github.com/sgeb/acdcli/acdcli
==> Results:
total 15024
-rwxr-xr-x 1 wmn staff 7.3M May 22 10:25 acdcli
wmn@cratos ~/code/src/github.com/sgeb/acdcli [master] ± % strings ~/code/bin/acdcli| grep 'a_hash\|a_secret'
this_is_a_secret
amzn1.application-oa2-client.this_is_a_hash
Although the secret does not have a known guessable prefix, it is always 64 chars which is easy guessable.
Take a look at https://github.com/caseymrm/drivesink, they have the client/secret hosted on a website and the users only get their access token and refresh token.
Move a single file for now, support globs and whole folders at a later point.
For example:
% acdcli mv /Documents/Samples/sample.jpg /Documents/Pictures
ls
accepts multiple parameters on the commandlineshare
and unshare
os.IsPathSeparator
)sync
% acdcli get /Documents/Subfolder/file.txt ~/Desktop/
It should:
Documents/Subfolder/file.txt
and store as file.txt
in directory $HOME/Desktop
/
as optional in the remote node path argument/
as optional in the target directory argument~
, /
, .
, etc)file.txt
already exists in target directory/
is present in remote node pathDepends on issue #6.
Passing the -d/--debug argument enables debug output.
% acdacli info /Documents/Subfolder/file.txt
[... metadata as json ...]
It should:
Documents/Subfolder/file.txt
as pretty-printed JSON/
as optional in the command argument/
is present and the deepest node is not a directoryDocuments/Subfolder/file.txt
does not exist% acdcli ls /Documents/Subfolder
AnotherFolder/
example.jpg
sample1.txt
test.txt
It should:
Documents/Subfolder
if it is indeed a folder/
as optional in the command argument/
is present and the deepest node is not a directoryAdd a command ls
to list the names of nodes in the root folder:
% acdcli ls
AAA/
Something/
abc/
zzz/
Afile.txt
Bfile.txt
anotherfile.txt
zfile.txt
The output should:
/
to folder namesA declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.