Skip to main content
Quickstart

Connect your first repository

Install via OAuth, get first dead path report in under 10 minutes.

1. Create your account

Head to the registration page and create your account with your work email address. You can also sign in with GitHub or GitLab directly from the registration screen.

2. Install the GitHub App

After logging in, go to Settings > Integrations and click Install GitHub App. This installs YAGNI with read-only repository access and pull request creation permission. You will be redirected to GitHub to authorize the installation.

YAGNI requests the minimum OAuth scope required: contents:read and pull_requests:write. No write access to your default branch is requested or used.

3. Select a repository

After installation, you are redirected to the YAGNI dashboard. Click Add Repository and select the repository you want to analyze. YAGNI supports GitHub, GitLab, and Bitbucket repositories.

During setup you will be asked to specify:

  • The target branch where YAGNI will open pull requests
  • The test command YAGNI should run before opening any PR (e.g., npm test, pytest, go test ./...)
  • Optional: a .yagniignore file path if you have one already

4. Run your first analysis

Click Run Analysis from the repository dashboard. YAGNI will:

  1. Clone your repository into an isolated container
  2. Build the static call graph from your source
  3. Identify modules with zero reachable callers
  4. Cross-reference with runtime traces (if available)
  5. Generate the dead path report

Initial analysis on a typical mid-size codebase (100k-500k lines) takes 3 to 8 minutes.

bash
# Trigger analysis via API (optional - can also use the dashboard)
curl -X POST https://api.yagnihq.com/v1/analyses \
  -H "Authorization: Bearer $YAGNI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"repository_id": "YOUR_REPO_ID"}'

5. Review the PR

When YAGNI finds dead paths with high confidence, it opens a pull request against your target branch. The PR includes:

  • The set of files and functions removed
  • The call graph evidence showing zero reachable callers
  • The test run result confirming all tests pass after removal

Your team reviews and merges the PR just like any other code change. YAGNI never merges automatically.


GitHub Actions integration

Add YAGNI to your CI pipeline so analysis runs automatically on each push to your main branch:

yaml
name: YAGNI Dead Code Analysis
on:
  push:
    branches: [main]
  schedule:
    - cron: '0 6 * * 1'

jobs:
  yagni:
    runs-on: ubuntu-latest
    steps:
      - name: Trigger YAGNI analysis
        run: |
          curl -X POST https://api.yagnihq.com/v1/analyses \
            -H "Authorization: Bearer ${{ secrets.YAGNI_API_KEY }}" \
            -d '{"repository_id": "${{ secrets.YAGNI_REPO_ID }}"}'

Monorepo support

YAGNI supports monorepo configurations. When adding a repository, expand Advanced Settings and specify the workspace roots you want analyzed:

json
{
  "workspace_roots": [
    "packages/api-service",
    "packages/worker-service",
    "packages/shared"
  ],
  "test_command": "npm run test:workspace",
  "ignore_paths": ["packages/legacy-*"]
}

Each workspace root is analyzed independently. Cross-package call graph edges are resolved automatically when packages import each other.