CLI Configuration
Learn how to configure the LeetCode Ghost Window CLI to customize its behavior to your needs.
Configuration Basics
The LeetCode Ghost Window CLI uses a configuration store to save your settings. These settings are persisted between sessions and are stored securely on your machine.
Configuration File Location
The configuration is stored in a JSON file located in your system's default config directory:
Windows
%APPDATA%\leetcode-joseok\config.json
macOS
~/Library/Preferences/leetcode-joseok/config.json
Linux
~/.config/leetcode-joseok/config.json
Note: We recommend using the CLI commands to manage your configuration rather than editing the JSON file directly, as the CLI ensures proper formatting and validation.
Managing Configuration
Setting Configuration Values
Use the config set
command to set configuration values:
leet-joseok config set <key> <value>
Examples:
# Set your OpenAI API key leet-joseok config set apiKey YOUR_OPENAI_API_KEY # Enable or disable ghost mode leet-joseok config set ghostMode true # Set preferred programming language leet-joseok config set language python
Retrieving Configuration Values
Use the config get
command to retrieve a specific configuration value:
leet-joseok config get <key>
Example:
leet-joseok config get language
Example Output
language: python
Listing All Configuration Values
Use the config list
command to see all your current configuration settings:
leet-joseok config list
Example Output
Current configuration: apiKey: sk-abc...xyz ghostMode: true language: python theme: dark
Available Configuration Options
The following configuration options are available:
Key | Type | Default | Description |
---|---|---|---|
apiKey | string | empty | Your OpenAI API key for AI processing |
ghostMode | boolean | true | Whether ghost mode is enabled by default |
language | string | auto | Preferred programming language for solutions |
theme | string | dark | UI theme (dark or light) |
fontsize | number | 14 | Font size for the application UI |
opacity | number | 1.0 | Window opacity (0.0 to 1.0) |
Environment Variables
In addition to using the configuration commands, you can also set configuration through environment variables. This is useful for automation scripts or CI/CD environments.
Environment Variable | Corresponding Config |
---|---|
OPENAI_API_KEY | apiKey |
GHOST_MODE | ghostMode |
Example - Using Environment Variables
# On Linux/macOS export OPENAI_API_KEY=your_key_here leet-joseok init # On Windows (Command Prompt) set OPENAI_API_KEY=your_key_here leet-joseok init # On Windows (PowerShell) $env:OPENAI_API_KEY = 'your_key_here' leet-joseok init
Best Practices
- Always set your API key before using features that require AI processing
- Use environment variables for sensitive information in scripts or shared environments
- Check your configuration with
leet-joseok config list
if you encounter unexpected behavior - Create a backup of your configuration file if you plan to make significant changes