API リファレンス
S-IDEのREST APIエンドポイント
API リファレンス
S-IDEはRESTful APIを提供しており、バックエンドサーバーと通信します。
ベースURL
デフォルト: http://localhost:8787
ワークスペース
ワークスペース一覧取得
GET /api/workspaces
ワークスペース作成
POST /api/workspaces
Content-Type: application/json
{
"path": "/path/to/workspace"
}
デフォルトルート設定取得
GET /api/config
デッキ
デッキ一覧取得
GET /api/decks
デッキ作成
POST /api/decks
Content-Type: application/json
{
"name": "My Deck",
"root": "/path/to/root"
}
ファイル操作
ディレクトリ内容取得
GET /api/files?path=/path/to/dir
ファイル読み取り
GET /api/file?path=/path/to/file
ファイル書き込み
PUT /api/file?path=/path/to/file
Content-Type: text/plain
file content here
ファイル作成
POST /api/file?path=/path/to/file
Content-Type: text/plain
file content here
ファイル削除
DELETE /api/file?path=/path/to/file
ディレクトリ作成
POST /api/dir?path=/path/to/dir
ターミナル
ターミナル一覧取得
GET /api/terminals?deckId=deck-uuid
ターミナル作成
POST /api/terminals
Content-Type: application/json
{
"deckId": "deck-uuid",
"cwd": "/working/directory"
}
ターミナル削除
DELETE /api/terminals/:id
ターミナルWebSocket (xterm.js)
WS /api/terminals/:id
Git
ステータス取得
GET /api/git/status?path=/path/to/repo
全リポジトリ取得
GET /api/git/repos?path=/workspace/path
複数リポジトリのステータス
GET /api/git/multi-status?path=/workspace/path
ファイルをステージ
POST /api/git/stage
Content-Type: application/json
{
"path": "/repo/path",
"files": ["file1.ts", "file2.ts"]
}
アンステージ
POST /api/git/unstage
Content-Type: application/json
{
"path": "/repo/path",
"files": ["file1.ts"]
}
コミット
POST /api/git/commit
Content-Type: application/json
{
"path": "/repo/path",
"message": "Commit message"
}
プッシュ
POST /api/git/push
Content-Type: application/json
{
"path": "/repo/path"
}
プル
POST /api/git/pull
Content-Type: application/json
{
"path": "/repo/path"
}
ブランチ一覧
GET /api/git/branches?path=/repo/path
ブランチ切り替え
POST /api/git/checkout
Content-Type: application/json
{
"path": "/repo/path",
"branch": "feature-branch"
}
ブランチ作成
POST /api/git/create-branch
Content-Type: application/json
{
"path": "/repo/path",
"branch": "new-branch"
}
Context Manager
ヘルスステータス取得
GET /api/context-manager/status
セッション作成
POST /api/context-manager/session
現在のセッション取得
GET /api/context-manager/session
セッション終了
DELETE /api/context-manager/session
コンテキスト圧縮
POST /api/context-manager/compact
Content-Type: application/json
{
"keepLast": 50
}
スナップショット作成
POST /api/context-manager/snapshot
スナップショット一覧
GET /api/context-manager/snapshots
最新スナップショット取得
GET /api/context-manager/snapshots/latest
最も健康なスナップショット取得
GET /api/context-manager/snapshots/healthiest
スナップショット復元
POST /api/context-manager/snapshots/:commitHash/restore
環境変数
| 変数 | 説明 | デフォルト | 必須 |
|---|---|---|---|
DEFAULT_ROOT | デフォルトワークスペースパス | os.homedir() | いいえ |
PORT | サーバーポート | 8787 | いいえ |
HOST | サーバーホスト | 0.0.0.0 | いいえ |
BASIC_AUTH_USER | Basic認証ユーザー名 | - | 本番 |
BASIC_AUTH_PASSWORD | Basic認証パスワード | - | 本番 |
CORS_ORIGIN | CORSオリジン | - | 本番 |