
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
dcloud-cli
Advanced tools
A command-line interface for managing DrupalCloud spaces, monitoring usage, and interacting with the DrupalCloud API using personal access tokens.
npm install -g dcloud-cli
Before using the CLI, you need to authenticate with your DrupalCloud personal access token:
dcloud auth login
This will:
Alternatively, you can use manual token entry:
dcloud auth login --manual
This will prompt you for:
https://app.drupalcloud.com
or http://localhost:3333
)dc_tok_...
)The CLI will verify the token and store the credentials securely in your system keychain or config directory.
# View current authentication status
dcloud auth status
# Switch to a different token/instance
dcloud auth login --url https://staging.drupalcloud.com
# Logout (remove stored credentials)
dcloud auth logout
# Test authentication
dcloud auth test
Note: Token creation and management must be done through the web interface at /organization/tokens
for security reasons.
The CLI stores configuration in ~/.dcloud/config.json
:
{
"currentProfile": "default",
"profiles": {
"default": {
"baseUrl": "https://app.drupalcloud.com",
"tokenHash": "sha256_hash_of_token"
},
"staging": {
"baseUrl": "https://staging.drupalcloud.com",
"tokenHash": "sha256_hash_of_token"
}
}
}
Actual tokens are stored securely using the system keychain (macOS Keychain, Windows Credential Manager, or Linux Secret Service).
# List all spaces
dcloud spaces list
# List with additional details
dcloud spaces list --detailed
# Filter by status
dcloud spaces list --status active
dcloud spaces list --status creating
dcloud spaces list --archived
# Output as JSON
dcloud spaces list --json
# Get space by ID
dcloud spaces get 123
# Get space by name
dcloud spaces get my-space-name
# Output as JSON
dcloud spaces get 123 --json
# Create a new space
dcloud spaces create "My New Space" --type pro --template dcloud
# Available templates: drupal, drupalx, next-drupal, drupalx-decoupled, dcloud
# Available types: starter, pro, premium
# With all options
dcloud spaces create "E-commerce Site" \
--type premium \
--template drupalx-decoupled \
--description "New e-commerce platform"
# Update space name
dcloud spaces update 123 --name "Updated Space Name"
# Update space type
dcloud spaces update 123 --type premium
# Clone a space
dcloud spaces clone 123 --name "Cloned Space"
# Clone with different type
dcloud spaces clone 123 --name "Development Copy" --type starter
# Archive a space
dcloud spaces archive 123
# Unarchive a space
dcloud spaces unarchive 123
# Delete a space (with confirmation)
dcloud spaces delete 123
# Force delete without confirmation
dcloud spaces delete 123 --force
# Get Drupal one-time login link
dcloud spaces login 123
# Check if space is ready
dcloud spaces status 123
# Retry space creation (if failed)
dcloud spaces retry 123
# Refresh space usage data
dcloud spaces refresh-usage 123
# Get overall organization usage
dcloud usage
# Get usage with space breakdown
dcloud usage --breakdown
# Output as JSON
dcloud usage --json
# Get usage for specific date range
dcloud usage --from 2025-01-01 --to 2025-01-31
# Get usage for a specific space
dcloud usage space 123
# Get usage history
dcloud usage space 123 --history
# Export usage data
dcloud usage export --format csv --output usage-report.csv
dcloud usage export --format json --output usage-report.json
Token management is not available through the CLI for security reasons.
To create, update, or delete tokens:
/organization/tokens
This ensures tokens can only be managed through secure, authenticated web sessions.
# Get organization details
dcloud org info
# Get organization members
dcloud org members
# Get security settings
dcloud org security
# List organization users
dcloud users list
# Invite new user
dcloud users invite user@example.com --role developer
# Update user role
dcloud users update 789 --role admin
# Available roles: owner, admin, developer, member
# Check API connectivity
dcloud health
# Verbose health check
dcloud health --verbose
# Show current configuration
dcloud config show
# Set configuration values
dcloud config set output json
dcloud config set timeout 30
# Reset configuration to defaults (with confirmation)
dcloud config reset
# Reset configuration to defaults (skip confirmation)
dcloud config reset --confirm
# Available settings:
# - output: table, json, yaml
# - timeout: API request timeout in seconds
# - color: true, false (enable/disable colored output)
All commands support these global options:
--profile <name> # Use specific profile instead of default
--json # Output response as JSON
--quiet # Suppress non-essential output
--verbose # Show detailed output and debug information
--no-color # Disable colored output
--timeout <seconds> # Override default request timeout
# Check overall status
dcloud usage && dcloud spaces list --status creating
# Create a development environment
dcloud spaces create "Feature Branch Test" --type starter --template drupal
# Get login link for debugging
dcloud spaces login 123
# Monitor space creation
watch dcloud spaces status 123
# Export monthly usage report
dcloud usage export --format csv --from 2025-01-01 --to 2025-01-31
# Create a dedicated CI token through the web interface at /organization/tokens
# Then use it in CI scripts:
export DCLOUD_TOKEN="dc_tok_..."
dcloud spaces create "PR-${PR_NUMBER}" --template drupal --type starter
SPACE_ID=$(dcloud spaces list --json | jq -r '.spaces[] | select(.name=="PR-'${PR_NUMBER}'") | .id')
dcloud spaces status $SPACE_ID
# Check for spaces stuck in 'creating' status
dcloud spaces list --status creating --json | jq -r '.spaces[] | select((.createdAt | fromnow) > 3600) | .name'
# Get usage alerts
dcloud usage --json | jq -r 'select(.usagePercentages.storage > 80) | "Storage usage: " + (.usagePercentages.storage | tostring) + "%"'
The CLI returns appropriate exit codes:
0
: Success1
: General error2
: Authentication error3
: Permission error4
: Not found error5
: Validation errorDCLOUD_TOKEN
: Override stored token (useful for CI/CD)DCLOUD_BASE_URL
: Override base URLDCLOUD_PROFILE
: Use specific profileDCLOUD_TIMEOUT
: Request timeout in secondsDCLOUD_NO_COLOR
: Disable colored output# Token authentication failed
dcloud auth test
dcloud auth login
# API connectivity issues
dcloud health --verbose
# Permission denied
dcloud tokens list # Check your token permissions
# Timeout errors
dcloud config set timeout 60
# Enable debug output
dcloud --verbose spaces list
# Check configuration
dcloud config show
# Test token permissions
dcloud auth test --permissions
The CLI directly uses the DrupalCloud API with these endpoints:
GET /api/spaces
- List spacesPOST /api/spaces
- Create spaceGET /api/spaces/{id}
- Get space detailsPATCH /api/spaces/{id}
- Update spaceDELETE /api/spaces/{id}
- Delete spacePOST /api/spaces/{id}/clone
- Clone spacePOST /api/spaces/{id}/archive
- Archive spacePOST /api/spaces/{id}/unarchive
- Unarchive spaceGET /api/usage
- Get usage dataThe CLI is built with:
For development and contribution guidelines, see the CLI repository.
FAQs
Command-line interface for DrupalCloud API management
We found that dcloud-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.