メインコンテンツまでスキップ

インストール

要件

  • Node.js 18.0 以上
  • npm 8.0 以上(Node.js に付属)
  • Git(バージョン管理機能用)

npm でインストール

npm install -g archicore

インストールの確認

archicore --version
# ArchiCore v0.1.0

認証

ArchiCore を使用する前に、認証が必要です:

archicore login

これにより:

  1. ArchiCore のログインページがブラウザで開きます
  2. ログイン後、CLI が自動的に設定されます
  3. 資格情報が安全に保存されます

デバイスコードフロー(ヘッドレス)

ブラウザのないサーバーの場合:

archicore login --device-code

ArchiCore Device Auth で入力するコードが表示されます。

プロジェクトの初期化

プロジェクトディレクトリに移動して実行:

cd /プロジェクト/パス
archicore init

これによりデフォルト設定の .archicore/ ディレクトリが作成されます。

更新

npm update -g archicore

アンインストール

npm uninstall -g archicore

設定も削除する場合:

rm -rf ~/.archicore

プラットフォーム別の注意事項

Windows

PowerShell または Git Bash を使用してください。コマンドプロンプトは動作しますが機能が制限されます。

# PowerShell
npm install -g archicore

Linux

グローバルインストールには sudo が必要な場合があります:

sudo npm install -g archicore

または npm をローカルディレクトリを使用するよう設定:

mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
npm install -g archicore

macOS

npm install -g archicore

権限エラーが発生した場合:

sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
npm install -g archicore

トラブルシューティング

"EACCES: 権限が拒否されました"

sudo npm install は使用しないでください。代わりに npm の権限を修正:

mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
export PATH=~/.npm-global/bin:$PATH

"archicore: コマンドが見つかりません"

npm のグローバル bin が PATH にあることを確認:

export PATH="$(npm bin -g):$PATH"

永続化するには ~/.bashrc または ~/.zshrc に追加してください。

プロキシ環境

npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080
npm install -g archicore