mcpField
S
swanlab-setup

swanlab-setup

github.com/ascendCloud & DevOps52101 installsUpdated 25w ago
Repository

About swanlab-setup

swanlab-setup is a shell-based skill for configuring SwanLab in the current environment or a named container. It resolves credentials from environment variables, a configuration file, or interactive input, then supports login and connectivity checks.

Key features

  1. 01Environment, file, and prompt configuration
  2. 02Save and load SwanLab credentials
  3. 03Configure the current environment
  4. 04Set up SwanLab inside a container
  5. 05Check login and network connectivity

Use cases

  1. 01Initializing SwanLab from environment variables
  2. 02Saving configuration for later sessions
  3. 03Setting up SwanLab in a container
  4. 04Checking authentication and connectivity

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/ascend/agent-skills --skill swanlab-setup

After installing, type/swanlab-setupin Claude Code to confirm it loaded.

Bundled filesscripts/functions.shscripts/swanlab_check.sh

Details

From the project README

SwanLab 配置管理

快速使用

# source 共享函数库
source scripts/functions.sh

# 在当前环境配置 SwanLab
swanlab_setup

# 为指定容器配置
swanlab_setup_for_container my_container

# 检查连接状态
swanlab_check

配置获取优先级

环境变量 > 配置文件 > 交互式输入

方式变量/路径说明
环境变量SWANLAB_HOST, SWANLAB_API_KEY推荐方式
配置文件~/.verl/swanlab.conf首次交互后自动保存
交互式输入终端提示仅在交互式终端下触发

API

脚本 scripts/functions.sh 提供 sourceable 函数:

函数用途
swanlab_clear_proxy清除代理设置(SwanLab 连接需要)
swanlab_load_config加载配置(环境变量 > 文件)
swanlab_save_config HOST KEY保存配置到 ~/.verl/swanlab.conf
swanlab_prompt_config交互式获取配置
swanlab_init按优先级初始化配置
swanlab_login在当前环境执行 pip install + swanlab login
swanlab_setup完整流程:clear_proxy + init + login
swanlab_setup_for_container NAME在指定容器内执行 swanlab_setup
swanlab_check检查登录状态和网络连通性

其他 Skill 调用方式

# 1. 发现 skill 路径(推荐通过环境变量)
SWANLAB_SETUP_PATH="${SWANLAB_SETUP_PATH:-$(dirname "$(find ~/.claude/skills/swanlab-setup -name functions.sh 2>/dev/null || echo "")")}"

# 2. source 函数库
source "$SWANLAB_SETUP_PATH/scripts/functions.sh"

# 3. 调用
swanlab_setup

脚本结构

swanlab-setup/
├── SKILL.md              # 本文档
└── scripts/
    ├── functions.sh      # 共享函数库(被其他 skill source)
    └── swanlab_check.sh  # 独立检查脚本

Comments

Markdown supported