Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add examples for the CLI tool #38

Closed
flying-sausages opened this issue Sep 17, 2020 · 4 comments
Closed

Please add examples for the CLI tool #38

flying-sausages opened this issue Sep 17, 2020 · 4 comments

Comments

@flying-sausages
Copy link

Type: Documentation Issue

Summary

It would be nice to see what the CLI tool can offer without having to install flood first. I'm wondering whether to migrate to this fork but I'd like to automate user creation and password changing through scripts for example, so this would be nice to see.

@jesec
Copy link
Owner

jesec commented Sep 18, 2020

Run flood --help, npx flood --help or npm run start -- --help to get help about command line arguments.

If you want to know more about configurations, check config.template.js. Command line interface made everything in config.js configurable via command line.

Unfortunately, currently command line interface does not provide more capability than what was defined in config.js. Specifically, it can NOT manipulate database to create user or change password of a user.

However, you will be able to do that by calling APIs* directly. It is simple JSON.

* Disclaimer: Currently those are internal APIs of Flood and are meant to be used by frontend only. I can't guarantee API stability or proper documentation of a breaking change or semver conventions. This policy may change in the future if there are respectable and useful use cases of Flood's APIs.

@flying-sausages
Copy link
Author

The one use case i could think of is seedbox providers setting up environments for their clients, and user administration would be a large part of that. I'm wondering if the CLI tool could function as a wrapper for this API with sanitisation etc.

@jesec
Copy link
Owner

jesec commented Sep 18, 2020

Main CLI is designed as an "entry point" for Flood (Flood is launched by it). It would be inappropriate to incorporate such features into this interface.

We would need to create a separate CLI tool for such purposes. It can be named "floodctl" for example.

I don't think such tool would be necessary, though. You can just call Flood's API (for instance, POST a JSON object with credentials to http://127.0.0.1:3000/auth/register will create a user) via any HTTP client (eg. curl).

@jesec
Copy link
Owner

jesec commented Nov 5, 2020

Hi, @flying-sausages ,

I believe your question is already answered. Could you please close this issue if there is no further question?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants