clever-tools について
Clever Tools は、Clever Cloud のアプリケーションやサービスを管理する公式コマンドラインスキルです。デプロイ、設定、アドオン、スケーリング、ログ、SSH アクセスを扱います。
主な機能
- 01アプリケーションのデプロイ
- 02アドオンとサービスの管理
- 03環境変数とドメインの設定
- 04ログの確認とアプリケーションのスケーリング
- 05SSH によるインスタンスへのアクセス
活用シーン
- 01Clever Cloud へのコードのデプロイ
- 02アプリケーションのドメインと環境変数の設定
- 03ログの確認やインスタンス規模の調整
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ clevercloud/ clever-tools --skill clever-toolsインストール後、Claude Code で/clever-toolsを入力して読み込まれたか確認します。
同梱ファイルreferences/full-documentation.md
詳細
Clever Tools
Clever Tools は、Platform-as-a-Service(PaaS)プロバイダーである Clever Cloud の公式 CLI です。アプリケーションのデプロイ、アドオン(データベース、ストレージなど)の管理、環境変数やドメインの設定、サービスの監視ができます。
ユーザーが Clever Cloud にコードをデプロイしたい場合、ホストされているアプリケーションを管理したい場合、または Clever Cloud のサービスを利用したい場合に、このスキルを使用してください。
クイックスタート
# Login to Clever Cloud (opens browser for OAuth)
clever login
# For CI/CD, use token-based authentication
export CLEVER_TOKEN="your-token"
export CLEVER_SECRET="your-secret"
# Link an existing application to current directory
clever link <app-id>
# Or create a new application
clever create --type node myapp
# Deploy current directory
clever deploy
主要なコマンド
デプロイ
# Deploy current directory (git push to Clever Cloud)
clever deploy
# Deploy with specific commit or branch
clever deploy --branch main
clever deploy --commit HEAD~2
# Restart application
clever restart
# Stop application (scales to 0)
clever stop
# Check deployment status
clever status
# View deployment history
clever activity
clever activity --follow # Live updates
ログ
# Stream live logs
clever logs
# View logs from last hour
clever logs --since 1h
# View logs before a specific time
clever logs --before 2024-01-15T10:00:00
# Filter by deployment
clever logs --deployment-id <id>
# Access logs (HTTP requests)
clever accesslogs
clever accesslogs --since 1h
環境変数
# List all environment variables
clever env
# Set a variable
clever env set MY_VAR "my value"
# Set multiple variables
clever env set VAR1=value1 VAR2=value2
# Remove a variable
clever env rm MY_VAR
# Import from .env file
clever env import .env
# Export for shell
clever env --format shell > .env
ドメイン
# List domains
clever domain
# Add a custom domain
clever domain add myapp.example.com
# Remove a domain
clever domain rm myapp.example.com
# Favorite domain (used in logs, URLs)
clever domain favorite set myapp.example.com
アドオン(データベース、ストレージなど)
# List your add-ons
clever addon
# List available add-on providers
clever addon providers
# Create a PostgreSQL database
clever addon create postgresql-addon mydb --plan dev
# Create Redis
clever addon create redis-addon myredis --plan s_mono
# Create S3-compatible storage (Cellar)
clever addon create cellar-addon mybucket
# Delete an add-on
clever addon delete <addon-id>
# Get add-on environment variables
clever addon env <addon-id>
サービス(Keycloak、Matomo などのマネージドサービス)
# Link add-on to application
clever service link-addon <addon-id>
# Unlink add-on
clever service unlink-addon <addon-id>
スケーリング
# View current scaling
clever scale
# Set instance size (flavor)
clever scale --flavor M
# Set number of instances
clever scale --instances 2
# Autoscaling
clever scale --min-instances 1 --max-instances 4
SSH アクセス
# SSH into running instance
clever ssh
# Run a command
clever ssh --command "ls -la"
アプリケーション管理
# List all applications in organization
clever applications list
# List linked applications in current directory
clever applications
# Create new application
clever create --type <type> <name>
# Types: node, python, ruby, php, java, go, rust, docker, static...
# Delete application
clever delete
よく使うグローバルオプション
ほとんどのコマンドで、次のオプションを使用できます。
--app <app-id|name> # Target specific app (when multiple linked)
--alias <alias> # Use app alias (from clever link --alias)
--org <org-id|name> # Target specific organization
-F, --format <format> # Output format: human, json, json-stream, shell
-y, --yes # Skip confirmation prompts
JSON 出力はスクリプトでの利用に便利です。
clever env --format json | jq '.MY_VAR'
clever applications list --format json
完全なリファレンス
すべてのコマンド、オプション、利用可能なランタイム、アドオンプロバイダー、デプロイゾーンについて詳しくは、references/full-documentation.md をご覧ください。
コメント
Markdown 対応