linkgo について
linkgoは、HTTP APIを通じてLinkGo v3のナビゲーションページを管理するスキルです。サービスカードやページ設定に加え、アイコンと設定のインポート・エクスポートも扱います。
主な機能
- 01サービスカードの照会・追加・編集・削除
- 02ページ設定の更新
- 03アイコンのアップロードと一覧表示
- 04設定のエクスポートとインポート
- 05管理者パスワードとデバッグ情報の管理
活用シーン
- 01有効・無効なサービスカードの確認
- 02ナビゲーションページへの項目追加や更新
- 03移行や復元に備えた設定のバックアップ
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ wmy2981/ skills --skill linkgoインストール後、Claude Code で/linkgoを入力して読み込まれたか確認します。
同梱ファイル
SKILL.md と一緒にインストールされる参考資料やスクリプト。
.claude-plugin/plugin.jsonreferences/api_doc.mdscripts/.env.examplelinkgo.py詳細
LinkGo v3 リモート管理
HTTP API を介して、LinkGo v3 のナビゲーションページ上のサービスカード、ページ設定、アイコン、システム設定を管理します。
実行ルール
依存関係、環境変数、設定を事前に確認せず、ユーザーが要求したコマンドを直接実行します。問題がある場合は、スクリプトが明確なエラーを表示して失敗するため、その時点で確認して修正してください。
環境変数
| 変数 | 必須 | 用途 |
|---|---|---|
LINKGO_HOST | ✅ | インスタンスのアドレス。例:http://192.168.1.100:80 |
LINKGO_PASSWORD | ✅ | 管理者パスワード |
スクリプトはこれらの値を ~/.wmyskills/.env(スキル間で共有)から自動的に読み込みます。スクリプトのディレクトリに scripts/.env がある場合は、そちらが優先されます。テンプレートとして scripts/.env.example を使用してください。変数は ~/.wmyskills/.env に追加し、既存のファイルを上書きしないでください。
要件
外部依存関係はありません(標準ライブラリのみ)。
使用方法
スクリプト:scripts/linkgo.py
接続確認
python scripts/linkgo.py ping
カードの照会
# List enabled cards (default)
python scripts/linkgo.py list
# List all cards (including disabled)
python scripts/linkgo.py list --all
# Query a specific card by id
python scripts/linkgo.py list --id my-service
カードの管理
# Add a card (JSON string)
python scripts/linkgo.py add '{"id":"my-service","title":"My Service","href":"http://example.com","icon":"static/icon/link.svg","displayAddress":"example.com","description":"Service description","status":1}'
# Edit a card (merge fields by id)
python scripts/linkgo.py edit my-service '{"title":"New Title","href":"http://new.example.com"}'
# Delete a card
python scripts/linkgo.py delete my-service
# Enable / disable
python scripts/linkgo.py enable my-service
python scripts/linkgo.py disable my-service
ページ設定
python scripts/linkgo.py page '{"title":"New Title","searchEnabled":0}'
アイコン
# Upload one or more icons (multi-file supported)
python scripts/linkgo.py upload-icon /path/to/icon.svg /path/to/another.png
# List available icons
python scripts/linkgo.py icons
設定のエクスポート/インポート
# Export config to file
python scripts/linkgo.py export -o backup.json
# Export to stdout
python scripts/linkgo.py export
# Import config (overwrites all data)
python scripts/linkgo.py import backup.json
# Reset to default config
python scripts/linkgo.py reset
パスワードとデバッグ
# Change admin password
python scripts/linkgo.py change-password <old_password> <new_password>
# Reset password to a random 8-char one (server-local only, 127.0.0.1)
python scripts/linkgo.py reset-password
# Debug info
python scripts/linkgo.py debug
サービスカードのフィールド
| フィールド | 必須 | 型 | 説明 |
|---|---|---|---|
id | ✅ | string | 一意の識別子。英数字のみ。作成後は変更できません |
title | ✅ | string | 表示タイトル。変数置換に対応しています |
href | ✅ | string | クリック時のリンク先 URL。javascript: プロトコルに対応しています |
icon | ❌ | string | アイコンのパス(例:static/icon/home.svg)。アップロード後に使用できます |
displayAddress | ❌ | string | カードに表示されるアドレスのテキスト |
description | ❌ | string | 説明テキスト。変数置換と HTML に対応しています |
status | ❌ | int | 1=有効(デフォルト)、0=無効 |
パラメーター構文(description のみ)
| 構文 | 説明 | 例 |
|---|---|---|
{link:URL,text} | 通常のリンク | {link:https://example.com,Example} |
{sublink:URL,text} | 青色の太字リンク | {sublink:https://example.com,Details} |
{modallink:URL,title,text} | iframe モーダルリンク | {modallink:http://x:8080,Service,View} |
{tip:content} | 検索キーワードのヒント(非表示) | {tip:keyword1 keyword2} |
{page_info} | ページ情報のプレースホルダー(選択可能なテキスト) | {page_info} |
静的変数
| 変数 | 置換後の値 | 例 |
|---|---|---|
{project_name} | プロジェクト名 | LinkGo |
{project_version} | プロジェクトのバージョン | v3_20250823 |
{addr_prefit} | 地址: ラベル | {addr_prefit} → 地址: |
{space} | 半角スペース3つ | Line 1{space}Line 2 |
{icon_path} | アイコンディレクトリ | {icon_path}myicon.svg → /static/icon/myicon.svg |
{api_path} | API ディレクトリ | {api_path} → /api/ |
{static_path} | 静的ファイルのディレクトリ | {static_path} → /static/ |
{pages_path} | ページディレクトリ | {pages_path} → /pages/ |
動的変数(ページごとにフロントエンドが自動置換)
| 変数 | 説明 | 例 |
|---|---|---|
{host} | ホスト名+ポート | localhost:8080 |
{hostname} | ホスト名のみ | localhost |
{port} | ポート | 8080 |
{protocol} | プロトコル(http/https) | http |
{pathname} | 現在の URL パス | /index.html |
{href} | 完全な URL | http://localhost:8080/index.html |
%s | {host} の別名 | localhost:8080 |
重要な注意事項
- Edit は差分更新です — 変更したいフィールドのみを渡してください。それ以外はそのまま維持されます
- インポート/リセットの前にバックアップしてください — どちらの操作もすべてのデータを上書きし、取り消せません
- アイコンのアップロード上限:1ファイルあたり1MB。対応形式:SVG/PNG/JPG/JPEG/GIF/WEBP/ICO
resetを実行すると、すべてのカスタムカードが消去されますreset-passwordはサーバーホスト上でのみ動作します(API が受け付けるのは127.0.0.1のみです)。実行するにはLINKGO_HOSTをhttp://127.0.0.1に設定する必要があります- パスワードを変更すると、サーバーの
config.phpが自動更新されます change-password/reset-passwordの実行後は、~/.wmyskills/.env(存在する場合はscripts/.envも — こちらが優先されます)のLINKGO_PASSWORDを更新するようユーザーに案内してください。保存されているパスワードは無効になり、以降のコマンドは 401 エラーで失敗します
参照資料
LinkGo v3 API のリファレンス、変数置換システム、フロントエンドモジュール、デプロイ設定の全文については、references/api_doc.md を参照してください。
コメント
Markdown 対応