workspace-cli

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Workspace CLI Skill

Workspace CLI 技能文档

Unified CLI interface for all workspace-hub management tools across 26+ repositories.
为26+个仓库提供统一的workspace-hub管理工具CLI界面。

Quick Start

快速开始

bash
undefined
bash
undefined

Launch interactive menu

启动交互式菜单

./scripts/workspace
./scripts/workspace

Direct repository sync

直接同步仓库

./scripts/repository_sync status all
./scripts/repository_sync status all

Quick compliance check

快速合规检查

./scripts/compliance/verify_compliance.sh
undefined
./scripts/compliance/verify_compliance.sh
undefined

When to Use

适用场景

  • Starting a work session and need quick access to common tools
  • Managing multiple repositories with bulk operations
  • Running compliance checks across the workspace
  • Accessing development tools and refactoring utilities
  • Configuring system settings and remote connections
  • 开启工作会话时,需要快速访问常用工具
  • 批量管理多个仓库
  • 在整个工作区运行合规检查
  • 访问开发工具与重构工具
  • 配置系统设置与远程连接

Prerequisites

前置条件

  • Access to workspace-hub repository
  • Bash shell (Linux/macOS/WSL)
  • Scripts marked as executable (
    chmod +x ./scripts/workspace
    )
  • 拥有workspace-hub仓库的访问权限
  • Bash shell环境(Linux/macOS/WSL)
  • 脚本已设置为可执行状态(
    chmod +x ./scripts/workspace

Overview

概述

The Workspace CLI provides a unified interface to all workspace-hub management tools. This skill covers navigation, common operations, and integration with other workspace systems.
Workspace CLI为所有workspace-hub管理工具提供统一操作界面。本技能涵盖工具导航、常见操作及与其他工作区系统的集成。

Direct Script Access

直接访问脚本

bash
undefined
bash
undefined

Repository management

仓库管理

./scripts/repository/configure_repos.sh
./scripts/repository/configure_repos.sh

Compliance tools

合规工具

./scripts/compliance/verify_compliance.sh
./scripts/compliance/verify_compliance.sh

Development tools

开发工具

./scripts/development/refactor-analysis.sh
./scripts/development/refactor-analysis.sh

System tools

系统工具

./scripts/system/sync
undefined
./scripts/system/sync
undefined

Main Menu Structure

主菜单结构

+================================================================+
|              Workspace Hub - Management Console                 |
+================================================================+

Workspace Management:

  1) Repository Management
  2) Compliance & Standards
  3) Remote Connection Tools
  4) Development Tools
  5) System Setup & Configuration
  6) Help & Documentation

  0) Exit
+================================================================+
|              Workspace Hub - 管理控制台                 |
+================================================================+

工作区管理:

  1) 仓库管理
  2) 合规与标准
  3) 远程连接工具
  4) 开发工具
  5) 系统设置与配置
  6) 帮助与文档

  0) 退出

Execution Checklist

执行检查清单

  • Navigate to workspace-hub root directory
  • Verify scripts are executable (
    chmod +x ./scripts/workspace
    )
  • Launch CLI with
    ./scripts/workspace
  • Select appropriate menu category
  • Execute required operation
  • Verify operation success
  • Exit cleanly (option 0)
  • 导航至workspace-hub根目录
  • 验证脚本可执行(
    chmod +x ./scripts/workspace
  • 通过
    ./scripts/workspace
    启动CLI
  • 选择对应的菜单分类
  • 执行所需操作
  • 验证操作成功
  • 正常退出(选项0)

Category Details

分类详情

1. Repository Management

1. 仓库管理

Access multi-repository git operations:
Repository Management:

  1) Repository Sync Manager       # Full git operations menu
  2) Configure Repository URLs     # Setup GitHub URLs
  3) Check All Repository Status   # Quick status overview

  0) Back to main menu
Common Operations:
bash
undefined
访问多仓库git操作:
仓库管理:

  1) 仓库同步管理器       # 完整git操作菜单
  2) 配置仓库URL     # 设置GitHub地址
  3) 检查所有仓库状态   # 快速状态概览

  0) 返回主菜单
常见操作:
bash
undefined

List all repositories

列出所有仓库

./scripts/repository_sync list all
./scripts/repository_sync list all

Sync all work repositories

同步所有工作仓库

./scripts/repository_sync sync work -m "Update"
./scripts/repository_sync sync work -m "Update"

Pull latest from all repos

拉取所有仓库最新代码

./scripts/repository_sync pull all
./scripts/repository_sync pull all

Check status

检查状态

./scripts/repository_sync status all
undefined
./scripts/repository_sync status all
undefined

2. Compliance & Standards

2. 合规与标准

Enforce coding standards and guidelines:
Compliance & Standards:

  1) Propagation Tools            # Spread standards
  2) Compliance Enforcement       # Setup and hooks
  3) Verification Tools           # Check status

  0) Back to main menu
Propagation Tools:
bash
undefined
执行编码标准与规范:
合规与标准:

  1) 规范同步工具            # 同步标准配置
  2) 合规强制执行       # 初始化与钩子设置
  3) 合规验证工具           # 检查合规状态

  0) 返回主菜单
规范同步工具:
bash
undefined

Sync CLAUDE.md to all repos

将CLAUDE.md同步至所有仓库

./scripts/compliance/propagate_claude_config.py
./scripts/compliance/propagate_claude_config.py

Sync AI guidelines

同步AI指南

./scripts/compliance/propagate_guidelines.sh
./scripts/compliance/propagate_guidelines.sh

Enable interactive mode

启用交互模式

./scripts/compliance/propagate_interactive_mode.sh

**Enforcement:**
```bash
./scripts/compliance/propagate_interactive_mode.sh

**强制执行:**
```bash

Initial setup

初始化设置

./scripts/compliance/setup_compliance.sh
./scripts/compliance/setup_compliance.sh

Install git hooks

安装git钩子

./scripts/compliance/install_compliance_hooks.sh
./scripts/compliance/install_compliance_hooks.sh

Verify compliance

验证合规性

./scripts/compliance/verify_compliance.sh
undefined
./scripts/compliance/verify_compliance.sh
undefined

3. Remote Connection Tools

3. 远程连接工具

Manage remote workspace connections:
Remote Connection Tools:

  1) Linux Connection Tools
  2) Windows Connection Tools
  3) Tailscale Connection Tools

  0) Back to main menu
Linux:
bash
./scripts/connection/connect-workspace-linux.sh
./scripts/connection/sync-tabby-linux.sh
Windows:
powershell
./scripts/connection/connect-workspace-windows.ps1
./scripts/connection/sync-tabby-windows.ps1
Tailscale:
bash
./scripts/connection/connect-workspace-tailscale.sh    # Bash
./scripts/connection/connect-workspace-tailscale.ps1   # PowerShell
管理远程工作区连接:
远程连接工具:

  1) Linux连接工具
  2) Windows连接工具
  3) Tailscale连接工具

  0) 返回主菜单
Linux:
bash
./scripts/connection/connect-workspace-linux.sh
./scripts/connection/sync-tabby-linux.sh
Windows:
powershell
./scripts/connection/connect-workspace-windows.ps1
./scripts/connection/sync-tabby-windows.ps1
Tailscale:
bash
./scripts/connection/connect-workspace-tailscale.sh    # Bash
./scripts/connection/connect-workspace-tailscale.ps1   # PowerShell

4. Development Tools

4. 开发工具

AI-powered development and code quality:
Development Tools:

  1) Factory.ai Tools             # Install Factory.ai
  2) Refactor Analysis            # Code quality analysis
  3) Droid CLI                    # Factory.ai droid wrapper

  0) Back to main menu
Refactor Analysis:
bash
undefined
AI驱动的开发与代码质量工具:
开发工具:

  1) Factory.ai 工具             # 安装Factory.ai
  2) 重构分析            # 代码质量分析
  3) Droid CLI                    # Factory.ai droid封装工具

  0) 返回主菜单
重构分析:
bash
undefined

Run full analysis

运行完整分析

./scripts/development/refactor-analysis.sh
./scripts/development/refactor-analysis.sh

Output in .refactor-reports/

输出至.refactor-reports/目录


Analysis includes:
- Code duplication (jscpd)
- Dead code detection (knip)
- Slow test identification
- Large file detection
- Outdated dependencies

**Factory.ai:**
```bash

分析内容包括:
- 代码重复检测(jscpd)
- 死代码检测(knip)
- 慢测试识别
- 大文件检测
- 过期依赖检查

**Factory.ai:**
```bash

Install Factory.ai

安装Factory.ai

./scripts/development/install_factory_ai.sh
./scripts/development/install_factory_ai.sh

Use droid CLI

使用droid CLI

./scripts/development/droid --help
undefined
./scripts/development/droid --help
undefined

5. System Setup & Configuration

5. 系统设置与配置

System-level configuration:
System Setup & Configuration:

  1) Workspace Sync               # Full workspace sync
  2) Setup XRDP                   # Remote desktop
  3) View System Information      # Workspace stats

  0) Back to main menu
Workspace Sync:
bash
./scripts/system/sync
Performs:
  • Git repository synchronization
  • MCP server installation
  • UV environment setup
  • NPM package management
  • Agent configuration
系统级配置:
系统设置与配置:

  1) 工作区同步               # 完整工作区同步
  2) 安装XRDP                   # 远程桌面
  3) 查看系统信息      # 工作区状态统计

  0) 返回主菜单
工作区同步:
bash
./scripts/system/sync
执行内容:
  • Git仓库同步
  • MCP服务器安装
  • UV环境配置
  • NPM包管理
  • Agent配置

6. Help & Documentation

6. 帮助与文档

Access documentation and help:
Help & Documentation:

  1) Repository Sync Documentation
  2) View README
  3) Available Commands
  4) Quick Start Guide

  0) Back to main menu
访问文档与帮助:
帮助与文档:

  1) 仓库同步文档
  2) 查看README
  3) 可用命令列表
  4) 快速开始指南

  0) 返回主菜单

Script Organization

脚本组织结构

scripts/
+-- workspace                    # Main CLI entry point
|
+-- repository/                  # Repository management
|   +-- configure_repos.sh
|   +-- check_all_status.sh
|
+-- compliance/                  # Compliance tools
|   +-- propagate_claude_config.py
|   +-- propagate_guidelines.sh
|   +-- propagate_interactive_mode.sh
|   +-- setup_compliance.sh
|   +-- install_compliance_hooks.sh
|   +-- verify_compliance.sh
|
+-- connection/                  # Remote connections
|   +-- connect-workspace-linux.sh
|   +-- connect-workspace-windows.ps1
|   +-- connect-workspace-tailscale.sh
|   +-- connect-workspace-tailscale.ps1
|   +-- sync-tabby-linux.sh
|   +-- sync-tabby-windows.ps1
|
+-- development/                 # Development tools
|   +-- install_factory_ai.sh
|   +-- refactor-analysis.sh
|   +-- droid
|
+-- system/                      # System configuration
    +-- sync
    +-- setup_xrdp.sh
scripts/
+-- workspace                    # 主CLI入口
|
+-- repository/                  # 仓库管理
|   +-- configure_repos.sh
|   +-- check_all_status.sh
|
+-- compliance/                  # 合规工具
|   +-- propagate_claude_config.py
|   +-- propagate_guidelines.sh
|   +-- propagate_interactive_mode.sh
|   +-- setup_compliance.sh
|   +-- install_compliance_hooks.sh
|   +-- verify_compliance.sh
|
+-- connection/                  # 远程连接
|   +-- connect-workspace-linux.sh
|   +-- connect-workspace-windows.ps1
|   +-- connect-workspace-tailscale.sh
|   +-- connect-workspace-tailscale.ps1
|   +-- sync-tabby-linux.sh
|   +-- sync-tabby-windows.ps1
|
+-- development/                 # 开发工具
|   +-- install_factory_ai.sh
|   +-- refactor-analysis.sh
|   +-- droid
|
+-- system/                      # 系统配置
    +-- sync
    +-- setup_xrdp.sh

Common Workflows

常见工作流

Daily Development Start

日常开发启动

bash
undefined
bash
undefined

1. Launch workspace CLI

1. 启动工作区CLI

./scripts/workspace
./scripts/workspace

2. Repository Management -> Repository Sync Manager

2. 仓库管理 -> 仓库同步管理器

3. Navigate to: Pull -> All

3. 导航至:拉取 -> 所有仓库

Or directly:

或直接执行:

./scripts/repository_sync pull all
undefined
./scripts/repository_sync pull all
undefined

End of Day Sync

每日结束同步

bash
undefined
bash
undefined

Sync all work with commit message

同步所有工作仓库并添加提交信息

./scripts/repository_sync sync work -m "$(date +%Y-%m-%d) updates"
undefined
./scripts/repository_sync sync work -m "$(date +%Y-%m-%d) updates"
undefined

Setup New Repository

新仓库初始化

bash
undefined
bash
undefined

1. Configure URLs

1. 配置仓库URL

./scripts/repository/configure_repos.sh
./scripts/repository/configure_repos.sh

2. Clone repository

2. 克隆仓库

./scripts/repository_sync clone <repo-name>
./scripts/repository_sync clone <repo-name>

3. Setup compliance

3. 配置合规检查

./scripts/compliance/setup_compliance.sh
undefined
./scripts/compliance/setup_compliance.sh
undefined

Code Quality Check

代码质量检查

bash
undefined
bash
undefined

Run refactor analysis

运行重构分析

./scripts/development/refactor-analysis.sh
./scripts/development/refactor-analysis.sh

Check compliance

检查合规性

./scripts/compliance/verify_compliance.sh
undefined
./scripts/compliance/verify_compliance.sh
undefined

Propagate Standards

规范同步

bash
undefined
bash
undefined

Update all repos with latest standards

更新所有仓库至最新规范

./scripts/compliance/propagate_claude_config.py ./scripts/compliance/propagate_guidelines.sh ./scripts/compliance/propagate_interactive_mode.sh
undefined
./scripts/compliance/propagate_claude_config.py ./scripts/compliance/propagate_guidelines.sh ./scripts/compliance/propagate_interactive_mode.sh
undefined

Error Handling

错误处理

Menu Display Issues

菜单显示异常

bash
undefined
bash
undefined

Check terminal supports ANSI

检查终端是否支持ANSI

echo $TERM
echo $TERM

Run with basic terminal

使用基础终端模式运行

TERM=xterm ./scripts/workspace
undefined
TERM=xterm ./scripts/workspace
undefined

Script Not Found

脚本未找到

bash
undefined
bash
undefined

Verify workspace root

验证是否在工作区根目录

pwd
pwd

Should be: /mnt/github/workspace-hub

路径应为: /mnt/github/workspace-hub

Make scripts executable

设置脚本可执行权限

chmod +x ./scripts/workspace chmod +x ./scripts//.sh
undefined
chmod +x ./scripts/workspace chmod +x ./scripts//.sh
undefined

Permission Denied

权限不足

bash
undefined
bash
undefined

Fix permissions

修复权限

chmod +x ./scripts/workspace chmod +x ./scripts//.sh chmod +x ./scripts//.py
undefined
chmod +x ./scripts/workspace chmod +x ./scripts//.sh chmod +x ./scripts//.py
undefined

Configuration Missing

配置缺失

bash
undefined
bash
undefined

Run configuration helper

运行配置助手

./scripts/repository/configure_repos.sh
./scripts/repository/configure_repos.sh

Or edit directly

或直接编辑配置文件

nano config/repos.conf
undefined
nano config/repos.conf
undefined

Metrics & Success Criteria

指标与成功标准

  • Navigation Speed: Access any tool in < 3 menu selections
  • Script Execution: 100% success rate for available scripts
  • Cross-Platform: Works on Linux, macOS, WSL
  • Documentation: All menu options have help text
  • Error Handling: Clear error messages with recovery steps
  • 导航速度: 3步以内访问任意工具
  • 脚本执行率: 可用脚本执行成功率100%
  • 跨平台支持: 兼容Linux、macOS、WSL
  • 文档覆盖: 所有菜单选项均有帮助文本
  • 错误处理: 清晰的错误提示及恢复步骤

Navigation Tips

导航技巧

Keyboard Navigation

键盘导航

  • Number keys: Select menu options
  • 0: Go back / Exit
  • Ctrl+C: Force exit
  • 数字键: 选择菜单选项
  • 0: 返回/退出
  • Ctrl+C: 强制退出

Direct Access

直接访问

Skip menus with direct commands:
bash
undefined
跳过菜单直接执行命令:
bash
undefined

Instead of navigating menus

替代菜单导航

./scripts/workspace
./scripts/workspace

Use direct script path

直接使用脚本路径

./scripts/repository_sync sync all -m "Quick update"
undefined
./scripts/repository_sync sync all -m "Quick update"
undefined

Command Aliases

命令别名

Add to
.bashrc
or
.zshrc
:
bash
undefined
添加至
.bashrc
.zshrc
:
bash
undefined

Workspace CLI aliases

工作区CLI别名

alias ws='./scripts/workspace' alias rs='./scripts/repository_sync' alias rsync='./scripts/repository_sync sync all' alias rstatus='./scripts/repository_sync status all' alias rpull='./scripts/repository_sync pull all'
undefined
alias ws='./scripts/workspace' alias rs='./scripts/repository_sync' alias rsync='./scripts/repository_sync sync all' alias rstatus='./scripts/repository_sync status all' alias rpull='./scripts/repository_sync pull all'
undefined

Integration Points

集成点

With Repository Sync

与仓库同步工具集成

The CLI wraps repository_sync for menu access:
bash
undefined
CLI封装了repository_sync以支持菜单访问:
bash
undefined

Menu access

菜单访问

./scripts/workspace -> 1 -> 1
./scripts/workspace -> 1 -> 1

Direct access

直接访问

./scripts/repository_sync <command>
undefined
./scripts/repository_sync <command>
undefined

With Compliance System

与合规系统集成

bash
undefined
bash
undefined

Menu access

菜单访问

./scripts/workspace -> 2 -> 3
./scripts/workspace -> 2 -> 3

Direct access

直接访问

./scripts/compliance/verify_compliance.sh
undefined
./scripts/compliance/verify_compliance.sh
undefined

With AI Agents

与AI Agents集成

AI agents can use CLI scripts:
python
undefined
AI Agents可调用CLI脚本:
python
undefined

Run status check

运行状态检查

subprocess.run(['./scripts/repository_sync', 'status', 'all'])
subprocess.run(['./scripts/repository_sync', 'status', 'all'])

Verify compliance

验证合规性

subprocess.run(['./scripts/compliance/verify_compliance.sh'])
undefined
subprocess.run(['./scripts/compliance/verify_compliance.sh'])
undefined

Related Skills

相关技能

  • repo-sync - Repository synchronization
  • compliance-check - Compliance verification
  • sparc-workflow - Development methodology
  • repo-sync - 仓库同步
  • compliance-check - 合规验证
  • sparc-workflow - 开发方法论

Environment Variables

环境变量

Supported Variables

支持的变量

bash
undefined
bash
undefined

Default editor for config editing

配置文件默认编辑器

export EDITOR=vim
export EDITOR=vim

Log level

日志级别

export LOG_LEVEL=INFO
export LOG_LEVEL=INFO

Parallel operations

并行任务数

export PARALLEL_JOBS=4
undefined
export PARALLEL_JOBS=4
undefined

Configuration File

配置文件

Location:
config/workspace.conf
bash
undefined
路径:
config/workspace.conf
bash
undefined

Workspace configuration

工作区配置

DEFAULT_SYNC_MESSAGE="Workspace sync" PARALLEL_ENABLED=true MAX_PARALLEL_JOBS=4
undefined
DEFAULT_SYNC_MESSAGE="Workspace sync" PARALLEL_ENABLED=true MAX_PARALLEL_JOBS=4
undefined

References

参考文档

  • WORKSPACE_CLI.md
  • REPOSITORY_SYNC.md
  • CLI_MENU_STRUCTURE.md

  • WORKSPACE_CLI.md
  • REPOSITORY_SYNC.md
  • CLI_MENU_STRUCTURE.md

Version History

版本历史

  • 1.1.0 (2026-01-02): Upgraded to SKILL_TEMPLATE_v2 format - added When to Use, Execution Checklist, Error Handling consolidation, Metrics, Integration Points
  • 1.0.0 (2024-10-15): Initial release with 6 main categories, script organization, workflows, navigation, troubleshooting
  • 1.1.0 (2026-01-02): 升级至SKILL_TEMPLATE_v2格式 - 新增适用场景、执行检查清单、错误处理汇总、指标、集成点
  • 1.0.0 (2024-10-15): 初始版本,包含6个主分类、脚本结构、工作流、导航、故障排除