Skip to main content

Overview

ScryCLI uses a JSON-based configuration system to store user preferences, authentication tokens, and model settings. The configuration is automatically created on first run and persists across sessions.

Configuration File Location

The configuration file is stored at:
~/.scrycli/config.json
This location is defined in src/config/configManage.ts:5 and uses the system’s home directory regardless of your operating system.
The configuration directory and file are automatically created if they don’t exist when you first run ScryCLI.

Configuration Structure

The config file follows this JSON structure:
{
  "user": {
    "token": "your-auth-token",
    "userId": "your-user-id"
  },
  "model": {
    "modelProvider": "openai",
    "modelName": "openai/gpt-oss-120b:free",
    "modelKey": "your-api-key"
  }
}

Configuration Fields

FieldTypeDescription
user.tokenstringAuthentication token obtained from scrycli.tech
user.userIdstringYour unique user identifier
model.modelProviderstringAI provider name (openai, qwen, mistral, etc.)
model.modelNamestringSpecific model identifier
model.modelKeystringAPI key for the selected provider

How It Works

Automatic Initialization

When ScryCLI starts, it checks for the configuration file:
const configPath = path.join(os.homedir(), ".scrycli", "config.json");

if(!fs.existsSync(configPath)){
    fs.mkdirSync(path.dirname(configPath), {recursive:true})
    fs.writeFileSync(configPath, JSON.stringify({}));
}
If the file doesn’t exist, ScryCLI creates an empty configuration object.

Configuration Operations

ScryCLI provides three core configuration operations:
1

Reading Configuration

The getConfig() function reads the entire configuration:
const config = getConfig();
console.log(config.model.modelName);
2

Setting Values

The setConfig(key, value) function updates configuration values:
setConfig('model', {
  modelProvider: 'openai',
  modelName: 'openai/gpt-oss-120b:free'
});
3

Deleting Values

The deleteConfig(key) function removes configuration keys:
deleteConfig('user'); // Removes user authentication

Manual Configuration

You can manually edit the configuration file if needed:
1

Locate the file

cd ~/.scrycli
2

Edit with your preferred editor

nano config.json
# or
vim config.json
3

Ensure valid JSON syntax

The file must contain valid JSON. Use a JSON validator if unsure.
Manual edits to the configuration file can break ScryCLI functionality if the JSON structure is invalid. Always ensure proper formatting.

Configuration Validation

ScryCLI validates your configuration before allowing model interactions. The validation checks:
  • Model name is set and not empty
  • Model API key is set and not empty
This validation happens in src/lib/isModelSelected.ts:6-15:
const isModelSelected = (): boolean => {
    try{
        const config = getConfig();
        if (!config?.model?.modelName) return false;
        if (!config?.model?.modelKey) return false;
        return config.model.modelName !== '' && config.model.modelKey !== '';
    }catch(error){
        return false;
    }
};

Next Steps

Configure API Keys

Set up authentication for AI providers

Select Models

Choose and configure AI models