Cloud Integration
Connect your repository to VGuard Cloud for team-wide analytics, alerts, and drift detection.
Overview
VGuard Cloud extends the open-source CLI with a hosted dashboard that gives your team visibility into code quality metrics, convention drift, and AI agent behavior across all your repositories.
What Cloud adds:
- Real-time debt score tracking with 30-day sparklines
- Convention drift detection and timeline
- Rule hit analytics per project and per developer
- SLA monitoring and uptime tracking
- Configurable alerts (Slack, email, webhooks)
- GitHub PR comments and check runs (Team/Enterprise)
- Public dashboard badges for open-source projects
Prerequisites
Before connecting to Cloud, ensure you have:
- VGuard CLI installed:
npm install -D @solanticai/vguard - A project initialized:
npx vguard init - A VGuard Cloud account — sign up here
Step 1: Sign In
Authenticate the CLI with your Cloud account:
npx vguard cloud login
This opens your browser for OAuth authentication. Once approved, a token is stored locally at ~/.vguard/credentials.json. The token persists across sessions.
Step 2: Connect Your Project
Link your local project to a Cloud project:
npx vguard cloud connect
The CLI will:
- Detect your project name from
package.jsonor the directory name - Check if a matching Cloud project exists, or create one
- Generate an API token for this project
- Update your
vguard.config.tswith thecloudsection
Step 3: Regenerate Hooks
After connecting, regenerate your hooks to enable cloud sync:
npx vguard generate
This updates your hook scripts to include the sync step that sends rule hit data to Cloud at the end of each session.
Step 4: Verify
Confirm everything is wired up correctly:
npx vguard doctor
You should see a green checkmark next to "Cloud connection" in the output.
How Data Syncs
When VGuard hooks run during an AI coding session, rule hits are collected locally. At session end (the Stop hook), they are batched and sent to Cloud:
- Endpoint:
POST /api/v1/ingest - Auth:
X-API-Keyheader with your project token - Format: NDJSON (one JSON object per line)
- Rate limit: 100 requests per minute per project
Each record includes:
| Field | Description |
|---|---|
ruleId | The rule that fired (e.g. security/branch-protection) |
status | block, warn, or info |
event | Hook event type (PreToolUse, PostToolUse, Stop) |
tool | The tool that triggered the rule (e.g. Edit, Bash) |
filePath | The file involved (if applicable) |
sessionId | Unique session identifier |
timestamp | ISO 8601 timestamp |
Configuration Reference
After running cloud connect, your config file includes a cloud section:
import { defineConfig } from '@solanticai/vguard';
export default defineConfig({
presets: ['nextjs-15', 'typescript-strict'],
agents: ['claude-code'],
cloud: {
enabled: true,
projectId: 'your-project-id',
autoSync: true,
},
});
| Option | Type | Description |
|---|---|---|
enabled | boolean | Enable or disable cloud sync |
projectId | string | Your Cloud project identifier |
autoSync | boolean | Automatically sync rule hits at session end |
Managing API Tokens
You can create and rotate API tokens in the Cloud dashboard:
- Navigate to Settings > API Tokens
- Click Create Token and give it a descriptive name
- Copy the token — it is only shown once
- Tokens are hashed (SHA-256) server-side and cannot be recovered
To rotate a token:
- Create a new token
- Update your local config or re-run
npx vguard cloud connect - Delete the old token
GitHub Integration
Available on Team and Enterprise plans.
The VGuard GitHub App adds automated PR feedback:
- PR comments: Posts a summary of debt score changes and recent blocks
- Check runs: Creates a pass/fail check based on your quality threshold
To set up:
- Go to Settings > GitHub in the Cloud dashboard
- Click Install GitHub App and select your repositories
- VGuard will automatically detect PRs and post feedback
Disconnecting
To disconnect a project from Cloud:
- Remove the
cloudsection fromvguard.config.ts - Regenerate hooks:
npx vguard generate - Optionally delete the project in the Cloud dashboard
Local VGuard rules continue to work independently of Cloud.
Troubleshooting
| Issue | Solution |
|---|---|
MISSING_API_KEY | Re-run npx vguard cloud connect to regenerate your token |
INVALID_API_KEY | Token may have been rotated — create a new one in Settings > API Tokens |
RATE_LIMITED | Wait 60 seconds and retry. Check if multiple clients share the same token |
SUBSCRIPTION_INACTIVE | Renew your subscription in the Cloud dashboard |
REPO_LIMIT_EXCEEDED | Upgrade your plan or remove unused projects |
For more help, see the Troubleshooting guide.