A free, self-hostable aggregator…
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Alexandre Alapetite f3d5cbd7da Underscore missing in documentation 8 years ago
..
.htaccess CLI list-users and create-user 8 years ago
README.md Underscore missing in documentation 8 years ago
_cli.php CLI do-install 8 years ago
actualize-user.php +x execution rights actualie-user 8 years ago
create-user.php Fix small bugs in install 8 years ago
delete-user.php CLI export 8 years ago
do-install.php Underscore missing in documentation 8 years ago
export-opml-for-user.php CLI typo in usage example 8 years ago
export-zip-for-user.php CLI minor formatting 8 years ago
import-for-user.php CLI export 8 years ago
index.html CLI list-users and create-user 8 years ago
list-users.php CLI import ZIP/OPML/JSON for user 8 years ago
user-info.php +x execution rights user-info 8 years ago

README.md

FreshRSS Command-Line Interface (CLI)

Note on access rights

When using the command-line interface, remember that your user might not be the same as the one used by your Web server. This might create some access right problems.

It is recommended to invoke commands using the same user as your Web server:

cd /usr/share/FreshRSS
sudo -u www-data sh -c './cli/list-users.php'

In any case, when you are done with a series of commands, you should re-apply the access rights:

cd /usr/share/FreshRSS
sudo chown -R :www-data .
sudo chmod -R g+r .
sudo chmod -R g+w ./data/

Commands

Options in parenthesis are optional.

cd /usr/share/FreshRSS

./cli/do-install.php --default_user admin ( --auth_type form --environment production --base_url https://rss.example.net/ --title FreshRSS --allow_anonymous --api_enabled --db-type mysql --db-host localhost:3306 --db-user freshrss --db-password dbPassword123 --db-base freshrss --db-prefix freshrss )
# --auth_type can be: 'form' (default), 'http_auth' (using the Web server access control), 'none' (dangerous)
# --db-type can be: 'sqlite' (default), 'mysql' (MySQL or MariaDB), 'pgsql' (PostgreSQL)
# --environment can be: 'production' (default), 'development' (for additional log messages)
# --db-prefix is an optional prefix in front of the names of the tables. We suggest using 'freshrss_'
# This command does not create the default user. Do that with ./cli/create-user.php

./cli/create-user.php --user username ( --password 'password' --api-password 'api_password' --language en --email user@example.net --token 'longRandomString' --no-default-feeds )
# --language can be: 'en' (default), 'fr', or one of the [supported languages](../app/i18n/)

./cli/delete-user.php --user username

./cli/list-users.php
# Return a list of users, with the default/admin user first

./cli/actualize-user.php --user username

./cli/import-for-user.php --user username --filename /path/to/file.ext
# The extension of the file { .json, .opml, .xml, .zip } is used to detect the type of import

./cli/export-opml-for-user.php --user username > /path/to/file.opml.xml

./cli/export-zip-for-user.php --user username ( --max-feed-entries 100 ) > /path/to/file.zip

./cli/user-info.php -h --user username
# -h is to use a human-readable format
# --user can be a username, or '*' to loop on all users
# Returns a * if the user is admin, the name of the user, the date/time of last action, and the size occupied

Unix piping

It is possible to invoke a command multiple times, e.g. with different usernames, thanks to the xargs -n1 command.

Example showing user information for all users which username starts with 'a':

./cli/list-users.php | grep '^a' | xargs -n1 ./cli/user-info.php -h --user

Example showing all users ranked by date of last activity:

./cli/user-info.php -h --user '*' | sort -k2 -r