Implementing Tencent Gongfeng Project Search with Alfred

This article introduces how to implement Tencent Gongfeng project search using Alfred, including the advantages of Gongfeng project search, implementation details, and related resources. These steps can help improve the efficiency of searching Gongfeng projects.

Dec 6, 2021 · 2 min read · 273 Words · -Views -Comments · Software & Tools
Productivity Tools 🇨🇳 阅读中文版
Read with AI

Choose an AI assistant

ChatGPT Open in a new tab with the article link and prompt
Claude Copy the prompt, then open Claude

Open Claude
Trouble reading the article?

If the prompt is missing, copy the full prompt below into your AI assistant. If the AI cannot read the article, paste the visible passage you want to discuss and add your question.

At work, I often need to search repository code on Gongfeng and quickly perform certain operations. Doing multiple operations directly in the browser is still not efficient enough, so I created a workflow. The general effect is like GitHub for Alfred.

Workflow download link

Implementation Foundation

Gongfeng provides APIs, such as fuzzy project search, so keyword-based project search functionality can be implemented. For specific APIs, refer to here

By applying for an access token for the corresponding account, you can directly call the API to get results. I verified this works using Mac Paw.

Implementation

Using the CLI I developed earlier, this was implemented quickly. Since daily work involves accessing multiple Gongfeng services [intranet version, community version, etc.], the workflow supports multiple Gongfeng service configurations.

Currently supports searching up to 2 Gongfeng services. The principle is the same - just concurrent requests to 2 addresses. If you want to support more in the future, just increase the number of parallel request addresses.

Usage

  1. Access Gongfeng service, such as https://git.code.tencent.com/profile/account, click Create temporary token

  2. Configure the token and git address in the workflow environment variables

In addition to search functionality, the workflow also provides commonly used features:

  1. gc + keyword for fuzzy search
  2. ⌘ C directly copy repo’s web address
  3. ⏎ browser access to repo’s web address
  4. ⌘ ⏎ copy SSH repo address
  5. ⌥ ⏎ select MR, then ⌥ ⏎ shows repo’s open Merge Requests, also supports keyword search

Overall design: ⏎ opens corresponding URLs in browser, ⌥ for further operations.

Final Thoughts

  1. With this workflow, accessing repos starts with search first, then Enter to access specific repos, which is more convenient than before.

img

Authors
Developer, digital product enthusiast, tinkerer, sharer, open source lover