Skip to content

Feature request: add config command #629

@jwx

Description

@jwx

I'm submitting a feature request

Current behavior:
The CLI doesn't have an easy way to modify the project configuration.

Desired behavior:
I've created a CLI command according to the following:


au config <key> <value> --get --set --clear --add --remove --no-save --no-backup

Gets or sets configuration for the Aurelia application.

key (optional) - The key you want to get or set. Supports hierarchies and array indexes, for example build.targets[0] and arrayWithArray[2].[1]

value (optional) - The value you want to set the key to. Supports json, for example "{ \"myKey\": \"myValue\" }"

--get - Gets the content of key, ignoring value parameter (the same as not specifying a value).

--set - Sets the content of key to value, replacing any existing content.

--clear - Deletes the key and all its content from the configuration.

--add - If value or existing content of the key is an array, adds value(s) to existing content. If value is an object, merges it into
existing content of key.

--remove - If value or existing content of the key is an array, removes value(s) from existing content. If value or existing content of the
key is an object, removes key(s) from existing content of key.

--no-save - Don't save the changes.

--no-backup - Don't create a backup configuration file before saving changes.

If this is interesting I could easily make a PR.

  • What is the motivation / use case for changing the behavior?

Not having a command to use for configuration changes makes scripting (as well as tutorials) more complicated than it has to be.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions