Try   HackMD

安裝 TWCC CLI 並登入

以下以 TWS Ubuntu 24.04 以及 Windows Server 2022 為操作範例,若 OS 版本不相同流程可能會有差異,再請您自行查找版本適用的相關流程。

Step 1. 建立 VCS (使用地端主機可略)

以下操作以此版本為例:

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

步驟請參考:https://docs.twcc.ai/docs/user-guides/twcc/vcs/create-instance

Step 2. 安裝 TWCC CLI

Ubuntu 24.04

  • 安裝虛擬環境工具(如果尚未安裝)
sudo apt install python3-venv
  • 創建一個虛擬環境
python3 -m venv myenv
  • 啟動虛擬環境
source myenv/bin/activate
  • 在虛擬環境中安裝所需的套件
pip3 install -U TWCC-CLI
  • 更新工具
pip3 install --upgrade setuptools

Windows Server 2022

  • 連線進入 VCS 後,下載並安裝 Python
    將以下選項打勾:

    Image Not Showing Possible Reasons
    • The image was uploaded to a note which you don't have access to
    • The note which the image was originally uploaded to has been deleted
    Learn More →

  • 確認安裝成功

    • 開啟 PowerShell
    • 輸入 python verison,成功安裝將返回版本號碼
      Image Not Showing Possible Reasons
      • The image was uploaded to a note which you don't have access to
      • The note which the image was originally uploaded to has been deleted
      Learn More →
  • 安裝 TWCC CLI

pip3 install -U TWCC-CLI
  • 更新工具
pip3 install --upgrade setuptools
  • 輸入 twcccli 確認已安裝成功

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

Step 3. 登入

1. 取得專案代碼

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

2. 取得您的 API 金鑰

點擊平台右上角名稱 > API金鑰管理 > 複製金鑰

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

3. 設定登入檔案,登入完成

1. 輸入 twccli config init
2. Y
3. 輸入專案代碼
4. 輸入 API 金鑰

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

  • 登入成功
    • Ubuntu 24.04
      Image Not Showing Possible Reasons
      • The image was uploaded to a note which you don't have access to
      • The note which the image was originally uploaded to has been deleted
      Learn More →
    • Windows Server 2022
      Image Not Showing Possible Reasons
      • The image was uploaded to a note which you don't have access to
      • The note which the image was originally uploaded to has been deleted
      Learn More →

Step 4. 如何使用 TWCC CLI 管理資源

指令集請參考:https://twcc-cli.readthedocs.io/en/latest/twccli-ch.html

檢視當前使用專案、用戶資訊

twccli config whoami

更換專案、用戶身份

先移除以下資料夾,再重新執行 Step3. 登入

rm -rf ~/.twcc_data