Function Signature
Description
Sets a configuration value for the specified key in the ScryxCLI configuration file. This function updates the configuration object and persists the changes to~/.scrycli/config.json. The configuration is written with pretty-printing (2-space indentation) for readability.
Parameters
The configuration key to set. This will be used as the property name in the configuration object.
The value to associate with the key. Can be any JSON-serializable value including strings, numbers, booleans, objects, or arrays.
Usage
Examples
Set String Configuration
Set Boolean Configuration
Set Number Configuration
Set Object Configuration
Set Array Configuration
Update Existing Configuration
Error Conditions
- If the configuration file cannot be written, a filesystem error will be thrown
- If the value cannot be serialized to JSON (e.g., circular references), a
TypeErrorwill be thrown - If the configuration directory cannot be accessed, a filesystem error will be thrown
Notes
- Overwrites the value if the key already exists
- The configuration file is formatted with 2-space indentation for readability
- This function performs synchronous file I/O operations
- All values must be JSON-serializable (functions, symbols, and undefined values will be omitted or cause errors)