A fast, lightweight command-line interface for Freshdesk built with .NET 9 and AOT compilation.
- 🚀 Fast & Lightweight - Native AOT compilation for instant startup and small binary size (~3-5MB)
- 🔒 Read-Only Mode - Safe exploration mode that prevents accidental modifications
- 📊 Multiple Output Formats - Table (human-readable), JSON, CSV, XML, and Markdown formats
- 📤 Export Functionality - Export tickets and conversations to multiple formats
- 📥 Bulk Downloads - Download all attachments from tickets with progress indicators
- 🔐 Secure Credential Storage - File-based with proper permissions and environment variable support
- 🌍 Cross-Platform - Works on Linux, macOS, and Windows
- ⚡ Rate Limit Handling - Automatic retry with exponential backoff
- 📈 Progress Indicators - Visual progress bars for long-running operations
Linux/macOS:
curl -sSL https://raw.githubusercontent.com/Aaronontheweb/freshdesk-cli/dev/install.sh | bashWindows (PowerShell):
iwr -useb https://raw.githubusercontent.com/Aaronontheweb/freshdesk-cli/dev/install.ps1 | iexInstall Beta Releases:
curl -sSL https://raw.githubusercontent.com/Aaronontheweb/freshdesk-cli/dev/install.sh | bash -s -- --beta# Clone the repository
git clone https://github.com/Aaronontheweb/freshdesk-cli.git
cd freshdesk-cli
# Build and install globally (Linux/macOS)
dotnet publish src/FreshdeskCLI -c Release -r linux-x64 /p:PublishAot=true
sudo cp ./publish/linux-x64/freshdesk /usr/local/bin/
# Or run directly
dotnet run --project src/FreshdeskCLI -- --helpDownload the latest release for your platform from the Releases page.
Remove Freshdesk CLI:
curl -sSL https://raw.githubusercontent.com/Aaronontheweb/freshdesk-cli/dev/install.sh | bash -s -- --uninstallThis will:
- Remove the
freshdeskbinary from your installation directory - Optionally remove the configuration directory (
~/.freshdesk) if you choose - Optionally remove the installation directory if it becomes empty
# Configure with your Freshdesk credentials
freshdesk config set --domain yourcompany --api-key your_api_key_here
# Test the connection
freshdesk config test
# View current configuration
freshdesk config getYou can also use environment variables (useful for CI/CD):
export FRESHDESK_API_KEY=your_api_key_here
export FRESHDESK_DOMAIN=yourcompanyConfiguration is stored at ~/.freshdesk/config.json with secure file permissions (user-only on Unix systems).
The CLI supports tab completion for bash, zsh, and PowerShell. This feature dynamically generates completion scripts based on the current command structure, ensuring completions are always up-to-date.
Auto-detect and install for current shell:
freshdesk install-completionInstall for specific shell:
freshdesk install-completion bash # For Bash
freshdesk install-completion zsh # For Zsh
freshdesk install-completion powershell # For PowerShellAfter installation, activate the completion:
Bash:
source ~/.bashrcZsh:
source ~/.zshrcPowerShell:
. $PROFILE- Complete commands and subcommands (e.g.,
freshdesk ti<TAB>→freshdesk ticket) - Complete options and flags (e.g.,
freshdesk ticket list --st<TAB>→freshdesk ticket list --status) - Auto-complete enum values (e.g.,
--status <TAB>showsopen,pending,resolved,closed) - File path completion for
--outputand--fileoptions - Automatically stays in sync with command structure updates
Add --read-only or -ro to any command to prevent write operations:
# Safe exploration - no accidental changes
freshdesk --read-only ticket list
freshdesk --read-only ticket get 123# List tickets (default format: table)
freshdesk ticket list
# Filter by status
freshdesk ticket list --status open
freshdesk ticket list --status pending
# Filter by customer email
freshdesk ticket list --email [email protected]
freshdesk ticket list --customer [email protected]
# Combine filters
freshdesk ticket list --status open --email [email protected]
# With pagination
freshdesk ticket list --page 2 --limit 50
# Export as JSON
freshdesk ticket list --format json
# Export as CSV
freshdesk ticket list --format csv > tickets.csv# View ticket details
freshdesk ticket get 123
# Get as JSON
freshdesk ticket get 123 --format json# Create a new ticket
freshdesk ticket create \
--subject "Bug in login page" \
--email "[email protected]" \
--description "Cannot login with valid credentials" \
--priority high# Update ticket status and priority
freshdesk ticket update 123 --status resolved --priority low# Search tickets by text query
freshdesk ticket search "login issue"
freshdesk ticket search --query "database error"
# Search with filters
freshdesk ticket search --status open --priority high
freshdesk ticket search --email [email protected]
freshdesk ticket search --customer [email protected]
# Combine text search with filters
freshdesk ticket search "login" --status open --priority high
# Export search results
freshdesk ticket search --status open --format json
freshdesk ticket search --email [email protected] --format csv# Reply with message directly
freshdesk ticket reply 123 --message "Thank you for your inquiry. We're looking into this."
# Reply from file
freshdesk ticket reply 123 --file response.txt
# Interactive reply (will prompt for message)
freshdesk ticket reply 123# Add internal note directly
freshdesk ticket note 123 --message "Customer has premium support, prioritize this."
# Add note from file
freshdesk ticket note 123 --file internal-notes.txt
# Interactive note (will prompt)
freshdesk ticket note 123# Export multiple tickets to JSON
freshdesk export tickets --output tickets.json --format json
# Export with filters
freshdesk export tickets --status open --output open_tickets.json
freshdesk export tickets --priority high --output high_priority.json
freshdesk export tickets --email [email protected] --output johns_tickets.json
# Combine multiple filters
freshdesk export tickets --status open --priority high --output urgent.json
# Export to CSV
freshdesk export tickets --format csv --output tickets.csv
# Export to XML
freshdesk export tickets --format xml --output tickets.xml
# Export with conversations included (JSON only)
freshdesk export tickets --format json --output tickets_full.json --include-conversations
# Limit number of tickets exported
freshdesk export tickets --limit 100 --output first_100.json
# Export single ticket to Markdown
freshdesk export ticket 123 --format markdown --output ticket_123.md
# Export single ticket with conversations
freshdesk export ticket 123 --format json --output ticket_123.json --include-conversations# List all attachments for a ticket
freshdesk attachment list 123# Download an attachment
freshdesk attachment download 123 456789
# Download with custom output path
freshdesk attachment download 123 456789 --output /path/to/save.pdf
# Download all attachments from a ticket
freshdesk attachment download-all 123 --output-dir ./attachments/
# Bulk download with progress indicator
freshdesk attachment download-all 123 --output-dir ./downloads/ --show-progress# Upload a file to a ticket
freshdesk attachment upload 123 /path/to/file.pdf
# Upload with custom filename
freshdesk attachment upload 123 /path/to/file.pdf --name "Report_2024.pdf"All list and get commands support multiple output formats:
- table (default) - Human-readable table format
- json - Machine-readable JSON
- csv - Excel-compatible CSV
Example:
freshdesk ticket list --format json | jq '.[] | {id, subject, status}'| Option | Short | Description |
|---|---|---|
--help |
-h |
Show help information |
--version |
-v |
Show version information |
--read-only |
-ro |
Run in read-only mode (blocks all write operations) |
| Command | Description |
|---|---|
config set |
Set configuration values |
config get |
Display current configuration |
config test |
Test connection to Freshdesk API |
| Command | Description |
|---|---|
ticket list |
List tickets with pagination |
ticket get <id> |
Get ticket details |
ticket create |
Create a new ticket |
ticket update <id> |
Update ticket status/priority |
ticket search <query> |
Search tickets |
ticket reply <id> |
Reply to a ticket |
ticket note <id> |
Add internal note to a ticket |
ticket export |
Export tickets to JSON/CSV/XML/Markdown |
| Command | Description |
|---|---|
attachment list <ticket-id> |
List attachments for a ticket |
attachment download <ticket-id> <attachment-id> |
Download an attachment |
attachment download-all <ticket-id> |
Download all attachments from a ticket |
attachment upload <ticket-id> <file> |
Upload file to ticket |
# Morning ticket review
freshdesk --read-only ticket list --format table
# Export yesterday's tickets
freshdesk ticket list --format csv > daily_tickets.csv
# Quick status update
freshdesk ticket update 456 --status resolved# Check for high priority tickets
freshdesk ticket list --format json | \
jq '.[] | select(.priority == "High") | {id, subject}'
# Count open tickets
freshdesk ticket list --format json | \
jq '[.[] | select(.status == "Open")] | length'# Always use read-only mode when exploring
alias fd-safe='freshdesk --read-only'
fd-safe ticket list
fd-safe ticket get 789- .NET 9 SDK or later
- Git
# Clone repository
git clone https://github.com/Aaronontheweb/freshdesk-cli.git
cd freshdesk-cli
# Run tests
dotnet test
# Build for current platform
dotnet build -c Release
# Build with AOT for production (Linux)
dotnet publish src/FreshdeskCLI -c Release -r linux-x64 /p:PublishAot=true
# Build for other platforms
dotnet publish src/FreshdeskCLI -c Release -r win-x64 /p:PublishAot=true
dotnet publish src/FreshdeskCLI -c Release -r osx-x64 /p:PublishAot=true
dotnet publish src/FreshdeskCLI -c Release -r osx-arm64 /p:PublishAot=true
# Test AOT compatibility
dotnet run --project src/FreshdeskCLI -- --test-aotlinux-x64- Linux 64-bitlinux-arm64- Linux ARM 64-bitwin-x64- Windows 64-bitosx-x64- macOS Intelosx-arm64- macOS Apple Silicon
- AOT Compilation - Native ahead-of-time compilation for fast startup and small binaries
- Source Generators - Zero-reflection JSON serialization for AOT compatibility
- Reactive Rate Limiting - Handles API rate limits gracefully with automatic retry
- Secure Storage - Credentials stored with proper file permissions
Contributions are welcome! Please follow these guidelines:
- Maintain AOT compatibility - no reflection
- Keep binary size under 15MB
- Follow existing code style
- Add tests for new features
- Update documentation
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Authentication Failed
# Check your API key and domain
freshdesk config get
freshdesk config testRate Limited The CLI automatically handles rate limits with exponential backoff. If you consistently hit limits, consider reducing request frequency.
Permission Denied
# Ensure proper permissions on config directory
chmod 700 ~/.freshdesk
chmod 600 ~/.freshdesk/config.jsonBinary Not Found
# Ensure the binary is in your PATH
echo $PATH
# Or use full path
/usr/local/bin/freshdesk --version- Startup Time: < 50ms (native AOT)
- Binary Size: ~3-5MB (platform dependent)
- Memory Usage: < 20MB typical
- Rate Limiting: Automatic with exponential backoff
- API keys are never logged or displayed in full
- Configuration files use secure permissions (600 on Unix)
- Environment variables supported for CI/CD
- Read-only mode for safe exploration
- Attachment upload/download support
- Bulk download operations
- Progress indicators for long operations
- Export functionality (JSON/CSV/XML/Markdown)
- Conversation management
- Tab completion support
- Interactive mode
- Webhook support
- Advanced filtering and sorting
- Batch ticket operations
Apache License 2.0 - see LICENSE file for details.
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Built with ❤️ using:
Created with ❤️ by Aaron Stannard - https://aaronstannard.com/
GitHub: @Aaronontheweb