C

Custom Zero Config Deployment

Streamline your workflow with this auto, detecting, vercel, deployment. Includes structured workflows, validation checks, and reusable patterns for statusline.

SettingClipticsstatuslinev1.0.0MIT
0 views0 copies

Custom Zero Config Deployment

Auto-detecting Vercel deployment monitor that discovers credentials from CLI config and project files with zero manual setup required.

When to Use This Setting

Apply this setting when you need to:

  • Monitor Vercel deployments without manually configuring any API tokens or project IDs
  • Leverage existing Vercel CLI authentication stored on your system for automatic credential discovery
  • Support cross-platform operation with auto-detection of config paths on macOS, Linux, and Windows Consider alternatives when:
  • You have not installed or authenticated with the Vercel CLI and no credentials exist on your system
  • You need to monitor a project different from the one configured in your local .vercel directory

Quick Start

Configuration

name: custom-zero-config-deployment type: setting category: statusline

Example Application

claude setting:apply custom-zero-config-deployment

Example Output

Setting applied. Changes:
- statusLine.type: command
- statusLine.command: bash zero-config-vercel inline
- auth_discovery: ~/Library/Application Support/com.vercel.cli/auth.json (macOS)
- project_discovery: .vercel/project.json
- fallback: VERCEL_TOKEN and VERCEL_PROJECT_ID env vars
- status_icons: ready(check), building(cycle), queued(hourglass), error(x)

Core Concepts

Zero Config Discovery Overview

AspectDetails
Token DiscoveryReads Vercel CLI auth token from platform-specific config directories
Project DiscoveryReads project ID from .vercel/project.json in the current working directory
Platform SupportmacOS (Library/Application Support), Linux (~/.config/vercel), Windows (%APPDATA%/vercel)
Environment FallbackFalls back to VERCEL_TOKEN and VERCEL_PROJECT_ID if auto-detection fails
Deployment DisplayShows state, truncated URL, time since deployment, and directory name

Zero Config Architecture

+--------------------+     +---------------------+     +-------------------+
| Platform Detector  |---->| Auth File Reader    |---->| Project File Read |
| OSTYPE check       |     | platform-specific   |     | .vercel/project   |
| macOS/Linux/Win    |     | auth.json path      |     | .json projectId   |
+--------------------+     +---------------------+     +-------------------+
         |                          |                          |
         v                          v                          v
  +----------------+      +-------------------+       +------------------+
  | Env Fallback   |      | Vercel API Call   |       | Status Display   |
  | VERCEL_TOKEN   |      | /v6/deployments   |------>| state+url+time   |
  | VERCEL_PROJ_ID |      | Bearer auth       |       | +directory name  |
  +----------------+      +-------------------+       +------------------+

Configuration

ParameterTypeDefaultDescription
auth_file_overridestring""Manual path to Vercel auth.json, bypassing platform auto-detection
project_file_pathstring".vercel/project.json"Relative path to the Vercel project configuration file
url_truncate_lengthinteger20Maximum characters of the deployment URL to display
api_timeoutinteger3Maximum seconds to wait for the Vercel API response
fallback_to_envbooleantrueEnable fallback to environment variables when auto-detection fails

Best Practices

  1. Authenticate the Vercel CLI first - Run vercel login once on your system to create the auth.json file that zero-config discovery relies on. Without this file, the setting falls back to environment variables, defeating the zero-config purpose.
  2. Link your project with vercel link - Run vercel link in your project directory to create the .vercel/project.json file that provides automatic project ID discovery. This one-time setup enables fully automatic monitoring.
  3. Verify platform detection on WSL - If you use Windows Subsystem for Linux, the OSTYPE variable reports linux-gnu but Vercel CLI config may be in the Windows filesystem. Set auth_file_override to the correct WSL path if auto-detection finds the wrong location.
  4. Use URL truncation wisely - Vercel deployment URLs can be very long. The default 20-character truncation shows enough to identify the deployment without overflowing the statusline. Increase for more detail or decrease for tighter layouts.
  5. Secure your auth.json file - The Vercel auth token stored in auth.json has full API access. Ensure the file permissions are restricted to your user account with chmod 600 to prevent other system users from reading your credentials.

Common Issues

  1. Config missing warning displayed - Neither auto-detected credentials nor environment variables were found. Run vercel login and vercel link to create the necessary configuration files for zero-config operation.
  2. API error after OS upgrade - The Vercel CLI config directory may have moved after an operating system upgrade. Check the platform-specific path for your OS version and update auth_file_override if the default path changed.
  3. Wrong project being monitored - The .vercel/project.json in your directory may reference an old or different project. Run vercel link again to re-associate your local directory with the correct Vercel project.
Community

Reviews

Write a review

No reviews yet. Be the first to review this template!

Similar Templates