Typer Zendesk CLI Tool is a powerful command-line interface application designed to facilitate the management of Zendesk Admin tasks. The app allows interaction with the Zendesk API to carry out actions such as data download, ticket updates, users, bulk actions, and more.
Typer Zendesk CLI has been developed using Typer, a powerful library for building CLI applications with Python. Typer was created by Sebastián Ramírez, the same developer behind the popular FastAPI framework.
- Introduction
- As a Zendesk Administrator, What You Can Do with Typer Zendesk CLI
- Download
- Creation
- Update
- Advanced - Bulk Actions
- Production or Sandbox
- Easy Navigation
- Installation
- Setting Up
- Usage
- Getting Started
- Contribution and Contact
- License
- Acknowledgements
Zendesk administrators typically carry out daily tasks from the Zendesk UI itself. However, there are certain actions where the Zendesk UI is limited and must be carried out using the API.
Actions such as obtaining the list of agents with their information (email, role name, etc.), downloading Help Center articles, applying a macro given a list of ticket IDs, assigning a group to a long list of agents, changing macro permissions, etc.
Getting the list of agents or macros in CSV format can only be obtained through the API, as well as obtaining Help Center articles. On the other hand, Zendesk allows applying macros to tickets, but only up to 100 tickets per action and all must be in a view. Also, changing macro permissions or assigning a group to a long list of agents can be tedious and time-consuming, as well as creating a long list of Zendesk agents with their corresponding role.
Typer Zendesk CLI allows Admins to perform all these actions in a matter of seconds:
- Download lists of agents, groups, macros, triggers, articles, etc.
[PRODUCTION] Select the data you want to download:
---------------------------------------
[1] Users [2] Macros [3] Articles [4] Organizations
[5] Groups [6] Dynamic Content [7] Views [8] Triggers
[9] Automations [10] Brands [11] User Fields [12] Ticket Fields
[13] Go Back
Enter your choice:
By selecting the data we want to download, the app will do so in a matter of seconds in CSV format:
[PRODUCTION] Select the data you want to download:
---------------------------------------
[1] Users [2] Macros [3] Articles [4] Organizations
[5] Groups [6] Dynamic Content [7] Views [8] Triggers
[9] Automations [10] Brands [11] User Fields [12] Ticket Fields
[13] Go Back
Enter your choice: 1
✅ - Users data saved successfully to typer_data/get_data/users/production/zd_users_production_2024-04-01_11-58-14.csv
The CSV file will be ready for use in spreadsheets or excel.
- Bulk create groups or agents with their corresponding role, as well as assign them to groups.
[PRODUCTION] Select the bulk action you want to perform:
---------------------------------------
[1] Groups - Create Groups
[2] Groups - Assign Agents to a Group
[3] Users - Create Agents
[0] Go Back
Enter your choice:
- Bulk update macros permissions, such as restricting the use of macros to certain groups, or conversely, allowing all macros to be visible.
[PRODUCTION] Select the PUT action you want to perform:
---------------------------------------
[1] Macros - Update Permissions
[0] Go Back
Enter your choice:
- Apply a macro to a large list of tickets or simply add a tag to them by providing a CSV file.
[PRODUCTION] Select the ADVANCED action you want to perform:
---------------------------------------
[1] Tickets - Apply Macro to Tickets
[2] Tickets - Apply Tags to Tickets
[0] Go Back
Enter your choice:
- The app allows interaction both in production and in the sandbox, enabling switching between both environments to test bulk actions or updates on tickets, groups, or users before going to production.
Is this for 'production' or 'sandbox'? (Enter '0' to go back):
The Typer Zendesk CLI is designed with user experience in mind, offering an intuitive navigation system that guides the user through each step without the constant need to resort to --help
for guidance.
Main Menu:
[1] Set up Zendesk credentials
[2] Update Zendesk credentials
[3] Admin Actions
-------------------------------------------------
[4] Documentation
[0] Exit App >>
Enter your choice:
To use the Typer Zendesk CLI Tool, first clone or download the repository from GitHub:
git clone https://github.com/tbs89/typer-zendesk-cli.git
Alternatively, you can download the repository as a ZIP file and extract it.
Navigate to the project directory:
cd typer-zendesk-cli
It's recommended to use a virtual environment. Create and activate one with:
python -m venv venv
source venv/bin/activate # On Windows, use `venv\Scripts\activate`
Install the required dependencies:
pip install -r requirements.txt
To start using the CLI tool, invoke the main script:
(venv) (base) tomasbaidal@MBP-de-Tomas app-cli % python main.py
Main Menu:
[1] Set up Zendesk credentials
[2] Update Zendesk credentials
[3] Admin Actions
-------------------------------------------------
[4] Documentation
[0] Exit App >>
Enter your choice:
This command will display the Main Menu, guiding you through the available commands and options.
Before using the commands and functionalities, you need to set up your credentials. Navigate to 'Set up Zendesk credentials' from the Main Menu and provide your Zendesk email, domain, and API token.
Main Menu:
[1] Set up Zendesk credentials
[2] Update Zendesk credentials
[3] Admin Actions
-------------------------------------------------
[4] Documentation
[0] Exit App >>
Enter your choice: 1
Let's set the credentials
Enter your user email:
The application will prompt you to enter your user email, domain, API Token, and environment
Enter your choice: 1
Let's set the credentials
Enter your user email: [email protected]
Enter your company name for the Zendesk domain (example: 'your_company', for 'your_company.zendesk.com'): mycompany
Enter your Zendesk API token (it will not appear here):
Repeat for confirmation:
Is this for production or sandbox?: production
Upon entering the credentials (email, API token, and domain), the app initiates an API call to this endpoint: {domain}api/v2/users/me.json. The app verifies the correctness of the credentials by making an API call to check them. If the verification is successful, the app creates a .env
file where it stores the credentials from that point forward and uses them for any action:
[PRODUCTION] Connection verified successfully!
[PRODUCTION] Credentials saved in .env file
--------------------------------------------------------------------------------
[PRODUCTION] CONFIGURATION:
USER EMAIL: [email protected] - DOMAIN: https://mycompany.zendesk.com/
Token: ie3cdCgLFa********************************
[PRODUCTION] App is correctly configured to be used in Production
--------------------------------------------------------------------------------
Run the app again!
Credentials can also be modified in option [2] Update Zendesk Credentials or you can simply delete them by removing the .env
file
Contributions to the Typer Zendesk CLI Tool are welcome! Feel free to fork the repository, make your changes, and submit a pull request. The app includes functionalities that I use in my day-to-day activities, but if you have any suggestions or additional features you'd like to see, just open an issue, and I will consider expanding the app's capabilities.
If you are Zendesk Admin and you have questions, suggestions, or issues, please open an issue on the GitHub repository.
The Typer Zendesk CLI Tool is released under the MIT License. See the LICENSE file for more details.
I would also like to extend a heartfelt thank you to Sebastián Ramírez, the creator of Typer, for developing such a cool tool. Thank you for your contribution to the open-source community!