workspace-manager

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Workspace Manager

工作区管理器

Manage workspaces stored in
~/.brn/config.yaml
. Each workspace represents a logical development context (e.g., "personal", "work", "client-acme").
管理存储在
~/.brn/config.yaml
中的工作区。每个工作区代表一个逻辑开发环境(例如:"personal"、"work"、"client-acme")。

Quick Reference

快速参考

ActionScript
Create workspace
scripts/create_workspace.sh <name> <work_dir>
List workspaces
scripts/list_workspaces.sh
Show active
scripts/get_active_workspace.sh
Switch workspace
scripts/switch_workspace.sh <name>
Configure workspace
scripts/configure_workspace.sh <name> <key> <value>
操作脚本
创建工作区
scripts/create_workspace.sh <name> <work_dir>
列出工作区
scripts/list_workspaces.sh
查看活跃工作区
scripts/get_active_workspace.sh
切换工作区
scripts/switch_workspace.sh <name>
配置工作区
scripts/configure_workspace.sh <name> <key> <value>

Config Structure

配置结构

Global:
~/.brn/config.yaml

全局配置:
~/.brn/config.yaml

yaml
version: "1.0"
active_workspace: personal
workspaces:
  personal:
    path: ~/dev/personal/auto
    github_token: ghp_xxxx
    jira_token: null
    jira_url: null
    jira_email: null
    # Automation settings (all default to false for safety)
    automation:
      github_auto_push: false      # Auto-push commits
      github_auto_pr: false        # Auto-create PRs
      jira_auto_transition: false  # Auto-update ticket status
      jira_auto_comment: false     # Auto-add comments
  work:
    path: ~/dev/work/auto
    github_token: ghp_yyyy
    jira_token: jira_xxxx
    jira_url: https://company.atlassian.net
    jira_email: you@company.com
    automation:
      github_auto_push: true       # Work flow might be more automated
      github_auto_pr: false
      jira_auto_transition: true
      jira_auto_comment: true
yaml
version: "1.0"
active_workspace: personal
workspaces:
  personal:
    path: ~/dev/personal/auto
    github_token: ghp_xxxx
    jira_token: null
    jira_url: null
    jira_email: null
    # 自动化设置(默认均为false以保障安全)
    automation:
      github_auto_push: false      # 自动推送提交
      github_auto_pr: false        # 自动创建PR
      jira_auto_transition: false  # 自动更新工单状态
      jira_auto_comment: false     # 自动添加评论
  work:
    path: ~/dev/work/auto
    github_token: ghp_yyyy
    jira_token: jira_xxxx
    jira_url: https://company.atlassian.net
    jira_email: you@company.com
    automation:
      github_auto_push: true       # 工作流程可更自动化
      github_auto_pr: false
      jira_auto_transition: true
      jira_auto_comment: true

Workflow Examples

工作流示例

Create a new workspace

创建新工作区

bash
undefined
bash
undefined

Create workspace with work directory

创建带工作目录的工作区

./scripts/create_workspace.sh personal ~/dev/personal/auto
./scripts/create_workspace.sh personal ~/dev/personal/auto

Configure GitHub token

配置GitHub令牌

./scripts/configure_workspace.sh personal github_token ghp_xxxxx
undefined
./scripts/configure_workspace.sh personal github_token ghp_xxxxx
undefined

Switch context

切换环境

bash
undefined
bash
undefined

See what's available

查看可用工作区

./scripts/list_workspaces.sh
./scripts/list_workspaces.sh

Switch to work context

切换到工作环境

./scripts/switch_workspace.sh work
undefined
./scripts/switch_workspace.sh work
undefined

Integration

集成

Other brn skills should call
get_active_workspace.sh
to determine which config context to use for API tokens and work directories.
其他brn技能应调用
get_active_workspace.sh
来确定API令牌和工作目录应使用哪个配置环境。