TheFox / flickr-cli

A command-line interface to Flickr. Upload and download photos, photo sets, directories via shell.
https://fox21.at
25 stars 9 forks source link

does not automatically create config file #39

Open tacman opened 6 years ago

tacman commented 6 years ago

Following the instructions, after composer install the auth command fails, because there's no config path. Adding the config path fails because there's no config fille.

Could you add a config.yml.dist file to the repo?

I see there's a isConfigRequired property, so maybe this is already handled, but the documentation is perhaps missing something? Or maybe running auth the first time needs to set the isConfigRequired to false?

tac@tac-xps13:/var/www/flickr-cli$ bin/flickr-cli auth --verbose

  [RuntimeException]          
  No config file path found.  

Exception trace:
 () at /var/www/flickr-cli/src/TheFox/FlickrCli/Command/FlickrCliCommand.php:241
 TheFox\FlickrCli\Command\FlickrCliCommand->setupConfig() at /var/www/flickr-cli/src/TheFox/FlickrCli/Command/FlickrCliCommand.php:192
 TheFox\FlickrCli\Command\FlickrCliCommand->setup() at /var/www/flickr-cli/src/TheFox/FlickrCli/Command/AuthCommand.php:61
 TheFox\FlickrCli\Command\AuthCommand->setup() at /var/www/flickr-cli/src/TheFox/FlickrCli/Command/AuthCommand.php:79
 TheFox\FlickrCli\Command\AuthCommand->execute() at /var/www/flickr-cli/vendor/symfony/console/Command/Command.php:240
 Symfony\Component\Console\Command\Command->run() at /var/www/flickr-cli/vendor/symfony/console/Application.php:858
 Symfony\Component\Console\Application->doRunCommand() at /var/www/flickr-cli/vendor/symfony/console/Application.php:216
 Symfony\Component\Console\Application->doRun() at /var/www/flickr-cli/vendor/symfony/console/Application.php:122
 Symfony\Component\Console\Application->run() at /var/www/flickr-cli/bin/flickr-cli:40

auth [-c|--config [CONFIG]] [-f|--force]
Kyshman commented 5 years ago

Still unable to proceed beyond the auth step due to missiong config

./bin/flickr-cli auth --verbose

[RuntimeException] No config file path found.

Exception trace: () at /home/vagrant/flickr-cli/src/TheFox/FlickrCli/Command/FlickrCliCommand.php:241 TheFox\FlickrCli\Command\FlickrCliCommand->setupConfig() at /home/vagrant/flickr-cli/src/TheFox/FlickrCli/Command/FlickrCliCommand.php:192 TheFox\FlickrCli\Command\FlickrCliCommand->setup() at /home/vagrant/flickr-cli/src/TheFox/FlickrCli/Command/AuthCommand.php:61 TheFox\FlickrCli\Command\AuthCommand->setup() at /home/vagrant/flickr-cli/src/TheFox/FlickrCli/Command/AuthCommand.php:79 TheFox\FlickrCli\Command\AuthCommand->execute() at /home/vagrant/flickr-cli/vendor/symfony/console/Command/Command.php:240 Symfony\Component\Console\Command\Command->run() at /home/vagrant/flickr-cli/vendor/symfony/console/Application.php:858 Symfony\Component\Console\Application->doRunCommand() at /home/vagrant/flickr-cli/vendor/symfony/console/Application.php:216 Symfony\Component\Console\Application->doRun() at /home/vagrant/flickr-cli/vendor/symfony/console/Application.php:122 Symfony\Component\Console\Application->run() at /home/vagrant/flickr-cli/bin/flickr-cli:40

auth [-c|--config [CONFIG]] [-f|--force]

Any pointers on how to resolve?

TheFox commented 5 years ago

This will be released in version 2.1. In the meanwhile you can use develop branch, but I wouldn't.

Kyshman commented 5 years ago

Oh! I will wait for version 2.1. In the meantime can you help with a sample config.yml for manual editing?

TheFox commented 5 years ago

@Kyshman Manual editing is not good. Flickr-cli needs to communicate to Flickr to get the token and token_secret.

Here is an example:

flickr:
    consumer_key: <consumer_key>
    consumer_secret: <consumer_secret>
    token: <token>
    token_secret: <token_secret>
phirschybar commented 5 years ago

I am confused by this as well.

~  ./bin/flickr-cli auth --verbose

  [RuntimeException]
  No config file path found.

Exception trace:
 () at /root/flickr-cli/src/TheFox/FlickrCli/Command/FlickrCliCommand.php:241
 TheFox\FlickrCli\Command\FlickrCliCommand->setupConfig() at /root/flickr-cli/src/TheFox/FlickrCli/Command/FlickrCliCommand.php:192
 TheFox\FlickrCli\Command\FlickrCliCommand->setup() at /root/flickr-cli/src/TheFox/FlickrCli/Command/AuthCommand.php:61
 TheFox\FlickrCli\Command\AuthCommand->setup() at /root/flickr-cli/src/TheFox/FlickrCli/Command/AuthCommand.php:79
 TheFox\FlickrCli\Command\AuthCommand->execute() at /root/flickr-cli/vendor/symfony/console/Command/Command.php:240
 Symfony\Component\Console\Command\Command->run() at /root/flickr-cli/vendor/symfony/console/Application.php:858
 Symfony\Component\Console\Application->doRunCommand() at /root/flickr-cli/vendor/symfony/console/Application.php:216
 Symfony\Component\Console\Application->doRun() at /root/flickr-cli/vendor/symfony/console/Application.php:122
 Symfony\Component\Console\Application->run() at /root/flickr-cli/bin/flickr-cli:40

It is unclear how to proceed at this point.

phirschybar commented 5 years ago

I got this to work. I made a file in a new directory data/config.yml with the following contents:

flickr:
    consumer_key: <consumer_key>
    consumer_secret: <consumer_secret>
    token: 
    token_secret: 

then ./bin/flickr-cli auth --config=data/config.yml

then every command being run, like ./bin/flickr-cli --config=data/config.yml upload [DIRECTORY] should include that --config=data/config.yml option.

This is a very cool library @TheFox ! I would love to contribute if you are accepting. I just got back into Flickr after many years off it... pretty much after they got acquired by yahoo... but am excited to see what SmugMug will do with it. cheers 🍻

TheFox commented 5 years ago

This is a very cool library

Thank you very much. :)

I would love to contribute if you are accepting

Sure, of course you can contribute if you like.

If you are inside Docker you always have to use the full path. Otherwise the current directory will be used to create the config.yml file.

Kyshman commented 5 years ago

I got this to work. I made a file in a new directory data/config.yml with the following contents: @phirschybar Used the same process and now able to proceed without no errors.