RawCMS icon indicating copy to clipboard operation
RawCMS copied to clipboard

Cli interface

Open zeppaman opened this issue 6 years ago • 2 comments

User story

Create a Cli application (.exe), based on .net core that manage:

  • first parameter the commend to execute
  • parameters used fro command.

task

microframework can be used to manage arguments [this is a valid example] (https://github.com/commandlineparser/commandline)

Commands:

  • list (entity type): list all entries for a given entity type
  • save (entity type, file path): save file document into collection.
  • remove (entity type, id ): remove entity from database collection
  • sync: take all items into current dir, in the way that
    • folder name match collection name
    • all items inside the folder will be saved (upsert)
    • all items in database not found in file system will be deleted (-- delete options)
    • user can have a dry run to see what will append befor apply changes (--dry-run)

raw-cli

Examples

raw-cli list users raw-cli list users -id 24 raw-cli save users -f user.json raw-cli remove users -id 34 raw-cli sync --project-folder C:\test\ --delete --dry-run

note list and remove take id arguments as imput. in this case all arguments are applied by name\value and all parameters compose document sample to use for query data.

All interaction will be using CRUD service into application.

login

After task for autentication, login\logout commands will be added to command list. Basically login will take the authorization token while logout will clear\revoke it.

acceptance criteria

  • user can run cli to change config without accessing database

  • user can run cli to sycn configuration

  • [x] logging

  • [x] login

  • [x] login kubernetes like

  • [ ] list

  • [ ] save\update

  • [ ] sync from folder (with --delete option)

  • [ ] dryrun

  • [ ] delete

zeppaman avatar Sep 17 '18 17:09 zeppaman

Some update after login implementation:

  • token can be obtained using token endpoin (oauth standard)
  • token can be set as static apikey (no endpoin call, just set it as constant value)

Some updates on configuration implementation: configuration is treated as a regular system collection (no validation provided atm)

zeppaman avatar Nov 26 '18 18:11 zeppaman

@girardengo after your last pull request, this task progress are updated?

zeppaman avatar Mar 18 '19 06:03 zeppaman