Penify CLI - Configuration Commands
The config
command allows you to set up and manage configuration settings for Penify CLI. This document explains all available configuration options and how to use them.
Configuration Overview
Penify CLI stores configuration in a JSON file at ~/.penify/config.json
. The configuration includes:
- LLM (Large Language Model) settings for local commit message generation
- JIRA integration settings for enhanced commit messages
- API tokens and other credentials
Basic Usage
# Configure LLM settings
penifycli config llm
# Configure JIRA integration
penifycli config jira
LLM Configuration
Web Interface
Running penifycli config llm
opens a web interface in your browser where you can configure:
- Model: The LLM model to use (e.g.,
gpt-3.5-turbo
) - API Base URL: The endpoint URL for your LLM API (e.g.,
https://api.openai.com/v1
) - API Key: Your authentication key for the LLM API
Supported LLMs
Penify CLI supports various LLM providers:
OpenAI
- Model:
gpt-3.5-turbo
orgpt-4
- API Base:
https://api.openai.com/v1
- API Key: Your OpenAI API key
Anthropic
- Model:
claude-instant-1
orclaude-2
- API Base:
https://api.anthropic.com/v1
- API Key: Your Anthropic API key
Ollama (Local)
- Model:
llama2
or any model you have installed - API Base:
http://localhost:11434
- API Key: (leave blank)
Azure OpenAI
- Model: Your deployed model name
- API Base: Your Azure endpoint
- API Key: Your Azure API key
Configuration File Structure
After configuration, your ~/.penify/config.json
will contain:
{
"llm": {
"model": "gpt-3.5-turbo",
"api_base": "https://api.openai.com/v1",
"api_key": "sk-..."
}
}
JIRA Configuration
Web Interface
Running penifycli config jira
opens a web interface where you can configure:
- JIRA URL: Your JIRA instance URL (e.g.,
https://yourcompany.atlassian.net
) - Username: Your JIRA username (typically your email)
- API Token: Your JIRA API token
Creating a JIRA API Token
- Log in to https://id.atlassian.com/manage-profile/security/api-tokens
- Click "Create API token"
- Give it a name (e.g., "Penify CLI")
- Copy the generated token and paste it into the configuration
Configuration File Structure
After configuration, your ~/.penify/config.json
will contain:
{
"jira": {
"url": "https://yourcompany.atlassian.net",
"username": "your.email@example.com",
"api_token": "your-jira-api-token"
}
}
Configuration Locations
Penify CLI looks for configuration in multiple locations:
- Project-specific:
.penify/config.json
in the Git repository root - User-specific:
~/.penify/config.json
in your home directory
The project-specific configuration takes precedence if both exist.
Environment Variables
You can override configuration settings using environment variables:
PENIFY_API_TOKEN
: Override the stored API tokenPENIFY_LLM_MODEL
: Override the configured LLM modelPENIFY_LLM_API_BASE
: Override the configured LLM API base URLPENIFY_LLM_API_KEY
: Override the configured LLM API keyPENIFY_JIRA_URL
: Override the configured JIRA URLPENIFY_JIRA_USER
: Override the configured JIRA usernamePENIFY_JIRA_TOKEN
: Override the configured JIRA API token
Example:
export PENIFY_LLM_MODEL="gpt-4"
penifycli commit
Command-Line Configuration
For advanced users or scripting, you can directly edit the configuration file:
# View current configuration
cat ~/.penify/config.json
# Edit configuration with your preferred editor
nano ~/.penify/config.json
Sharing Configuration
You can share configuration between machines by copying the .penify/config.json
file. However, be cautious with API keys and credentials.
For team settings, consider:
- Using a project-specific
.penify/config.json
with shared settings - Excluding API keys from shared configuration
- Using environment variables for sensitive credentials
Troubleshooting
Common Issues
"Error reading configuration file"
- Check if the file exists:
ls -la ~/.penify
- Ensure it contains valid JSON:
cat ~/.penify/config.json
- Check if the file exists:
"Failed to connect to LLM API"
- Verify API base URL and API key
- Check network connectivity to the API endpoint
- Ensure your account has access to the specified model
"Failed to connect to JIRA"
- Check JIRA URL format (should include
https://
) - Verify username and API token
- Ensure your JIRA account has API access permissions
- Check JIRA URL format (should include