Open kyrvlasiuk opened 3 years ago
This is a pretty neat idea! Happy to assign it to you.
That is a really neat idea. It would very valuable for any project to have a configuration-cli
out of the box with Taml that simply checks that the configuration is valid especially when this is enriched with schema definitions.
I would go so far to call the NuGet Package TamlTool
and the assembly taml
.
I also suggest that when you run taml
command without any arguments in a directory that has only one taml file in it to just load that one taml file in interactive mode. I have the assumption that in most cases there is only one taml configuration in a directory but if there are more files than it let's you select which taml to open.
Also down the line I can envision that something like taml new http://path/to/MyFancy.schema.taml
could be possible to create a kind of guided wizard to create an initial configuration of an application through special capabilities of schema.
Basically a tool that everything that uses Taml to configure stuff to have out of the box. That would be a really big feature to choose Taml.
It would let users browse and make changes to TAML file from command-line without a need to open a full file for edit.
Comment: I know it would help me focus, as I sometimes change the wrong values, but I would like input on whether it would be helpful to somebody else.
I suggest interactive and detached mode.
Take this
file.taml
for exampleInteractive:
to open file in interactive
TamlTool ./file.taml -i
to list all top level keysfile.taml>ls
to list entire filefile.taml>ls -r
to change namefile.taml>post /name This is new name
to get a valuefile.taml>get /name
to add value to arrayfile.taml>post /comment This is a third comment
to change value in arrayfile.taml>post /comment/1 A first comment
to add value in associative arrayfile.taml>post /commands/new This is new command
to change value in associative arrayfile.taml>post /commands/add This is old command
to change context to keyfile.taml>cd commands
can be executed in context of document or current contextfile.taml/commands> get ./add
file.taml/commands> get /commands/add
In Detached mode command are executed in context of a document.
TamlTool ./file.taml -c post /comment This is detached comment
This would result to a file
Comment: spaces represent tab as github issue editor does not allow tabbing.
This tool can be implemented as dotnet global tool.
This is just a draft for an idea, but I would like to work on on it, if someone is interested.