Skip to content

Telescope-X 闪搭X

极简开发者工具箱 - Smart Parser、Port Killer、Transformer,一个插件全搞定

简介

Telescope-X(闪搭X)是专为开发者打造的超级面板工具箱,集成了日常开发中最常用的实用工具。极简设计,一秒唤起,让您的开发效率倍增。

核心特性

  • Smart Parser - 智能解析器,支持 JSON、YAML、XML、Base64 等多种格式转换
  • Port Killer - 端口治理工具,快速查看和终止占用端口的进程
  • Transformer - 内容转换器,文本格式化、编码转换、正则测试
  • Password Generator - 安全密码生成器
  • Key Listener - 键盘事件监听器
  • QR Generator - 二维码生成器

安装

Spark 插件市场安装

  1. 打开 Spark (Cmd/Ctrl + K)
  2. 输入 "Telescope-X" 或 "闪搭X"
  3. 回车进入插件页面
  4. 点击安装

命令行安装

bash
spark install spark-plugin-system--telescope-x

快速开始

唤起超级面板

安装后,使用快捷键唤起:

bash
# macOS
Cmd + Shift + X

# Windows/Linux
Ctrl + Shift + X

命令列表

命令功能
parse智能解析器
port端口治理
transform内容转换
password密码生成
key键盘监听
qr二维码生成

Smart Parser 智能解析

自动识别并解析多种格式:

支持格式

typescript
// JSON 解析和格式化
{
  "name": "spark",
  "version": "1.0.0"
}

// YAML 解析
name: spark
version: 1.0.0

// XML 解析
<config>
  <name>spark</name>
  <version>1.0.0</version>
</config>

// Base64 解码
SGVsbG8gU3BhcmsgIQ==

// URL 编解码
https%3A%2F%2Fspark.center

// 时间戳转换
1704067200000

// 颜色转换
#007aff -> rgb(0, 122, 255)

使用示例

bash
# 命令行使用
telescope parse '{"name":"spark"}' --format json
telescope parse 'SGVsbG8=' --format base64 --decode

# 快捷键唤起后直接粘贴内容
Cmd + Shift + X parse 粘贴

Port Killer 端口治理

快速查看和终止占用端口的进程。

查看端口占用

bash
# 查看特定端口
telescope port :8080

# 列出所有占用端口
telescope port --list

# 筛选特定进程
telescope port --filter node

终止进程

bash
# 终止指定端口的进程
telescope port :3000 --kill

# 强制终止
telescope port :3000 --force-kill

端口列表示例

端口进程PID操作
:8080Node.js1420终止
:3306MySQL882-
:5432PostgreSQL1024终止
:6333LocalTuya45001终止

Transformer 内容转换

强大的文本转换工具。

JSON 操作

bash
# JSON 美化
echo '{"a":1}' | telescope transform --json-beautify

# JSON 压缩
echo '{"a": 1}' | telescope transform --json-minify

# JSON 转 YAML
echo '{"a":1}' | telescope transform --json2yaml

编码转换

bash
# Base64 编码
echo "Hello Spark" | telescope transform --base64

# URL 编码
echo "hello world" | telescope transform --url-encode

# HTML 转义
echo "<script>" | telescope transform --html-escape

文本处理

bash
# 大小写转换
telescope transform --upper "hello"
telescope transform --lower "HELLO"

# 驼峰转换
telescope transform --camel-case "hello_world"
telescope transform --kebab-case "helloWorld"

# 去除空行
telescope transform --trim-empty < file.txt

# 排序
telescope transform --sort < file.txt

正则测试

bash
# 测试正则表达式
telescope transform --regex '\d+' "abc123def456"
# 匹配结果: 123, 456

# 替换
telescope transform --replace '\d+' 'X' "abc123"
# 结果: abcX

Password Generator 密码生成

生成安全的随机密码。

bash
# 生成 16 位密码
telescope password --length 16

# 包含特殊字符
telescope password --special

# 仅数字
telescope password --numeric

# 生成多个密码
telescope password --count 5 --length 12

密码选项

选项说明
--length密码长度(默认 16)
--numeric仅数字
--alpha仅字母
--special包含特殊字符
--exclude排除指定字符
--count生成数量

Key Listener 键盘监听

监听和记录键盘事件。

bash
# 启动监听
telescope key

# 监听特定按键
telescope key --filter "Cmd+K"

# 输出格式
telescope key --format json

输出示例

[2024-01-15 10:30:15] Cmd + K
[2024-01-15 10:30:16] Enter
[2024-01-15 10:30:17] Escape

QR Generator 二维码生成

快速生成二维码。

bash
# 生成 URL 二维码
telescope qr "https://spark.center"

# 保存为图片
telescope qr "Hello" --output qrcode.png

# 自定义尺寸
telescope qr "https://spark.center" --size 512

# 自定义颜色
telescope qr "Spark" --color "#007aff"

配置文件

Telescope-X 支持自定义配置:

json
{
  "shortcuts": {
    "parse": "Cmd+Shift+P",
    "port": "Cmd+Shift+O",
    "transform": "Cmd+Shift+T"
  },
  "parser": {
    "autoDetect": true,
    "defaultFormat": "json"
  },
  "port": {
    "refreshInterval": 2000,
    "showAllPorts": false
  },
  "ui": {
    "theme": "dark",
    "fontSize": 14
  }
}

配置文件位置:~/.spark/telescope-x/config.json

快捷键

快捷键功能
Cmd/Ctrl + Shift + X唤起超级面板
Cmd/Ctrl + Shift + P智能解析
Cmd/Ctrl + Shift + O端口治理
Cmd/Ctrl + Shift + T内容转换
ESC关闭面板

API 使用

Telescope-X 也提供 API 供其他插件调用:

typescript
import { Telescope } from '@spark-center/telescope-x'

// 解析内容
const parsed = await Telescope.parse('{"a":1}', { format: 'json' })

// 查询端口
const ports = await Telescope.getPortInfo(8080)

// 生成密码
const password = await Telescope.generatePassword({ length: 16 })

最佳实践

  1. 快捷键记忆 - 将常用功能绑定到顺手的快捷键
  2. 自定义配置 - 根据使用习惯调整配置
  3. 组合使用 - 将多个工具串联使用,提高效率

常见问题

终止进程安全吗?

Telescope-X 只会显示用户级别的进程,不会影响系统关键进程。终止前会显示确认提示。

支持命令行管道操作吗?

支持。所有工具都支持标准输入/输出,可以方便地与其他命令组合使用。

如何添加自定义转换规则?

在配置文件中添加 transform.customRules 字段:

json
{
  "transform": {
    "customRules": [
      {
        "name": "my-transform",
        "pattern": "(.*)",
        "replacement": "PREFIX_$1"
      }
    ]
  }
}

相关资源

Stellar Efficiency, Born in Innovation.