A powerful command-line interface for Zendesk ticket management. Streamline your customer support workflow with easy-to-use commands for listing and creating tickets.
- π Ticket listing with status filtering
- π« Ticket creation with subject, description, and priority
- π¨ Pretty output with JSON formatting (jq/python3)
- π§ Flexible configuration with multiple config file locations
- β‘ Zsh completion with smart tab completion
- π Secure authentication via API tokens
curl -fsSL https://raw.githubusercontent.com/jeromecoloma/zendesk-cli/main/install.sh | bash
-
Download and install:
git clone https://github.com/jeromecoloma/zendesk-cli.git cd zendesk-cli chmod +x install.sh ./install.sh
-
Restart your shell or run:
source ~/.zshrc
-
Initialize configuration (optional):
zendesk-cli init
To update to the latest version:
curl -fsSL https://raw.githubusercontent.com/jeromecoloma/zendesk-cli/main/install.sh | bash -s -- --update
To remove zendesk-cli completely:
curl -fsSL https://raw.githubusercontent.com/jeromecoloma/zendesk-cli/main/install.sh | bash -s -- --uninstall
Or locally:
./install.sh --uninstall
# Initialize configuration interactively
zendesk-cli init
# List all tickets
zendesk-cli list-tickets
# List tickets with specific status
zendesk-cli list-tickets open
zendesk-cli list-tickets pending
zendesk-cli list-tickets solved
# Create a new ticket
zendesk-cli create-ticket "Bug report" "Found an issue with the application"
# Create a ticket with priority
zendesk-cli create-ticket "Critical bug" "System is down" urgent
# Use raw JSON output (no formatting)
ZENDESK_FORMAT=raw zendesk-cli list-tickets
# Debug mode (shows loaded config file)
ZENDESK_DEBUG=1 zendesk-cli list-tickets
The easiest way to set up configuration:
zendesk-cli init
This interactive command will:
- Guide you through getting your API token
- Help you set up your Zendesk subdomain and email
- Create a properly formatted
.zendeskrc
file
Zendesk CLI looks for configuration files in these locations (first found wins):
./.zendeskrc
(project-specific)~/.zendeskrc
(user-specific)~/.config/zendesk-cli/.zendeskrc
(XDG config)
# API Authentication (required)
ZENDESK_SUBDOMAIN="mycompany" # for mycompany.zendesk.com
ZENDESK_EMAIL="user@company.com"
ZENDESK_API_TOKEN="your_zendesk_api_token_here"
# Output format (optional)
ZENDESK_FORMAT="pretty" # or "raw"
ZENDESK_DEBUG="0" # or "1" for debug info
- Go to:
https://[YOUR_SUBDOMAIN].zendesk.com/admin/apps-integrations/apis/api-tokens
- Click "Add API token"
- Copy your API token
- Add it to your config file
Zendesk CLI includes intelligent Zsh completion that provides:
- Command completion:
zendesk-cli li<TAB>
βlist-tickets
- Flag completion:
zendesk-cli create-ticket --<TAB>
β shows available flags - Context-aware options: Different commands show relevant flags
Command | Description | Arguments |
---|---|---|
init |
Interactive configuration setup | None |
list-tickets |
List tickets | [status] (open, pending, solved) |
create-ticket |
Create new ticket | "subject" "description" [priority] |
Variable | Description | Default |
---|---|---|
ZENDESK_FORMAT |
Output format (pretty |raw ) |
pretty |
ZENDESK_DEBUG |
Debug mode (0 |1 ) |
0 |
git clone https://github.com/jeromecoloma/zendesk-cli.git
cd zendesk-cli
zendesk-cli/
βββ zendesk-cli # Main script
βββ completions/ # Zsh completion
β βββ _zendesk_cli
βββ install.sh # Installation script
βββ README.md # This file
βββ LICENSE # MIT License
βββ examples/ # Configuration examples
βββ .zendeskrc.example
- Fork the repository
- Create a feature branch:
git checkout -b feature-name
- Make your changes
- Test thoroughly
- Submit a pull request
# 1. Setup configuration interactively
zendesk-cli init
# 2. List all tickets to see current workload
zendesk-cli list-tickets
# 3. List only open tickets
zendesk-cli list-tickets open
# 4. Create a new ticket
zendesk-cli create-ticket "Bug report" "Found an issue with login system" high
# 1. Configure API credentials manually
echo 'ZENDESK_SUBDOMAIN="mycompany"' > ~/.zendeskrc
echo 'ZENDESK_EMAIL="user@company.com"' >> ~/.zendeskrc
echo 'ZENDESK_API_TOKEN="your_token_here"' >> ~/.zendeskrc
# 2. Continue with workflow above
# Check morning tickets
zendesk-cli list-tickets open
# Create tickets for bugs found
zendesk-cli create-ticket "UI Bug" "Button not working on mobile" normal
# Check all pending tickets
zendesk-cli list-tickets pending
# Create urgent tickets
zendesk-cli create-ticket "System Down" "Database connection failed" urgent
Command not found:
# Check if ~/bin is in PATH
echo $PATH
# Add to ~/.zshrc if missing
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
Permission denied:
# Make script executable
chmod +x ~/bin/zendesk-cli
API authentication failed:
# Check your API credentials
zendesk-cli list-tickets
# Verify config file
cat ~/.zendeskrc
Tab completion not working:
# Rebuild completion cache
rm ~/.zcompdump*
exec zsh
No config file found:
# Use interactive setup (recommended)
zendesk-cli init
# Or create config file manually
echo 'ZENDESK_SUBDOMAIN="mycompany"' > ~/.zendeskrc
echo 'ZENDESK_EMAIL="user@company.com"' >> ~/.zendeskrc
echo 'ZENDESK_API_TOKEN="your_token"' >> ~/.zendeskrc
Configuration errors:
- The tool now shows helpful error messages with clear instructions
- Missing variables are highlighted with suggestions
- Configuration errors won't crash the script
- Keep API tokens secure - don't commit them to version control
- Use environment-specific configs for different projects
- Regularly rotate API tokens if compromised
- Set proper file permissions on config files (600)
MIT License - see LICENSE file for details.
Found this useful? β Star the repo and share with your team!