View RawView Code

Configuration Guide

This guide covers advanced configuration options, settings management, and customization features of the CCLS Games CLI Tool.

Table of Contents

  1. Configuration Overview
  2. Settings File Structure
  3. Directory Configuration
  4. Cache Management
  5. Credential Management
  6. Logging Configuration
  7. Startup Messages
  8. Performance Tuning
  9. Security Settings
  10. Advanced Options

Configuration Overview

The CLI Tool stores its configuration in the settings/ folder within the script directory:
[CLI Tool Directory]/
├── CLI.ps1
├── settings/
│   ├── settings.json          # Main configuration
│   ├── credentials.dat         # Encrypted login credentials
│   ├── lib.json               # Library cache
│   └── start-message/         # Startup message templates
│       ├── default/
│       │   ├── template.json
│       │   └── info.txt
│       └── [template_name].json
└── logs/                      # Session logs
    └── ccls_session_*.log

Settings File Structure

settings.json

The main configuration file containing user preferences and system settings:
{
    "RememberLogin": true,
    "DownloadPath": "C:\\Games\\CCLS-Games",
    "TempDownloadPath": "C:\\Temp\\CCLS-Downloads",
    "HasCompletedSetup": true,
    "Version": "2.1.5",
    "DevMode": false
}

Configuration Parameters

RememberLogin

DownloadPath

TempDownloadPath

HasCompletedSetup

Version

DevMode

Directory Configuration

Initial Setup

Configure directories using the interactive setup command:
CCLS>setup

Manual Configuration

Edit the settings.json file directly to change paths:
{
    "DownloadPath": "D:\\Games\\CCLS",
    "TempDownloadPath": "E:\\Temp\\Downloads"
}

Path Requirements

Download Path

Temp Download Path

Path Validation

The CLI Tool validates paths during: Invalid paths trigger:

Cache Management

Library Cache (lib.json)

Stores metadata about installed games for fast access:
{
    "lastUpdated": "2024-01-15 14:30:25",
    "totalGames": 25,
    "totalSize": 524288000000,
    "totalSizeFormatted": "488.28 GB",
    "games": [
        {
            "folderName": "The Long Drive",
            "gameName": "The Long Drive",
            "gameId": "cg0023",
            "localVersion": "1.2.0",
            "localSize": 2147483648,
            "localSizeFormatted": "2.00 GB",
            "localPath": "C:\\Games\\CCLS-Games\\The Long Drive",
            "hasMetadata": true,
            "isOutdated": false,
            "onlineVersion": "1.2.0",
            "jsonLastModified": "2024-01-15 10:15:30"
        }
    ]
}

Cache Management Commands

CCLS>sys cache status              # View cache information
CCLS>sys cache refresh             # Rebuild cache

Cache Invalidation

The cache is automatically refreshed when:

Manual Cache Maintenance

For corrupted or outdated cache:
  1. Delete settings/lib.json
  2. Restart CLI Tool
  3. Cache will be rebuilt automatically

Credential Management

Storage Method

Credentials are encrypted using Windows Data Protection API (DPAPI):

Credential File (credentials.dat)

Binary file containing encrypted login information:

Security Features

Credential Commands

CCLS>forget                        # Remove stored credentials
CCLS>logout                        # Log out and clear session

Security Best Practices

Logging Configuration

Log File Naming

ccls_session_YYYY-MM-DD_HH-mm-ss.log

Log Levels

The CLI Tool uses different log entry types:

Log Retention

Log Management

CCLS>log list                      # Browse and manage logs
CCLS>log del [filename]            # Delete specific log

Privacy Considerations

Logs may contain:

Startup Messages

Template System

Customizable welcome screens displayed after login.

Template Structure

{
    "template": {
        "type": "static",
        "messages": [
            {
                "text": "Welcome to CCLS Games!",
                "color": "Green",
                "newline": true
            },
            {
                "text": "Ready to game? ",
                "color": "Cyan",
                "newline": false
            }
        ]
    }
}

Dynamic Templates

Special templates that show real-time data:

Template Management

CCLS>sys start-message list              # Available templates
CCLS>sys start-message get [name]        # Download template
CCLS>sys start-message enable [name]     # Enable template
CCLS>sys start-message default           # Disable custom messages

Custom Template Creation

  1. Create JSON file with template structure
  2. Place in settings/start-message/ folder
  3. Enable using sys start-message enable [name]

Performance Tuning

Download Performance

Cache Performance

Memory Optimization

System Requirements Optimization

CCLS>check                         # Verify optimal configuration

Security Settings

PowerShell Execution Policy

Required setting for script execution:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

File System Permissions

Ensure appropriate permissions:

Network Security

Data Protection

Advanced Options

Developer Mode

Enable for testing and development:
CCLS>devmode                       # Toggle developer mode
Features in Developer Mode:

Environment Variables

The CLI Tool respects these environment variables:

Command Line Parameters

Currently, the CLI Tool doesn't support command-line parameters, but this may be added in future versions.

Debugging Features

For troubleshooting:

Backup and Restore

Configuration Backup

To backup your configuration:
  1. Copy the entire settings/ folder
  2. Store in secure location
  3. Restore by copying back to CLI Tool directory

Game Metadata Backup

Game metadata is stored in:

Restore Process

  1. Copy settings folder to new installation
  2. Update paths in settings.json if needed
  3. Run sys cache refresh to rebuild cache
  4. Verify with check command

Migration Between Systems

When moving to a new computer:
  1. Copy CLI Tool directory
  2. Update paths in settings.json
  3. Clear credentials.dat (machine-specific)
  4. Re-run setup if needed
  5. Re-authenticate with login

Troubleshooting Configuration

Common configuration issues: