Introduction to .git CLI

The official command-line interface for managing projects, deployments, and team workflows on the .git platform.

Overview

The .git CLI is the fastest way to interact with your repositories, trigger builds, manage environments, and deploy code directly from your terminal. It integrates seamlessly with your existing Git workflow while adding powerful automation layers.

💡 Tip

Run git --help or git docs to open this documentation directly in your browser.

Installation

Install the CLI via your preferred package manager or download the binary directly:

bash
# macOS & Linux
curl -fsSL https://git.dev/install | bash

# npm
npm install -g @git/cli

# Homebrew
brew install git-cli

Verify installation:

bash
git --version
# Output: .git CLI v2.4.1

Authentication

Authenticate your CLI session using your platform token or OAuth:

bash
# Interactive login (opens browser)
git auth login

# Token-based auth
git auth login --token glp_xxxxxxxx

# Organization context
git auth use-org acme-corp
⚠️ Security Notice

Never commit tokens to version control. Use environment variables or secret managers like 1Password, AWS Secrets Manager, or git secrets.

Basic Commands

Command Description Alias
git init Initialize a new .git project in current directory gi
git link Connect local repo to a remote .git project lk
git deploy Trigger a build and deployment to production d
git logs View deployment history and build status lg
git env Manage environment variables across contexts e

Project Configuration

Each project uses a .gitconfig.json file at the root to define build commands, output directories, and deployment rules:

json
{
  "build": {
    "command": "npm run build",
    "output": "dist/",
    "nodeVersion": "18"
  },
  "deploy": {
    "regions": ["us-east-1", "eu-west-1"],
    "autoPreview": true,
    "rollbackOnFail": true
  },
  "env": {
    "STRIPE_KEY": {"source": "vault"},
    "DEBUG": {"default": "false"}
  }
}

Advanced Configuration

For complex workflows, you can use YAML syntax with multi-stage pipelines, conditional deployments, and custom edge functions. See Pipeline Configuration for advanced examples.

Next Steps