config
Config Command¶
The config
command manages persistent configuration settings for Cursor-Utils, with a particular focus on storing and retrieving API keys securely.
Syntax¶
Subcommands¶
Subcommand | Description | Syntax |
---|---|---|
list |
List all configuration values | cursor-utils config list [OPTIONS] |
get |
Get a specific configuration value | cursor-utils config get KEY [OPTIONS] |
set |
Set a configuration value | cursor-utils config set KEY VALUE [OPTIONS] |
delete |
Delete a configuration value | cursor-utils config delete KEY [OPTIONS] |
Options¶
Option | Description | Default | Example |
---|---|---|---|
--format |
Output format (plain, markdown, json, rich) | rich |
--format json |
--help |
Show command help | - | --help |
Configuration Storage¶
By default, Cursor-Utils stores configuration in a JSON file located at:
- Linux/macOS:
~/.config/cursor-utils/config.json
- Windows:
%APPDATA%\cursor-utils\config.json
The configuration file is automatically created when you first use the config set
command.
Common Configuration Keys¶
Key | Description | Used By Commands |
---|---|---|
gemini_api_key |
Google Gemini API key | gemini , project , repo |
perplexity_api_key |
Perplexity API key | web |
github_token |
GitHub personal access token | github |
default_format |
Default output format | All commands |
default_gemini_model |
Default Gemini model | gemini , project , repo |
default_perplexity_model |
Default Perplexity model | web |
Examples¶
Listing All Configuration Values¶
To see all currently configured values:
This will display a table of all configuration keys and their values.
With JSON output:
Getting a Specific Configuration Value¶
To retrieve a specific configuration value:
This will display just the value of the specified key.
Setting Configuration Values¶
To set or update a configuration value:
For setting the default Gemini model:
For setting the default output format:
Deleting Configuration Values¶
To remove a configuration value:
Using Environment Variables¶
All configuration values can also be set using environment variables, which take precedence over values in the configuration file.
export GEMINI_API_KEY=your_api_key
export DEFAULT_FORMAT=markdown
export GITHUB_TOKEN=your_github_token
API Key Setup¶
Google Gemini API Key¶
To use the gemini
, project
, and repo
commands, you need a Google Gemini API key:
- Visit Google AI Studio to create an API key
- Configure the key in Cursor-Utils:
Perplexity API Key¶
To use the web
command, you need a Perplexity API key:
- Visit Perplexity API documentation to create an API key
- Configure the key in Cursor-Utils:
GitHub Token¶
To use the github
command, you need a GitHub personal access token:
- Create a token at GitHub Settings > Developer settings > Personal access tokens
- Configure the token in Cursor-Utils:
Security Considerations¶
Configuration values, including API keys, are stored in plaintext in the configuration file. For enhanced security:
- Ensure appropriate file permissions are set on the configuration file
- Consider using environment variables for sensitive values in shared environments
- On shared systems, use user-specific installations of Cursor-Utils
Best Practices¶
- Regularly Rotate API Keys: Periodically update your API keys for security
- Set Default Values: Configure defaults for commonly used options:
- Use Separate Keys: For production vs. development environments
- Check Configuration: Verify your configuration before troubleshooting: