cmdrx


Namecmdrx JSON
Version 0.2.1 PyPI version JSON
download
home_pageNone
SummaryAI-powered command line troubleshooting tool
upload_time2025-08-07 04:43:20
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
licenseNone
keywords cli troubleshooting ai llm sysadmin
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # CmdRx - AI-Powered Command Line Troubleshooting Tool

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/release/python-380/)

CmdRx is a command line tool designed to assist IT personnel in analyzing CLI command outputs and providing troubleshooting steps and suggested fixes using artificial intelligence. It supports multiple LLM providers including OpenAI, Anthropic Claude, Grok, and custom on-premises solutions.

## Features

- **Multiple Input Modes**: Analyze command output directly or via piped input
- **AI-Powered Analysis**: Uses advanced language models to provide intelligent troubleshooting
- **Multiple LLM Providers**: Support for OpenAI, Anthropic, Grok, and custom endpoints
- **Secure Configuration**: Safe storage of API keys using system keyring
- **Detailed Logging**: Timestamped analysis logs with comprehensive information
- **Automated Fix Scripts**: Generates executable shell scripts with suggested fixes
- **User-Friendly TUI**: Text-based configuration interface for easy setup
- **Cross-Platform**: Works on Linux and macOS

## Installation

### From PyPI (Recommended)

```bash
pip install cmdrx
```

### From Source

```bash
git clone https://github.com/ryantischer2/cmdrx.git
cd cmdrx
pip install -e .
```

### Package Managers

**Ubuntu/Debian:**
```bash
sudo apt update
sudo apt install cmdrx
```

**Fedora/RHEL:**
```bash
sudo dnf install cmdrx
```

**macOS (Homebrew):**
```bash
brew install cmdrx
```

## Quick Start

### 1. Configure CmdRx

Run the configuration wizard to set up your LLM provider:

```bash
cmdrx --config
```

This will guide you through:
- Selecting an LLM provider (OpenAI, Anthropic, Grok, or custom)
- Entering your API credentials securely
- Configuring output directories and preferences

### 2. Analyze Command Output

**Standalone Mode** (CmdRx executes the command):
```bash
cmdrx systemctl status httpd
cmdrx journalctl -xe
cmdrx docker ps -a
```

**Piped Mode** (analyze output from another command):
```bash
systemctl status httpd | cmdrx
journalctl -xe | cmdrx
docker logs my-container | cmdrx
```

### 3. Review Results

CmdRx will display:
- Analysis of the command output
- Identified issues
- Troubleshooting steps
- Suggested fixes with risk levels
- Generated log files and fix scripts

## Usage Examples

### Troubleshooting a Failed Service

```bash
$ cmdrx systemctl status apache2
```

Output:
```
╭─ Analysis (ERROR) ────────────────────────────────────────╮
│ Apache2 service is failed due to configuration syntax    │
│ error in /etc/apache2/sites-enabled/000-default.conf     │
╰───────────────────────────────────────────────────────────╯

╭─ Issues Identified ───────────────────────────────────────╮
│ • Configuration syntax error in virtual host             │
│ • Service failed to start                                │
│ • Port conflict possible                                  │
╰───────────────────────────────────────────────────────────╯

╭─ Troubleshooting Steps ───────────────────────────────────╮
│ 1. Check configuration syntax                            │
│    Command: apache2ctl configtest                        │
│    This will show specific syntax errors                 │
│                                                           │
│ 2. Review error logs                                     │
│    Command: journalctl -u apache2 -n 20                  │
│    Check for detailed error messages                     │
╰───────────────────────────────────────────────────────────╯

Generated Files:
📄 Log file: ~/.cmdrx_logs/cmdrx_analysis_20241201_143022.log
🔧 Fix script: ~/.cmdrx_logs/cmdrx_fix_20241201_143022.sh
   Run with: bash ~/.cmdrx_logs/cmdrx_fix_20241201_143022.sh
```

### Analyzing Docker Issues

```bash
$ docker ps | cmdrx
```

### Custom Analysis with Piped Input

```bash
$ cat /var/log/syslog | tail -50 | cmdrx
```

## Configuration

### LLM Providers

CmdRx supports multiple LLM providers:

#### OpenAI
- Models: gpt-4, gpt-3.5-turbo, etc.
- Requires: OpenAI API key
- Configuration: Select "openai" in config menu

#### Anthropic Claude
- Models: claude-3-sonnet, claude-3-haiku, etc.
- Requires: Anthropic API key
- Configuration: Select "anthropic" in config menu

#### Grok (xAI)
- Models: grok-beta, etc.
- Requires: xAI API key
- Configuration: Select "grok" in config menu

#### Custom/On-Premises
- Any OpenAI-compatible API endpoint
- Examples: Ollama, LocalAI, custom deployments
- Configuration: Select "custom" and provide endpoint details

### Configuration File

Configuration is stored in `~/.config/cmdrx/config.json`:

```json
{
  "llm_provider": "openai",
  "llm_model": "gpt-4",
  "log_directory": "~/cmdrx_logs",
  "verbose": false,
  "auto_fix_scripts": true,
  "command_timeout": 30
}
```

### Secure Credential Storage

CmdRx offers multiple secure methods for storing API keys and tokens:

#### Method 1: System Keyring (Preferred)
- **Linux**: Secret Service (GNOME Keyring, KWallet)
- **macOS**: Keychain
- **Windows**: Windows Credential Store
- **Setup**: Use `cmdrx --config` to store credentials securely

#### Method 2: Environment Variables
Perfect for development and CI/CD environments:
```bash
# OpenAI
export CMDRX_OPENAI_API_KEY="sk-your-openai-key"

# Anthropic Claude
export CMDRX_ANTHROPIC_API_KEY="sk-ant-your-claude-key"

# Grok (xAI)
export CMDRX_GROK_API_KEY="xai-your-grok-key"

# Custom providers
export CMDRX_CUSTOM_API_KEY="your-custom-key"
export CMDRX_CUSTOM_BEARER_TOKEN="your-bearer-token"
```

#### Method 3: Credentials File
For manual credential management:
```bash
# Create secure credentials file
mkdir -p ~/.config/cmdrx
cat > ~/.config/cmdrx/credentials.json << 'EOF'
{
  "openai_api_key": "sk-your-openai-key",
  "anthropic_api_key": "sk-ant-your-claude-key",
  "grok_api_key": "xai-your-grok-key"
}
EOF

# Secure the file (owner-only access)
chmod 600 ~/.config/cmdrx/credentials.json
```

#### Priority Order
CmdRx will search for credentials in this order:
1. System keyring
2. Environment variables (`CMDRX_*`)
3. Credentials file (`~/.config/cmdrx/credentials.json`)

#### Setting Up API Keys

**Option A: Interactive Configuration with Storage Choice (Recommended)**
```bash
cmdrx --config
```

When configuring an API key, CmdRx will present you with storage method options:

| **Option** | **Method** | **Security** | **Best For** |
|------------|------------|--------------|--------------|
| **1** | System Keyring | High | Desktop users, single-user systems |
| **2** | Environment Variable | Medium | Development, CI/CD, automation |
| **3** | Credentials File | Medium | Manual management, shared systems |

The interface will:
- Show available storage methods for your system
- Display security levels for each method
- Provide setup instructions for your chosen method
- Automatically secure file permissions (if using file storage)
- Fall back to alternative methods if the preferred method fails

**Option B: Environment Variables (Quick Setup)**
```bash
# Add to your shell profile (~/.bashrc, ~/.zshrc, etc.)
echo 'export CMDRX_OPENAI_API_KEY="sk-your-actual-key"' >> ~/.zshrc
source ~/.zshrc
```

**Option C: One-time Usage**
```bash
CMDRX_OPENAI_API_KEY="sk-your-key" cmdrx your-command
```

## Command Line Options

```bash
cmdrx [OPTIONS] [COMMAND...]

Options:
  -c, --config          Open configuration interface
  -v, --verbose         Enable verbose output
  --version            Show version and exit
  --log-dir PATH       Override default log directory
  --dry-run            Analyze without creating fix scripts
  --help               Show help message
```

## Generated Files

CmdRx generates several types of output files:

### Log Files
- **Location**: `~/cmdrx_logs/` (configurable)
- **Format**: `cmdrx_analysis_YYYYMMDD_HHMMSS.log`
- **Content**: Complete analysis with system info, command output, and AI response

### Fix Scripts
- **Location**: `~/cmdrx_logs/` (configurable)
- **Format**: `cmdrx_fix_YYYYMMDD_HHMMSS.sh`
- **Content**: Executable bash script with suggested fixes
- **Safety**: Includes confirmations and risk warnings

## Security Considerations

- **Credential Storage**: Multiple secure options (system keyring, environment variables, encrypted file)
- **File Permissions**: Credentials files automatically secured with `chmod 600` (owner-only access)
- **No Plain Text**: API keys never stored in configuration files or logs
- **Input Validation**: Commands are validated to prevent injection attacks
- **Fix Scripts**: Generated with safety confirmations and warnings
- **HTTPS**: All remote API calls use HTTPS encryption
- **No Auto-Execution**: Fixes require explicit user approval
- **Fallback Security**: If keyring fails, secure alternatives are available

## Troubleshooting

### Common Issues

**Configuration Error: No LLM provider configured**
```bash
cmdrx --config  # Run configuration wizard
```

**API Key Issues**
```bash
# Method 1: Interactive configuration
cmdrx --config

# Method 2: Environment variable (quick fix)
export CMDRX_OPENAI_API_KEY="sk-your-key"

# Method 3: Check which credential source is being used
cmdrx --verbose echo "test"  # Shows credential source in output

# Method 4: Verify credential file
ls -la ~/.config/cmdrx/credentials.json
```

**Keyring Problems**
If system keyring is unavailable, CmdRx automatically falls back to:
```bash
# Use environment variables instead
export CMDRX_OPENAI_API_KEY="sk-your-key"

# Or create credentials file
mkdir -p ~/.config/cmdrx
echo '{"openai_api_key": "sk-your-key"}' > ~/.config/cmdrx/credentials.json
chmod 600 ~/.config/cmdrx/credentials.json
```

**Connection Problems**
```bash
# Test your configuration
cmdrx --config  # Use "Test Configuration" option
```

### Verbose Mode

For detailed debugging information:
```bash
cmdrx --verbose your-command
```

### Log Files

Check the generated log files for complete analysis details:
```bash
ls -la ~/cmdrx_logs/
cat ~/cmdrx_logs/cmdrx_analysis_*.log
```

## Development

### Setting Up Development Environment

```bash
git clone https://github.com/ryantischer2/cmdrx.git
cd cmdrx
pip install -e ".[dev]"
```

### Running Tests

```bash
pytest
pytest --cov=src/cmdrx
```

### Code Quality

```bash
black src/ tests/
isort src/ tests/
flake8 src/ tests/
mypy src/
```

## Contributing

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.

1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests
5. Submit a pull request

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Support

- **Documentation**: [cmdrx.readthedocs.io](https://cmdrx.readthedocs.io)
- **Issues**: [GitHub Issues](https://github.com/ryantischer2/cmdrx/issues)
- **Discussions**: [GitHub Discussions](https://github.com/ryantischer2/cmdrx/discussions)

## Changelog

See [CHANGELOG.md](CHANGELOG.md) for version history and changes.

---

**Disclaimer**: CmdRx provides AI-generated suggestions. Always review and understand commands before executing them. The authors are not responsible for any system damage or data loss.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "cmdrx",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "cli, troubleshooting, ai, llm, sysadmin",
    "author": null,
    "author_email": "CmdRx Team <team@cmdrx.dev>",
    "download_url": "https://files.pythonhosted.org/packages/f8/3c/9d25dc3d627e55f8c0d1b93b0f1f85d58c58242025d79f21b0f59014e961/cmdrx-0.2.1.tar.gz",
    "platform": null,
    "description": "# CmdRx - AI-Powered Command Line Troubleshooting Tool\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/release/python-380/)\n\nCmdRx is a command line tool designed to assist IT personnel in analyzing CLI command outputs and providing troubleshooting steps and suggested fixes using artificial intelligence. It supports multiple LLM providers including OpenAI, Anthropic Claude, Grok, and custom on-premises solutions.\n\n## Features\n\n- **Multiple Input Modes**: Analyze command output directly or via piped input\n- **AI-Powered Analysis**: Uses advanced language models to provide intelligent troubleshooting\n- **Multiple LLM Providers**: Support for OpenAI, Anthropic, Grok, and custom endpoints\n- **Secure Configuration**: Safe storage of API keys using system keyring\n- **Detailed Logging**: Timestamped analysis logs with comprehensive information\n- **Automated Fix Scripts**: Generates executable shell scripts with suggested fixes\n- **User-Friendly TUI**: Text-based configuration interface for easy setup\n- **Cross-Platform**: Works on Linux and macOS\n\n## Installation\n\n### From PyPI (Recommended)\n\n```bash\npip install cmdrx\n```\n\n### From Source\n\n```bash\ngit clone https://github.com/ryantischer2/cmdrx.git\ncd cmdrx\npip install -e .\n```\n\n### Package Managers\n\n**Ubuntu/Debian:**\n```bash\nsudo apt update\nsudo apt install cmdrx\n```\n\n**Fedora/RHEL:**\n```bash\nsudo dnf install cmdrx\n```\n\n**macOS (Homebrew):**\n```bash\nbrew install cmdrx\n```\n\n## Quick Start\n\n### 1. Configure CmdRx\n\nRun the configuration wizard to set up your LLM provider:\n\n```bash\ncmdrx --config\n```\n\nThis will guide you through:\n- Selecting an LLM provider (OpenAI, Anthropic, Grok, or custom)\n- Entering your API credentials securely\n- Configuring output directories and preferences\n\n### 2. Analyze Command Output\n\n**Standalone Mode** (CmdRx executes the command):\n```bash\ncmdrx systemctl status httpd\ncmdrx journalctl -xe\ncmdrx docker ps -a\n```\n\n**Piped Mode** (analyze output from another command):\n```bash\nsystemctl status httpd | cmdrx\njournalctl -xe | cmdrx\ndocker logs my-container | cmdrx\n```\n\n### 3. Review Results\n\nCmdRx will display:\n- Analysis of the command output\n- Identified issues\n- Troubleshooting steps\n- Suggested fixes with risk levels\n- Generated log files and fix scripts\n\n## Usage Examples\n\n### Troubleshooting a Failed Service\n\n```bash\n$ cmdrx systemctl status apache2\n```\n\nOutput:\n```\n\u256d\u2500 Analysis (ERROR) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n\u2502 Apache2 service is failed due to configuration syntax    \u2502\n\u2502 error in /etc/apache2/sites-enabled/000-default.conf     \u2502\n\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n\n\u256d\u2500 Issues Identified \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n\u2502 \u2022 Configuration syntax error in virtual host             \u2502\n\u2502 \u2022 Service failed to start                                \u2502\n\u2502 \u2022 Port conflict possible                                  \u2502\n\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n\n\u256d\u2500 Troubleshooting Steps \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n\u2502 1. Check configuration syntax                            \u2502\n\u2502    Command: apache2ctl configtest                        \u2502\n\u2502    This will show specific syntax errors                 \u2502\n\u2502                                                           \u2502\n\u2502 2. Review error logs                                     \u2502\n\u2502    Command: journalctl -u apache2 -n 20                  \u2502\n\u2502    Check for detailed error messages                     \u2502\n\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n\nGenerated Files:\n\ud83d\udcc4 Log file: ~/.cmdrx_logs/cmdrx_analysis_20241201_143022.log\n\ud83d\udd27 Fix script: ~/.cmdrx_logs/cmdrx_fix_20241201_143022.sh\n   Run with: bash ~/.cmdrx_logs/cmdrx_fix_20241201_143022.sh\n```\n\n### Analyzing Docker Issues\n\n```bash\n$ docker ps | cmdrx\n```\n\n### Custom Analysis with Piped Input\n\n```bash\n$ cat /var/log/syslog | tail -50 | cmdrx\n```\n\n## Configuration\n\n### LLM Providers\n\nCmdRx supports multiple LLM providers:\n\n#### OpenAI\n- Models: gpt-4, gpt-3.5-turbo, etc.\n- Requires: OpenAI API key\n- Configuration: Select \"openai\" in config menu\n\n#### Anthropic Claude\n- Models: claude-3-sonnet, claude-3-haiku, etc.\n- Requires: Anthropic API key\n- Configuration: Select \"anthropic\" in config menu\n\n#### Grok (xAI)\n- Models: grok-beta, etc.\n- Requires: xAI API key\n- Configuration: Select \"grok\" in config menu\n\n#### Custom/On-Premises\n- Any OpenAI-compatible API endpoint\n- Examples: Ollama, LocalAI, custom deployments\n- Configuration: Select \"custom\" and provide endpoint details\n\n### Configuration File\n\nConfiguration is stored in `~/.config/cmdrx/config.json`:\n\n```json\n{\n  \"llm_provider\": \"openai\",\n  \"llm_model\": \"gpt-4\",\n  \"log_directory\": \"~/cmdrx_logs\",\n  \"verbose\": false,\n  \"auto_fix_scripts\": true,\n  \"command_timeout\": 30\n}\n```\n\n### Secure Credential Storage\n\nCmdRx offers multiple secure methods for storing API keys and tokens:\n\n#### Method 1: System Keyring (Preferred)\n- **Linux**: Secret Service (GNOME Keyring, KWallet)\n- **macOS**: Keychain\n- **Windows**: Windows Credential Store\n- **Setup**: Use `cmdrx --config` to store credentials securely\n\n#### Method 2: Environment Variables\nPerfect for development and CI/CD environments:\n```bash\n# OpenAI\nexport CMDRX_OPENAI_API_KEY=\"sk-your-openai-key\"\n\n# Anthropic Claude\nexport CMDRX_ANTHROPIC_API_KEY=\"sk-ant-your-claude-key\"\n\n# Grok (xAI)\nexport CMDRX_GROK_API_KEY=\"xai-your-grok-key\"\n\n# Custom providers\nexport CMDRX_CUSTOM_API_KEY=\"your-custom-key\"\nexport CMDRX_CUSTOM_BEARER_TOKEN=\"your-bearer-token\"\n```\n\n#### Method 3: Credentials File\nFor manual credential management:\n```bash\n# Create secure credentials file\nmkdir -p ~/.config/cmdrx\ncat > ~/.config/cmdrx/credentials.json << 'EOF'\n{\n  \"openai_api_key\": \"sk-your-openai-key\",\n  \"anthropic_api_key\": \"sk-ant-your-claude-key\",\n  \"grok_api_key\": \"xai-your-grok-key\"\n}\nEOF\n\n# Secure the file (owner-only access)\nchmod 600 ~/.config/cmdrx/credentials.json\n```\n\n#### Priority Order\nCmdRx will search for credentials in this order:\n1. System keyring\n2. Environment variables (`CMDRX_*`)\n3. Credentials file (`~/.config/cmdrx/credentials.json`)\n\n#### Setting Up API Keys\n\n**Option A: Interactive Configuration with Storage Choice (Recommended)**\n```bash\ncmdrx --config\n```\n\nWhen configuring an API key, CmdRx will present you with storage method options:\n\n| **Option** | **Method** | **Security** | **Best For** |\n|------------|------------|--------------|--------------|\n| **1** | System Keyring | High | Desktop users, single-user systems |\n| **2** | Environment Variable | Medium | Development, CI/CD, automation |\n| **3** | Credentials File | Medium | Manual management, shared systems |\n\nThe interface will:\n- Show available storage methods for your system\n- Display security levels for each method\n- Provide setup instructions for your chosen method\n- Automatically secure file permissions (if using file storage)\n- Fall back to alternative methods if the preferred method fails\n\n**Option B: Environment Variables (Quick Setup)**\n```bash\n# Add to your shell profile (~/.bashrc, ~/.zshrc, etc.)\necho 'export CMDRX_OPENAI_API_KEY=\"sk-your-actual-key\"' >> ~/.zshrc\nsource ~/.zshrc\n```\n\n**Option C: One-time Usage**\n```bash\nCMDRX_OPENAI_API_KEY=\"sk-your-key\" cmdrx your-command\n```\n\n## Command Line Options\n\n```bash\ncmdrx [OPTIONS] [COMMAND...]\n\nOptions:\n  -c, --config          Open configuration interface\n  -v, --verbose         Enable verbose output\n  --version            Show version and exit\n  --log-dir PATH       Override default log directory\n  --dry-run            Analyze without creating fix scripts\n  --help               Show help message\n```\n\n## Generated Files\n\nCmdRx generates several types of output files:\n\n### Log Files\n- **Location**: `~/cmdrx_logs/` (configurable)\n- **Format**: `cmdrx_analysis_YYYYMMDD_HHMMSS.log`\n- **Content**: Complete analysis with system info, command output, and AI response\n\n### Fix Scripts\n- **Location**: `~/cmdrx_logs/` (configurable)\n- **Format**: `cmdrx_fix_YYYYMMDD_HHMMSS.sh`\n- **Content**: Executable bash script with suggested fixes\n- **Safety**: Includes confirmations and risk warnings\n\n## Security Considerations\n\n- **Credential Storage**: Multiple secure options (system keyring, environment variables, encrypted file)\n- **File Permissions**: Credentials files automatically secured with `chmod 600` (owner-only access)\n- **No Plain Text**: API keys never stored in configuration files or logs\n- **Input Validation**: Commands are validated to prevent injection attacks\n- **Fix Scripts**: Generated with safety confirmations and warnings\n- **HTTPS**: All remote API calls use HTTPS encryption\n- **No Auto-Execution**: Fixes require explicit user approval\n- **Fallback Security**: If keyring fails, secure alternatives are available\n\n## Troubleshooting\n\n### Common Issues\n\n**Configuration Error: No LLM provider configured**\n```bash\ncmdrx --config  # Run configuration wizard\n```\n\n**API Key Issues**\n```bash\n# Method 1: Interactive configuration\ncmdrx --config\n\n# Method 2: Environment variable (quick fix)\nexport CMDRX_OPENAI_API_KEY=\"sk-your-key\"\n\n# Method 3: Check which credential source is being used\ncmdrx --verbose echo \"test\"  # Shows credential source in output\n\n# Method 4: Verify credential file\nls -la ~/.config/cmdrx/credentials.json\n```\n\n**Keyring Problems**\nIf system keyring is unavailable, CmdRx automatically falls back to:\n```bash\n# Use environment variables instead\nexport CMDRX_OPENAI_API_KEY=\"sk-your-key\"\n\n# Or create credentials file\nmkdir -p ~/.config/cmdrx\necho '{\"openai_api_key\": \"sk-your-key\"}' > ~/.config/cmdrx/credentials.json\nchmod 600 ~/.config/cmdrx/credentials.json\n```\n\n**Connection Problems**\n```bash\n# Test your configuration\ncmdrx --config  # Use \"Test Configuration\" option\n```\n\n### Verbose Mode\n\nFor detailed debugging information:\n```bash\ncmdrx --verbose your-command\n```\n\n### Log Files\n\nCheck the generated log files for complete analysis details:\n```bash\nls -la ~/cmdrx_logs/\ncat ~/cmdrx_logs/cmdrx_analysis_*.log\n```\n\n## Development\n\n### Setting Up Development Environment\n\n```bash\ngit clone https://github.com/ryantischer2/cmdrx.git\ncd cmdrx\npip install -e \".[dev]\"\n```\n\n### Running Tests\n\n```bash\npytest\npytest --cov=src/cmdrx\n```\n\n### Code Quality\n\n```bash\nblack src/ tests/\nisort src/ tests/\nflake8 src/ tests/\nmypy src/\n```\n\n## Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests\n5. Submit a pull request\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Support\n\n- **Documentation**: [cmdrx.readthedocs.io](https://cmdrx.readthedocs.io)\n- **Issues**: [GitHub Issues](https://github.com/ryantischer2/cmdrx/issues)\n- **Discussions**: [GitHub Discussions](https://github.com/ryantischer2/cmdrx/discussions)\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md) for version history and changes.\n\n---\n\n**Disclaimer**: CmdRx provides AI-generated suggestions. Always review and understand commands before executing them. The authors are not responsible for any system damage or data loss.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "AI-powered command line troubleshooting tool",
    "version": "0.2.1",
    "project_urls": {
        "Documentation": "https://cmdrx.readthedocs.io",
        "Homepage": "https://github.com/cmdrx/cmdrx",
        "Issues": "https://github.com/cmdrx/cmdrx/issues",
        "Repository": "https://github.com/cmdrx/cmdrx"
    },
    "split_keywords": [
        "cli",
        " troubleshooting",
        " ai",
        " llm",
        " sysadmin"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4e8549017f7a25c7f4430e4a9020afd68ad9429a7df7614004b18eec01744efa",
                "md5": "346b4bf1fd63ad40891c079c93880e9c",
                "sha256": "3e8681a9b9e353a86221c80d833740133c0e74194f1b642ccf657010d22819b4"
            },
            "downloads": -1,
            "filename": "cmdrx-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "346b4bf1fd63ad40891c079c93880e9c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 35586,
            "upload_time": "2025-08-07T04:43:19",
            "upload_time_iso_8601": "2025-08-07T04:43:19.724715Z",
            "url": "https://files.pythonhosted.org/packages/4e/85/49017f7a25c7f4430e4a9020afd68ad9429a7df7614004b18eec01744efa/cmdrx-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "f83c9d25dc3d627e55f8c0d1b93b0f1f85d58c58242025d79f21b0f59014e961",
                "md5": "2940fa38ab0c98e15266e038194f330a",
                "sha256": "42fd094cccec3e6301aa0ab84a4375036c042ce7efa8db1f0492fd8eff8ca245"
            },
            "downloads": -1,
            "filename": "cmdrx-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "2940fa38ab0c98e15266e038194f330a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 38743,
            "upload_time": "2025-08-07T04:43:20",
            "upload_time_iso_8601": "2025-08-07T04:43:20.954956Z",
            "url": "https://files.pythonhosted.org/packages/f8/3c/9d25dc3d627e55f8c0d1b93b0f1f85d58c58242025d79f21b0f59014e961/cmdrx-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-07 04:43:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "cmdrx",
    "github_project": "cmdrx",
    "github_not_found": true,
    "lcname": "cmdrx"
}
        
Elapsed time: 0.63091s