hairizuanbinnoorazman / tasker

Create tasks from CLI and post it to task management platforms
1 stars 0 forks source link

Adding the init command #9

Open hairizuanbinnoorazman opened 6 years ago

hairizuanbinnoorazman commented 6 years ago

In order to make it easier for new users of the cli tool to use the tool effectively, we would need to have an init command. The init command would be use to initialize the initial set of configurations for the user of the cli tool

We would save the file in the default directory: ~/.tasker/config.json

For now, we would only be using json configuration files. Future iterations might allow usage of yaml or even toml files.

Current design of the initialize configuration:

{
    "PrimaryTool": {
        "Name": "asana",
        "Token": "example-token",
        "DefaultProjectID": "example-default-project"
    },
    "SecondaryTools": [
        {
            "Name": "github",
            "Token": "example-token",
            "DefaultProjectID": "example-default-project"
        }
    ],
    "Copy": false
}

We would primarily utilize the primary tool right now. The secondary tools features is not yet fully implemented but should be implemented as well. Unfortunately, if we use viper such configurations, we would face issues in parsing the secondary tools - it reads it as a list of interfaces, resulting problems in parsing it down to the application