Command Line Interface (CLI)

Discussion and help for non spanish users.

Moderator: a-slack

Forum rules
If you have any problem or just want to know something, be sure to
follow this procedure:

- Look at the FAQ and the documentation.
- Try to find your answer in the forum using the search engine.
- Post your issue including all possible information like operative
system, Tucan's version, log ...)

Command Line Interface (CLI)

Postby a-slack » Sat Oct 10, 2009 9:29 pm

The version 0.3.9 of Tucan has been the first version which could be managed with a Command Line Interface (CLI) without depend of a graphic environment (without the X Windows system).

This funcionality has been tested in several X terminal emulators (xterm, aterm, rxvt-unicode, gnome-terminal, ...) and several TTYs (with and without framebuffer) of different machines with positive results, but this doesn't mean it is free of bugs, bugreports are wellcome ;)

This is an early version and it is incomplete, doesn't got implemented all funcionalities that already has Tucan in its Graphical User Interface (GUI) but is something functional.


    Some things you can do right now with Tucan through its CLI are:
      - Update services.

      - Enable (or Disable) services.

      - Configure (or Reconfigure) premium accounts.

      - Perform downloads.

    Some things that for the moment doesn't have CLI:
      - There isn't sessions system through CLI (* fixed in version 0.3.10).

      - There isn't advanced packages configuration through CLI.

      - There aren't automatic updates through CLI (but they can be done by hand).

      - There isn't option to configure the default downloads directory through CLI (by default is the $HOME of the user but it can be configured editing the file $HOME/.tucan/tucan.conf, option "downloads_folder").

      - There isn't option to limit the download speed through CLI (by default there isn't speed limit but it can be configured editing the file $HOME/.tucan/tucan.conf, option "max_download_speed").

      - There isn't option to limit the number of simultaneous downloads through CLI (by default are 5 but it can be configured editing the file $HOME/.tucan/tucan.conf, option "max_downloads").

      - There aren't options to configure a proxy through CLI (but it can be configured editing the file $HOME/.tucan/tucan.conf, options "enable_proxy", "proxy_url" and "proxy_port").


Tucan can be used through a Graphical User Interface (GUI) or through a Command Line Interface (CLI). Running Tucan without options starts its GUI but with options starts its CLI.

The following options are to use Tucan through its CLI.

OPTIONS:

Available options (for the moment) are:

$ tucan --help
Usage: tucan [options]

Options:
-h, --help show this help message and exit
-w TYPE, --wizard=TYPE
setup: accounts, services, updates
-d, --daemon no interaction interface
-c, --cli command line interface
-i FILE, --input-links=FILE
import links from FILE
-v, --verbose print log to stdout
-V, --version print version and exit




    Generic Program Information
      -h, --help : Print a usage message briefly summarizing these command-line options and then exit.
      -V, --version : Print the version number of Tucan to the standard output. This version number should be included in all bug reports.

    Configuration Options
      -w TYPE, --wizard=TYPE : Configure some Tucan options. Available TYPEs:
        - accounts option to configure premium accounts.
        - services option to enable/disable services.
        - updates option to launch the Update Manager.

    Common Options
      -c, --cli : option to launch the CLI with interactivity.
      -d, --daemon : option to launch the CLI without interactivity.
      -v, --verbose : option to display all log messages in the CLI with interactivity (by default only shows the log messages >= INFO).

    Download Options
      -i FILE, --input-links=FILE : import links from FILE.
        The FILE format is pretty simple:
          - Plain text.
          - A link per line.
          - Lines beginning with # are ignored (are treated as comments).


EXAMPLES:


    Update services:

    Enable (or Disable) services:
      Code: Select all
      $ tucan --wizard services

      or
      Code: Select all
      $ tucan -w services

      and follow the instructions on screen.

    Configure (or Reconfigure) premium accounts:
      Code: Select all
      $ tucan --wizard accounts

      or
      Code: Select all
      $ tucan -w accounts

      and follow the instructions on screen.

    Simple download with interactivity (see above for FILE format):

    Simple download without interactivity (see above for FILE format):


If there isn't local user configuration when launch any configuration wizard it will be created in $HOME/.tucan/
After having a local user configuration the file $HOME/.tucan/tucan.conf can be edited to set some options that can't yet be passed to CLI with parameters (options such as: default download directory, download speed limit, maximum number of simultaneous downloads ... etc).
Users with graphical environment also have the possibility to launch the GUI of Tucan and set all options in the preferences window, those options will be used later when using the CLI.

When launching CLI with interactivity (-c or --cli) in the most common case (tucan --wizard updates && tucan --cli --input-links FILE.txt) you can see something like this:

Image

Image

KEYS & MONITORING:

At the moment the keys available when using the CLI with interactivity (-c or --cli) are:

    "q" (or "Q") : close the application.

To monitor what is happen when using the CLI there are basically a thing, the log of Tucan ($HOME/.tucan/tucan.log):

    To see what happens you can use something like:
      Code: Select all
      $ cat $HOME/.tucan/tucan.log

      or
      Code: Select all
      $ grep "whatever" $HOME/.tucan/tucan.log

      or similar.

    To see everything what happens in real time you can use something like:
      Code: Select all
      $ tail -f $HOME/.tucan/tucan.log

      or similar.

To see the download speed you can use some tool like bwm-ng or iptraf or similar. When using the CLI with interactivity (-c or --cli) already has this information.
a-slack
Senior Tester
 
Posts: 374
Joined: Thu May 21, 2009 1:32 am

Re: Command Line Interface (CLI)

Postby a-slack » Sat Jan 01, 2011 7:38 pm

Updated to version 0.3.10 :


Added "sessions system" to the CLI
    The FILE containing the list of links is edited each time a download is finished by adding a '#' at the beginning of the line with the finished link.
    If the FILE is reused that line is treated as a comment.


Added option to remove all configuration of Tucan.

$ tucan --help
Usage: tucan.py [options]

Options:
-h, --help show this help message and exit
-w TYPE, --wizard=TYPE
setup: accounts, services, updates
-d, --daemon no interaction interface (URL)
-c, --cli command line interface (URL)
-C, --clean remove ~/.tucan
-i FILE, --input-links=FILE
import links from FILE
-v, --verbose print log to stdout
-V, --version print version and exit


    Configuration Options
      -C, --clear : remove all configuration of Tucan (remove $HOME/.tucan/).


Fixed some bugs related to the CLI.
a-slack
Senior Tester
 
Posts: 374
Joined: Thu May 21, 2009 1:32 am


Return to International

Who is online

Users browsing this forum: No registered users and 1 guest