@scalebase/cli 0.0.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +101 -0
- package/README.md +63 -3
- package/THIRD-PARTY-NOTICES.txt +225 -0
- package/bin/scalebase-cli.js +80 -0
- package/package.json +36 -5
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
================================================================
|
|
2
|
+
Scalebase CLI ソフトウェア使用許諾契約(EULA)
|
|
3
|
+
================================================================
|
|
4
|
+
|
|
5
|
+
本ソフトウェア使用許諾契約(以下「本契約」)は、Scalebase株式会社(以下
|
|
6
|
+
「当社」)が提供するコマンドラインツール「Scalebase CLI」およびその関連
|
|
7
|
+
コンポーネント(以下「本ソフトウェア」)の使用条件を、本ソフトウェアを
|
|
8
|
+
利用する個人または法人(以下「利用者」)との間で定めるものです。
|
|
9
|
+
|
|
10
|
+
本ソフトウェアをインストール、複製、または使用することにより、利用者は
|
|
11
|
+
本契約のすべての条項に同意したものとみなされます。同意しない場合、本
|
|
12
|
+
ソフトウェアを使用することはできません。
|
|
13
|
+
|
|
14
|
+
----------------------------------------------------------------
|
|
15
|
+
第1条(定義)
|
|
16
|
+
----------------------------------------------------------------
|
|
17
|
+
1. 「Scalebase 契約」とは、利用者(またはその所属組織)と当社との間で
|
|
18
|
+
締結された、Scalebase サービスに関する利用契約をいう。
|
|
19
|
+
2. 「認可ユーザー」とは、有効な Scalebase 契約に基づき当社が発行した
|
|
20
|
+
API キーの正当な利用権限を有する者をいう。
|
|
21
|
+
|
|
22
|
+
----------------------------------------------------------------
|
|
23
|
+
第2条(使用許諾)
|
|
24
|
+
----------------------------------------------------------------
|
|
25
|
+
1. 当社は利用者に対し、本契約の条項に従うことを条件として、本ソフト
|
|
26
|
+
ウェアを Scalebase 契約の目的の範囲内で使用する、非独占的かつ譲渡
|
|
27
|
+
不能な権利を許諾する。
|
|
28
|
+
2. 本ソフトウェアの使用は、有効な Scalebase 契約を有する認可ユーザー
|
|
29
|
+
に限られる。本ソフトウェアは有効な API キーがなければ機能しない。
|
|
30
|
+
|
|
31
|
+
----------------------------------------------------------------
|
|
32
|
+
第3条(制限事項)
|
|
33
|
+
----------------------------------------------------------------
|
|
34
|
+
利用者は、本ソフトウェアについて次の行為を行ってはならない。
|
|
35
|
+
1. 第三者への再配布、再頒布、貸与、譲渡、またはサブライセンス。
|
|
36
|
+
2. 改変、翻案、二次的著作物の作成。
|
|
37
|
+
3. リバースエンジニアリング、逆コンパイル、逆アセンブル、その他
|
|
38
|
+
ソースコードまたは内部構造を解析・抽出する行為
|
|
39
|
+
(法令上明示的に許容される範囲を除く)。
|
|
40
|
+
4. 著作権表示その他の権利表示の削除・改変。
|
|
41
|
+
5. 本ソフトウェアを利用した、当社サービスと競合するツール・サービスの
|
|
42
|
+
開発。
|
|
43
|
+
|
|
44
|
+
----------------------------------------------------------------
|
|
45
|
+
第4条(知的財産権)
|
|
46
|
+
----------------------------------------------------------------
|
|
47
|
+
本ソフトウェアに関する著作権その他一切の知的財産権は、当社または当社に
|
|
48
|
+
使用を許諾する者に帰属する。本契約は、第2条に定める使用許諾を除き、
|
|
49
|
+
利用者に何らの権利も移転するものではない。
|
|
50
|
+
|
|
51
|
+
----------------------------------------------------------------
|
|
52
|
+
第5条(第三者ソフトウェア)
|
|
53
|
+
----------------------------------------------------------------
|
|
54
|
+
本ソフトウェアには、第三者が提供するオープンソースソフトウェアが含まれる
|
|
55
|
+
場合がある。当該第三者ソフトウェアの使用については、それぞれに付属する
|
|
56
|
+
ライセンス条件が適用され、本契約の規定に優先する。第三者ソフトウェアの
|
|
57
|
+
一覧および各ライセンスは、本ソフトウェアに同梱の THIRD-PARTY-NOTICES.txt
|
|
58
|
+
を参照すること。
|
|
59
|
+
|
|
60
|
+
----------------------------------------------------------------
|
|
61
|
+
第6条(無保証)
|
|
62
|
+
----------------------------------------------------------------
|
|
63
|
+
本ソフトウェアは現状有姿(AS IS)で提供される。当社は、本ソフトウェアの
|
|
64
|
+
正確性、完全性、特定目的への適合性、第三者の権利を侵害しないこと、および
|
|
65
|
+
エラーや中断がないことについて、明示・黙示を問わず一切保証しない。
|
|
66
|
+
|
|
67
|
+
----------------------------------------------------------------
|
|
68
|
+
第7条(責任の制限)
|
|
69
|
+
----------------------------------------------------------------
|
|
70
|
+
当社は、本ソフトウェアの使用または使用不能から生じる一切の損害
|
|
71
|
+
(逸失利益、データ喪失、事業中断等を含む)について、法令上許容される
|
|
72
|
+
最大限の範囲で責任を負わない。
|
|
73
|
+
|
|
74
|
+
----------------------------------------------------------------
|
|
75
|
+
第8条(契約期間および終了)
|
|
76
|
+
----------------------------------------------------------------
|
|
77
|
+
1. 本契約に基づく使用許諾は、利用者が本契約を遵守している間、有効に
|
|
78
|
+
存続する。
|
|
79
|
+
2. 次のいずれかに該当した場合、本ソフトウェアの使用許諾は当然に終了
|
|
80
|
+
する。
|
|
81
|
+
(1) 利用者に係る Scalebase 契約が終了したとき。
|
|
82
|
+
(2) 利用者が本契約のいずれかの条項に違反したとき。
|
|
83
|
+
3. 使用許諾の終了後、利用者は速やかに本ソフトウェアの使用を停止し、
|
|
84
|
+
保有する複製物を削除・破棄しなければならない。
|
|
85
|
+
|
|
86
|
+
----------------------------------------------------------------
|
|
87
|
+
第9条(準拠法および管轄)
|
|
88
|
+
----------------------------------------------------------------
|
|
89
|
+
1. 本契約は日本法に準拠し、日本法に従って解釈される。
|
|
90
|
+
2. 本契約に関して生じる一切の紛争については、東京地方裁判所を
|
|
91
|
+
第一審の専属的合意管轄裁判所とする。
|
|
92
|
+
|
|
93
|
+
----------------------------------------------------------------
|
|
94
|
+
第10条(既存契約との関係)
|
|
95
|
+
----------------------------------------------------------------
|
|
96
|
+
本契約と既存の Scalebase 利用規約その他の個別契約との間に齟齬がある
|
|
97
|
+
場合、当該 Scalebase 利用規約その他の個別契約が本契約に優先する。
|
|
98
|
+
|
|
99
|
+
以上
|
|
100
|
+
|
|
101
|
+
Copyright (c) 2026 Scalebase株式会社. All rights reserved.
|
package/README.md
CHANGED
|
@@ -1,5 +1,65 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Scalebase CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Scalebase CLI は **Scalebase 契約者向け**のツールです。利用には Scalebase ダッシュボードで発行する **API キー**が必要です。契約・API キーに関するお問い合わせは、担当者または既存のサポート窓口までご連絡ください。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Scalebase API を操作するコマンドラインツール兼 MCP サーバーです。請求 (billing) / 顧客 (customer) / 契約 (contract) / 改定 (amendment) / 使用量 (usage) などのデータ取得・作成・更新を行えます。
|
|
6
|
+
|
|
7
|
+
## インストール
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g @scalebase/cli
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
お使いの OS / CPU に対応するネイティブバイナリ(`optionalDependencies`)が自動的に選択されます。対応プラットフォーム:
|
|
14
|
+
|
|
15
|
+
| OS | アーキテクチャ |
|
|
16
|
+
| ------- | -------------- |
|
|
17
|
+
| macOS | arm64 / amd64 |
|
|
18
|
+
| Linux | amd64 / arm64 |
|
|
19
|
+
| Windows | amd64 |
|
|
20
|
+
|
|
21
|
+
Node.js は **18 以上**が必要です。
|
|
22
|
+
|
|
23
|
+
## 使い方
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# バージョン確認
|
|
27
|
+
scalebase-cli --version
|
|
28
|
+
|
|
29
|
+
# API キーを設定して実行
|
|
30
|
+
export SCALEBASE_API_KEY=xxxxxxxx
|
|
31
|
+
scalebase-cli customer list
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## MCP サーバーとして使う
|
|
35
|
+
|
|
36
|
+
`npx` 1 行で MCP サーバーを起動できます。stdio トランスポートを使うため、stdout には MCP プロトコル以外の出力を一切行いません(ログはすべて stderr)。
|
|
37
|
+
|
|
38
|
+
Claude Code / Claude Desktop などの `.mcp.json`(MCP 設定)例:
|
|
39
|
+
|
|
40
|
+
```json
|
|
41
|
+
{
|
|
42
|
+
"mcpServers": {
|
|
43
|
+
"scalebase": {
|
|
44
|
+
"command": "npx",
|
|
45
|
+
"args": ["-y", "@scalebase/cli", "mcp", "serve"],
|
|
46
|
+
"env": {
|
|
47
|
+
"SCALEBASE_API_KEY": "xxxxxxxx",
|
|
48
|
+
"SCALEBASE_ENV": "sandbox"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
MCP は既定で `--readonly=true`(read 系ツールのみ)・`--env=sandbox` です。write 系を使う場合は `SCALEBASE_MCP_READONLY=false`、production を使う場合は `SCALEBASE_ENV=production` を明示してください。
|
|
56
|
+
|
|
57
|
+
## 対応していないプラットフォーム
|
|
58
|
+
|
|
59
|
+
対応外の OS / CPU では、起動時に明確なエラーメッセージを表示して終了します。また optional dependency のインストールに失敗した場合(`--no-optional` / `--omit=optional` を付けた等)も、再インストール方法を案内して終了します。
|
|
60
|
+
|
|
61
|
+
## ライセンス
|
|
62
|
+
|
|
63
|
+
本ソフトウェアの使用には使用許諾契約 (EULA) への同意が必要です。同梱の [`LICENSE.txt`](./LICENSE.txt) を参照してください。
|
|
64
|
+
|
|
65
|
+
(c) Scalebase株式会社
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
================================================================
|
|
2
|
+
THIRD-PARTY SOFTWARE NOTICES
|
|
3
|
+
Scalebase CLI
|
|
4
|
+
================================================================
|
|
5
|
+
|
|
6
|
+
本ファイルは Scalebase CLI のバイナリに同梱される第三者オープンソース
|
|
7
|
+
ソフトウェア(OSS)の一覧です。EULA(LICENSE.txt)第5条に基づき、各 OSS の
|
|
8
|
+
利用は下記に示す各ライセンス条件に従います。
|
|
9
|
+
|
|
10
|
+
各 OSS のライセンス本文(全文)は、それぞれのモジュールのリポジトリ
|
|
11
|
+
(下記 URL)を参照してください。
|
|
12
|
+
|
|
13
|
+
----------------------------------------------------------------
|
|
14
|
+
生成方法
|
|
15
|
+
----------------------------------------------------------------
|
|
16
|
+
本一覧は go-licenses が現行の Go ツールチェーン(go1.25.12)で動作しな
|
|
17
|
+
かったため(標準ライブラリのパッケージが module info を持たず report が
|
|
18
|
+
中断する)、以下のフォールバック手順で生成しています。
|
|
19
|
+
|
|
20
|
+
# バイナリに実際にリンクされる依存モジュールを列挙
|
|
21
|
+
go list -deps -f '{{if .Module}}{{.Module.Path}} {{.Module.Version}}{{end}}' \
|
|
22
|
+
./cmd/scalebase-cli | sort -u
|
|
23
|
+
# 各モジュールの module cache 内 LICENSE ファイルを読み、種別を判定
|
|
24
|
+
|
|
25
|
+
ライセンス種別は各モジュール同梱の LICENSE ファイルから判定した推定値
|
|
26
|
+
です。正式なライセンス本文は各リポジトリを参照してください。
|
|
27
|
+
|
|
28
|
+
収録モジュール数: 32
|
|
29
|
+
内訳: Apache-2.0: 4, BSD-3-Clause: 6, MIT: 22
|
|
30
|
+
Go バージョン: go1.25.12
|
|
31
|
+
|
|
32
|
+
================================================================
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
Module : github.com/cespare/xxhash/v2
|
|
36
|
+
Version: v2.3.0
|
|
37
|
+
License: MIT
|
|
38
|
+
Source : https://github.com/cespare/xxhash/v2
|
|
39
|
+
----------------------------------------------------------------
|
|
40
|
+
|
|
41
|
+
Module : github.com/clipperhouse/displaywidth
|
|
42
|
+
Version: v0.10.0
|
|
43
|
+
License: MIT
|
|
44
|
+
Source : https://github.com/clipperhouse/displaywidth
|
|
45
|
+
----------------------------------------------------------------
|
|
46
|
+
|
|
47
|
+
Module : github.com/clipperhouse/uax29/v2
|
|
48
|
+
Version: v2.6.0
|
|
49
|
+
License: MIT
|
|
50
|
+
Source : https://github.com/clipperhouse/uax29/v2
|
|
51
|
+
----------------------------------------------------------------
|
|
52
|
+
|
|
53
|
+
Module : github.com/fatih/color
|
|
54
|
+
Version: v1.18.0
|
|
55
|
+
License: MIT
|
|
56
|
+
Source : https://github.com/fatih/color
|
|
57
|
+
----------------------------------------------------------------
|
|
58
|
+
|
|
59
|
+
Module : github.com/fsnotify/fsnotify
|
|
60
|
+
Version: v1.9.0
|
|
61
|
+
License: BSD-3-Clause
|
|
62
|
+
Source : https://github.com/fsnotify/fsnotify
|
|
63
|
+
----------------------------------------------------------------
|
|
64
|
+
|
|
65
|
+
Module : github.com/go-viper/mapstructure/v2
|
|
66
|
+
Version: v2.4.0
|
|
67
|
+
License: MIT
|
|
68
|
+
Source : https://github.com/go-viper/mapstructure/v2
|
|
69
|
+
----------------------------------------------------------------
|
|
70
|
+
|
|
71
|
+
Module : github.com/google/jsonschema-go
|
|
72
|
+
Version: v0.4.3
|
|
73
|
+
License: MIT
|
|
74
|
+
Source : https://github.com/google/jsonschema-go
|
|
75
|
+
----------------------------------------------------------------
|
|
76
|
+
|
|
77
|
+
Module : github.com/mattn/go-colorable
|
|
78
|
+
Version: v0.1.14
|
|
79
|
+
License: MIT
|
|
80
|
+
Source : https://github.com/mattn/go-colorable
|
|
81
|
+
----------------------------------------------------------------
|
|
82
|
+
|
|
83
|
+
Module : github.com/mattn/go-isatty
|
|
84
|
+
Version: v0.0.20
|
|
85
|
+
License: MIT
|
|
86
|
+
Source : https://github.com/mattn/go-isatty
|
|
87
|
+
----------------------------------------------------------------
|
|
88
|
+
|
|
89
|
+
Module : github.com/mattn/go-runewidth
|
|
90
|
+
Version: v0.0.19
|
|
91
|
+
License: MIT
|
|
92
|
+
Source : https://github.com/mattn/go-runewidth
|
|
93
|
+
----------------------------------------------------------------
|
|
94
|
+
|
|
95
|
+
Module : github.com/modelcontextprotocol/go-sdk
|
|
96
|
+
Version: v1.6.1
|
|
97
|
+
License: Apache-2.0
|
|
98
|
+
Source : https://github.com/modelcontextprotocol/go-sdk
|
|
99
|
+
----------------------------------------------------------------
|
|
100
|
+
|
|
101
|
+
Module : github.com/olekukonko/cat
|
|
102
|
+
Version: v0.0.0-20250911104152-50322a0618f6
|
|
103
|
+
License: MIT
|
|
104
|
+
Source : https://github.com/olekukonko/cat
|
|
105
|
+
----------------------------------------------------------------
|
|
106
|
+
|
|
107
|
+
Module : github.com/olekukonko/errors
|
|
108
|
+
Version: v1.2.0
|
|
109
|
+
License: MIT
|
|
110
|
+
Source : https://github.com/olekukonko/errors
|
|
111
|
+
----------------------------------------------------------------
|
|
112
|
+
|
|
113
|
+
Module : github.com/olekukonko/ll
|
|
114
|
+
Version: v0.1.6
|
|
115
|
+
License: MIT
|
|
116
|
+
Source : https://github.com/olekukonko/ll
|
|
117
|
+
----------------------------------------------------------------
|
|
118
|
+
|
|
119
|
+
Module : github.com/olekukonko/tablewriter
|
|
120
|
+
Version: v1.1.4
|
|
121
|
+
License: MIT
|
|
122
|
+
Source : https://github.com/olekukonko/tablewriter
|
|
123
|
+
----------------------------------------------------------------
|
|
124
|
+
|
|
125
|
+
Module : github.com/pelletier/go-toml/v2
|
|
126
|
+
Version: v2.2.4
|
|
127
|
+
License: MIT
|
|
128
|
+
Source : https://github.com/pelletier/go-toml/v2
|
|
129
|
+
----------------------------------------------------------------
|
|
130
|
+
|
|
131
|
+
Module : github.com/sagikazarmark/locafero
|
|
132
|
+
Version: v0.11.0
|
|
133
|
+
License: MIT
|
|
134
|
+
Source : https://github.com/sagikazarmark/locafero
|
|
135
|
+
----------------------------------------------------------------
|
|
136
|
+
|
|
137
|
+
Module : github.com/segmentio/asm
|
|
138
|
+
Version: v1.1.3
|
|
139
|
+
License: MIT
|
|
140
|
+
Source : https://github.com/segmentio/asm
|
|
141
|
+
----------------------------------------------------------------
|
|
142
|
+
|
|
143
|
+
Module : github.com/segmentio/encoding
|
|
144
|
+
Version: v0.5.4
|
|
145
|
+
License: MIT
|
|
146
|
+
Source : https://github.com/segmentio/encoding
|
|
147
|
+
----------------------------------------------------------------
|
|
148
|
+
|
|
149
|
+
Module : github.com/sourcegraph/conc
|
|
150
|
+
Version: v0.3.1-0.20240121214520-5f936abd7ae8
|
|
151
|
+
License: MIT
|
|
152
|
+
Source : https://github.com/sourcegraph/conc
|
|
153
|
+
----------------------------------------------------------------
|
|
154
|
+
|
|
155
|
+
Module : github.com/spf13/afero
|
|
156
|
+
Version: v1.15.0
|
|
157
|
+
License: Apache-2.0
|
|
158
|
+
Source : https://github.com/spf13/afero
|
|
159
|
+
----------------------------------------------------------------
|
|
160
|
+
|
|
161
|
+
Module : github.com/spf13/cast
|
|
162
|
+
Version: v1.10.0
|
|
163
|
+
License: MIT
|
|
164
|
+
Source : https://github.com/spf13/cast
|
|
165
|
+
----------------------------------------------------------------
|
|
166
|
+
|
|
167
|
+
Module : github.com/spf13/cobra
|
|
168
|
+
Version: v1.10.2
|
|
169
|
+
License: Apache-2.0
|
|
170
|
+
Source : https://github.com/spf13/cobra
|
|
171
|
+
----------------------------------------------------------------
|
|
172
|
+
|
|
173
|
+
Module : github.com/spf13/pflag
|
|
174
|
+
Version: v1.0.10
|
|
175
|
+
License: BSD-3-Clause
|
|
176
|
+
Source : https://github.com/spf13/pflag
|
|
177
|
+
----------------------------------------------------------------
|
|
178
|
+
|
|
179
|
+
Module : github.com/spf13/viper
|
|
180
|
+
Version: v1.21.0
|
|
181
|
+
License: MIT
|
|
182
|
+
Source : https://github.com/spf13/viper
|
|
183
|
+
----------------------------------------------------------------
|
|
184
|
+
|
|
185
|
+
Module : github.com/subosito/gotenv
|
|
186
|
+
Version: v1.6.0
|
|
187
|
+
License: MIT
|
|
188
|
+
Source : https://github.com/subosito/gotenv
|
|
189
|
+
----------------------------------------------------------------
|
|
190
|
+
|
|
191
|
+
Module : github.com/yosida95/uritemplate/v3
|
|
192
|
+
Version: v3.0.2
|
|
193
|
+
License: BSD-3-Clause
|
|
194
|
+
Source : https://github.com/yosida95/uritemplate/v3
|
|
195
|
+
----------------------------------------------------------------
|
|
196
|
+
|
|
197
|
+
Module : github.com/zalando/go-keyring
|
|
198
|
+
Version: v0.2.8
|
|
199
|
+
License: MIT
|
|
200
|
+
Source : https://github.com/zalando/go-keyring
|
|
201
|
+
----------------------------------------------------------------
|
|
202
|
+
|
|
203
|
+
Module : go.yaml.in/yaml/v3
|
|
204
|
+
Version: v3.0.4
|
|
205
|
+
License: Apache-2.0
|
|
206
|
+
Source : https://github.com/yaml/go-yaml
|
|
207
|
+
----------------------------------------------------------------
|
|
208
|
+
|
|
209
|
+
Module : golang.org/x/oauth2
|
|
210
|
+
Version: v0.35.0
|
|
211
|
+
License: BSD-3-Clause
|
|
212
|
+
Source : https://cs.opensource.google/go/x/oauth2
|
|
213
|
+
----------------------------------------------------------------
|
|
214
|
+
|
|
215
|
+
Module : golang.org/x/sys
|
|
216
|
+
Version: v0.41.0
|
|
217
|
+
License: BSD-3-Clause
|
|
218
|
+
Source : https://cs.opensource.google/go/x/sys
|
|
219
|
+
----------------------------------------------------------------
|
|
220
|
+
|
|
221
|
+
Module : golang.org/x/text
|
|
222
|
+
Version: v0.28.0
|
|
223
|
+
License: BSD-3-Clause
|
|
224
|
+
Source : https://cs.opensource.google/go/x/text
|
|
225
|
+
----------------------------------------------------------------
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
// Thin, dependency-free launcher for the Scalebase CLI.
|
|
5
|
+
//
|
|
6
|
+
// The real program is a native Go binary shipped in a platform-specific
|
|
7
|
+
// optionalDependency (e.g. @scalebase/cli-darwin-arm64). npm installs only the
|
|
8
|
+
// package matching the host's `os`/`cpu`, so at runtime exactly one of them is
|
|
9
|
+
// present. This launcher resolves that binary and execs it, forwarding argv and
|
|
10
|
+
// inheriting stdio verbatim — nothing is written to stdout here, so the MCP
|
|
11
|
+
// stdio transport (`scalebase-cli mcp serve`) is never corrupted.
|
|
12
|
+
//
|
|
13
|
+
// NOTE: `@scalebase` is a build-time placeholder. packaging/npm/build.sh renders
|
|
14
|
+
// this file the same way it renders the package.json templates, substituting
|
|
15
|
+
// the chosen npm scope (default @scalebase; see issue #130). Do not hardcode a
|
|
16
|
+
// literal scope here — keep the single source of truth in build.sh's --scope.
|
|
17
|
+
|
|
18
|
+
const path = require('path');
|
|
19
|
+
const fs = require('fs');
|
|
20
|
+
const { spawnSync } = require('child_process');
|
|
21
|
+
|
|
22
|
+
// Maps `${process.platform}-${process.arch}` to the platform package name.
|
|
23
|
+
// Package names use Node's `process.arch` values (`x64`, `arm64`), so the key
|
|
24
|
+
// suffix and the package-name suffix match one-to-one.
|
|
25
|
+
const PACKAGES = {
|
|
26
|
+
'darwin-arm64': '@scalebase/cli-darwin-arm64',
|
|
27
|
+
'darwin-x64': '@scalebase/cli-darwin-x64',
|
|
28
|
+
'linux-x64': '@scalebase/cli-linux-x64',
|
|
29
|
+
'linux-arm64': '@scalebase/cli-linux-arm64',
|
|
30
|
+
'win32-x64': '@scalebase/cli-win32-x64',
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
function fail(lines) {
|
|
34
|
+
for (const line of lines) {
|
|
35
|
+
console.error(line);
|
|
36
|
+
}
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const key = `${process.platform}-${process.arch}`;
|
|
41
|
+
const pkg = PACKAGES[key];
|
|
42
|
+
if (!pkg) {
|
|
43
|
+
fail([
|
|
44
|
+
`scalebase-cli: unsupported platform/arch: ${process.platform}/${process.arch}`,
|
|
45
|
+
`Supported platforms: ${Object.keys(PACKAGES).join(', ')}`,
|
|
46
|
+
'Scalebase CLI をご利用の環境に対応するバイナリが提供されていません。',
|
|
47
|
+
]);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const binaryName = process.platform === 'win32' ? 'scalebase-cli.exe' : 'scalebase-cli';
|
|
51
|
+
|
|
52
|
+
let pkgDir;
|
|
53
|
+
try {
|
|
54
|
+
// Resolving package.json always works when the package is installed, and is
|
|
55
|
+
// unaffected by any `exports` map (a raw binary path can be blocked by one).
|
|
56
|
+
pkgDir = path.dirname(require.resolve(`${pkg}/package.json`));
|
|
57
|
+
} catch (_e) {
|
|
58
|
+
fail([
|
|
59
|
+
`scalebase-cli: platform package "${pkg}" is not installed.`,
|
|
60
|
+
'これは通常、お使いのプラットフォーム向け optionalDependency の',
|
|
61
|
+
'インストールに失敗したことを意味します。optional dependencies を',
|
|
62
|
+
'有効にして再インストールしてください:',
|
|
63
|
+
' npm install -g @scalebase/cli # --no-optional / --omit=optional を付けない',
|
|
64
|
+
]);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const binaryPath = path.join(pkgDir, binaryName);
|
|
68
|
+
if (!fs.existsSync(binaryPath)) {
|
|
69
|
+
fail([
|
|
70
|
+
`scalebase-cli: binary not found at ${binaryPath}`,
|
|
71
|
+
`platform package "${pkg}" のインストールが壊れている可能性があります。再インストールしてください。`,
|
|
72
|
+
]);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const result = spawnSync(binaryPath, process.argv.slice(2), { stdio: 'inherit' });
|
|
76
|
+
if (result.error) {
|
|
77
|
+
fail([`scalebase-cli: failed to launch binary: ${result.error.message}`]);
|
|
78
|
+
}
|
|
79
|
+
// status is null exactly when the child was killed by a signal; exit non-zero.
|
|
80
|
+
process.exit(result.status === null ? 1 : result.status);
|
package/package.json
CHANGED
|
@@ -1,8 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scalebase/cli",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "Scalebase CLI —
|
|
5
|
-
"license": "
|
|
6
|
-
"
|
|
7
|
-
"
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Scalebase CLI — Scalebase 契約者向けの CLI / MCP サーバー。利用には Scalebase ダッシュボードで発行する API キーが必要です。",
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
|
+
"homepage": "https://thealp.co.jp",
|
|
7
|
+
"author": {
|
|
8
|
+
"name": "Scalebase株式会社",
|
|
9
|
+
"url": "https://thealp.co.jp"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"scalebase",
|
|
13
|
+
"cli",
|
|
14
|
+
"mcp",
|
|
15
|
+
"billing"
|
|
16
|
+
],
|
|
17
|
+
"bin": {
|
|
18
|
+
"scalebase-cli": "bin/scalebase-cli.js"
|
|
19
|
+
},
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=18"
|
|
22
|
+
},
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
26
|
+
"optionalDependencies": {
|
|
27
|
+
"@scalebase/cli-darwin-arm64": "1.0.0",
|
|
28
|
+
"@scalebase/cli-darwin-x64": "1.0.0",
|
|
29
|
+
"@scalebase/cli-linux-x64": "1.0.0",
|
|
30
|
+
"@scalebase/cli-linux-arm64": "1.0.0",
|
|
31
|
+
"@scalebase/cli-win32-x64": "1.0.0"
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"bin/scalebase-cli.js",
|
|
35
|
+
"LICENSE.txt",
|
|
36
|
+
"THIRD-PARTY-NOTICES.txt",
|
|
37
|
+
"README.md"
|
|
38
|
+
]
|
|
8
39
|
}
|