Skip to content

CLI: Command-Line Interface#1338

Merged
Alkarex merged 24 commits intoFreshRSS:devfrom
Alkarex:cli
Oct 24, 2016
Merged

CLI: Command-Line Interface#1338
Alkarex merged 24 commits intoFreshRSS:devfrom
Alkarex:cli

Conversation

@Alkarex
Copy link
Copy Markdown
Member

@Alkarex Alkarex commented Oct 22, 2016

@Alkarex Alkarex added the Work in progress 🚧 Wait before merging label Oct 22, 2016
@Alkarex Alkarex added this to the 1.7.0 milestone Oct 22, 2016
@Alkarex
Copy link
Copy Markdown
Member Author

Alkarex commented Oct 23, 2016

Usage:

./cli/do-install.php --default_user admin --auth_type form  ( --environment production --base_url https://rss.example.net/ --language en --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 )
# 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 [email protected] --token 'longRandomString' --no-default-feeds )

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

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

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

./cli/import-for-user.php --user username --filename /path/to/file.ext

./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

@Alkarex
Copy link
Copy Markdown
Member Author

Alkarex commented Oct 23, 2016

@plopoyop @oupala @ingelres @Jucgshu Comments welcome for this draft of Command Line Interface for FreshRSS

@Alkarex Alkarex added Framasoft 🐇 and removed Work in progress 🚧 Wait before merging labels Oct 24, 2016
vertical-align: middle;
}

select{
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@plopoyop I have made this small change to your Pafat theme, otherwise the multi-line select was much too small in the export page.

@lapineige
Copy link
Copy Markdown

lapineige commented Oct 24, 2016

A tough from this issue #1342 :

I just saw that the new CLI can be really handy to make some (automated) backups on a regular base: #1338

Thanks to this command: ./cli/export-opml-for-user.php --user username > /path/to/file.opml.xml
(question: what's the difference with export-zip ?)
Actually I'm doing backups by making a copy of all the files, but I could improve it by exporting the feeds thanks to this CLI, and also backup the settings, and the status of the feeds (to save the unread list for instance). edit: I forgot the zip include the feeds content
Do you think that would be a good addition, as an extension to automate it, or if I should just document the cron tasks I'll use ?

@Alkarex
Copy link
Copy Markdown
Member Author

Alkarex commented Oct 24, 2016

@lapineige export-zip.php exports a ZIP with an OPML, favourites, and feeds content.
For your full back-up, you could just dump your database https://github.com/FreshRSS/FreshRSS/tree/dev#backup
I do not think it makes sense to have an extension for that. Just a better documentation. If anything, I am considering making an additional CLI to export/import to SQLite, to ease a migration between different databases or systems.

@lapineige
Copy link
Copy Markdown

@lapineige export-zip.php exports a ZIP with an OPML, favourites, and feeds content.

Sorry I made a confusion, I forgot that I'm doing this with a zip and not just the opml.

For your full back-up, you could just dump your database https://github.com/FreshRSS/FreshRSS/tree/dev#backup

Ok thanks.

I do not think it makes sense to have an extension for that. Just a better documentation.

I do agree. Can I help here ?
I might include a cron task somewhere, in the doc' or in a tutorial, so people have it directly if they want to.
(even if it's very simple, you would not need to reinvent the wheel)

If anything, I am considering making an additional CLI to export/import to SQLite, to ease a migration between different databases or systems.

I do not have such needs (well, I'm not planning to stop using FreshRSS 😃), but it can be an option if someone raise this need someday.

@Alkarex
Copy link
Copy Markdown
Member Author

Alkarex commented Oct 24, 2016

I meant to migrate between MySQL <-> SQLite <-> PostgreSQL :-)
Yes, your help would indeed be greatly appreciated in the documentation https://github.com/FreshRSS/documentation 👍
For instance, there is nothing on the CLI so far... If you have more energy, there is a number of things written in GitHub issues, which should be put in the documentation as well. E.g. the issues with a "documentation" tag https://github.com/FreshRSS/FreshRSS/issues?q=label%3ADocumentation

@Alkarex Alkarex merged commit 062c65d into FreshRSS:dev Oct 24, 2016
@Alkarex Alkarex deleted the cli branch October 24, 2016 22:37
@Alkarex
Copy link
Copy Markdown
Member Author

Alkarex commented Oct 24, 2016

Targetting FreshRSS 1.6 for this week-end. Tests welcome #1328

@Jucgshu
Copy link
Copy Markdown
Contributor

Jucgshu commented Oct 25, 2016

Tested both opml & zip export with cli. Works like a charm !

Awesome new feature !

@Alkarex
Copy link
Copy Markdown
Member Author

Alkarex commented Oct 25, 2016

Thanks for the tests!

Alkarex added a commit that referenced this pull request Oct 25, 2016
@oupala
Copy link
Copy Markdown
Contributor

oupala commented Feb 27, 2017

I'm actively testing the cli feature in order to finalize the ansible playbook that could install FressRSS from A to Z.

See my first feedback in #1443.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants