{"id":50879108,"url":"https://github.com/cachly-dev/cachly-action","last_synced_at":"2026-06-15T12:03:52.294Z","repository":{"id":362922183,"uuid":"1250723323","full_name":"cachly-dev/cachly-action","owner":"cachly-dev","description":"GitHub Action to configure Cachly AI Brain for any repo — generates copilot-instructions.md, .mcp.json and indexes the project codebase","archived":false,"fork":false,"pushed_at":"2026-06-06T14:02:19.000Z","size":20,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-06T16:03:48.392Z","etag":null,"topics":["ai","brain","caching","copilot","developer-tools","github-action","llm","mcp"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cachly-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-26T23:01:48.000Z","updated_at":"2026-05-26T23:03:31.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/cachly-dev/cachly-action","commit_stats":null,"previous_names":["cachly-dev/cachly-action"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/cachly-dev/cachly-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cachly-dev%2Fcachly-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cachly-dev%2Fcachly-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cachly-dev%2Fcachly-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cachly-dev%2Fcachly-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cachly-dev","download_url":"https://codeload.github.com/cachly-dev/cachly-action/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cachly-dev%2Fcachly-action/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34361404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","brain","caching","copilot","developer-tools","github-action","llm","mcp"],"created_at":"2026-06-15T12:03:51.373Z","updated_at":"2026-06-15T12:03:52.279Z","avatar_url":"https://github.com/cachly-dev.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# cachly-brain-setup\n\nGitHub Action to auto-configure AI Brain memory for any repo.\n\n## Usage\n\n```yaml\nname: Setup Cachly Brain\non:\n  push:\n    branches: [main]\n\njobs:\n  setup-brain:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n\n      - uses: cachly-dev/cachly-action@v1\n        with:\n          instance-id: ${{ secrets.CACHLY_INSTANCE_ID }}\n          api-key: ${{ secrets.CACHLY_API_KEY }}\n          project-description: 'My awesome project'\n\n      - uses: stefanzweifel/git-auto-commit-action@v5\n        with:\n          commit_message: 'chore: configure Cachly AI Brain'\n          file_pattern: '.github/copilot-instructions.md .mcp.json'\n```\n\n## Modes\n\n### `setup` (default)\n\nGenerates `.github/copilot-instructions.md` and `.mcp.json`, then indexes your source files into the Brain. Run on every push to `main` to keep the index fresh.\n\n### `learn`\n\nAuto-learns from recent commits and PR metadata. Wire this to `pull_request: types: [closed]` so your Brain grows on every merge — no manual `learn_from_attempts` calls needed.\n\n### `scan`\n\nPR risk scan. Calls `brain_plan` + `smart_recall` against the PR diff and posts a comment with a risk score (0–100) and a list of predicted failure patterns. Run this on `pull_request: types: [opened, synchronize]` before CI runs so reviewers see the risk upfront.\n\n### `hygiene`\n\nWeekly Brain sweep. Archives stale lessons, flags provisional knowledge, and removes orphaned entries. Schedule via `workflow_dispatch` or a weekly cron — keeps Brain quality high over time.\n\n## GitLab CI/CD\n\nOn GitLab? The same Brain, same modes, same closed-loop self-calibration are\navailable via the GitLab template at\n[`templates/cachly.gitlab-ci.yml`](templates/cachly.gitlab-ci.yml). Add to your\n`.gitlab-ci.yml`:\n\n```yaml\ninclude:\n  - remote: 'https://raw.githubusercontent.com/cachly-dev/cachly-action/main/templates/cachly.gitlab-ci.yml'\n\nvariables:\n  CACHLY_INSTANCE_ID: \"\u003cyour-brain-uuid\u003e\"\n\ncachly-learn:\n  extends: .cachly_learn\n  rules:\n    - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'\n\ncachly-scan:\n  extends: .cachly_scan\n  rules:\n    - if: '$CI_PIPELINE_SOURCE == \"merge_request_event\"'\n```\n\nSet `CACHLY_API_KEY` (masked) in **Settings → CI/CD → Variables**. Outcomes are\nreported to the Brain as source `gitlab_ci`. The Cachly VS Code and JetBrains\nplugins auto-detect a GitLab `origin` and scaffold this for you on setup.\n\n## Inputs\n\n| Input | Required | Default | Description |\n|-------|----------|---------|-------------|\n| `instance-id` | ✅ | — | Brain instance UUID (from cachly.dev → Dashboard → Brain) |\n| `api-key` | ✅ | — | API key `cky_live_...` (use GitHub Secrets!) |\n| `api-url` | ❌ | `https://api.cachly.dev` | API base URL |\n| `embed-provider` | ❌ | `openai` | Embedding provider |\n| `project-description` | ❌ | repo name | Short project description |\n| `index-project` | ❌ | `true` | Index source files into the Brain semantic cache |\n| `index-max-files` | ❌ | `500` | Max files to index per run |\n| `mode` | ❌ | `setup` | `setup` (generate config + index), `learn` (auto-learn from recent commits), `scan` (PR risk scan), or `hygiene` (weekly Brain sweep) |\n| `learn-max-commits` | ❌ | `50` | In `learn` mode: how many recent commits to learn from |\n| `pr-number` | ❌ | — | PR number (required for `scan` mode) |\n| `pr-title` | ❌ | — | PR title passed to risk scan |\n| `pr-body` | ❌ | — | PR body / description passed to risk scan |\n| `scan-top-k` | ❌ | `10` | In `scan` mode: number of Brain lessons to consider |\n| `scan-post-comment` | ❌ | `true` | In `scan` mode: whether to post a PR comment with the risk score |\n\n## Outputs\n\n| Output | Description |\n|--------|-------------|\n| `indexed-files` | Number of files indexed into the Brain |\n| `risk-score` | Risk score 0–100 produced by `scan` mode (0 = low risk, 100 = very high) |\n| `failures-json` | JSON array of predicted failure patterns from `scan` mode |\n\n---\n\n## Full workflow example\n\nAll four modes wired together in one CI file:\n\n```yaml\nname: Cachly Brain\n\non:\n  push:\n    branches: [main]\n  pull_request:\n    types: [opened, synchronize, closed]\n  schedule:\n    - cron: '0 3 * * 1'   # weekly hygiene — every Monday at 03:00 UTC\n  workflow_dispatch:\n\njobs:\n  # ── setup: keep the Brain index fresh on every push to main ──────────\n  setup:\n    if: github.event_name == 'push'\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - uses: cachly-dev/cachly-action@v1\n        with:\n          mode: setup\n          instance-id: ${{ secrets.CACHLY_INSTANCE_ID }}\n          api-key: ${{ secrets.CACHLY_API_KEY }}\n          project-description: 'My awesome project'\n      - uses: stefanzweifel/git-auto-commit-action@v5\n        with:\n          commit_message: 'chore: configure Cachly AI Brain'\n          file_pattern: '.github/copilot-instructions.md .mcp.json'\n\n  # ── scan: post PR risk comment before CI runs ─────────────────────────\n  scan:\n    if: github.event_name == 'pull_request' \u0026\u0026 github.event.action != 'closed'\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - uses: cachly-dev/cachly-action@v1\n        with:\n          mode: scan\n          instance-id: ${{ secrets.CACHLY_INSTANCE_ID }}\n          api-key: ${{ secrets.CACHLY_API_KEY }}\n          pr-number: ${{ github.event.pull_request.number }}\n          pr-title: ${{ github.event.pull_request.title }}\n          pr-body: ${{ github.event.pull_request.body }}\n          scan-top-k: 10\n          scan-post-comment: 'true'\n\n  # ── learn: auto-learn from every merged PR ────────────────────────────\n  learn:\n    if: github.event_name == 'pull_request' \u0026\u0026 github.event.pull_request.merged == true\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n        with:\n          fetch-depth: 50\n      - uses: cachly-dev/cachly-action@v1\n        with:\n          mode: learn\n          instance-id: ${{ secrets.CACHLY_INSTANCE_ID }}\n          api-key: ${{ secrets.CACHLY_API_KEY }}\n\n  # ── hygiene: weekly Brain sweep ───────────────────────────────────────\n  hygiene:\n    if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'\n    runs-on: ubuntu-latest\n    steps:\n      - uses: cachly-dev/cachly-action@v1\n        with:\n          mode: hygiene\n          instance-id: ${{ secrets.CACHLY_INSTANCE_ID }}\n          api-key: ${{ secrets.CACHLY_API_KEY }}\n```\n\n---\n\n## 🧠 Auto-learn from every merged PR (zero manual work)\n\nAdd this workflow and your Brain grows automatically on every PR merge —\neach meaningful commit becomes a lesson your AI recalls in future sessions:\n\n```yaml\nname: Brain — learn from merged PRs\non:\n  pull_request:\n    types: [closed]\n\njobs:\n  learn:\n    if: github.event.pull_request.merged == true\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n        with:\n          fetch-depth: 50   # must be \u003e= learn-max-commits for history access\n      - uses: cachly-dev/cachly-action@v1\n        with:\n          mode: learn\n          instance-id: ${{ secrets.CACHLY_INSTANCE_ID }}\n          api-key: ${{ secrets.CACHLY_API_KEY }}\n```\n\nAfter this, every merged PR teaches your Brain — no `learn_from_attempts`\ncalls, no manual steps. Your AI arrives pre-briefed on what the team shipped.\n\n## What it generates\n\n- `.github/copilot-instructions.md` — Auto-recall/learn instructions for all AI assistants\n- `.mcp.json` — MCP server config (if not present)\n\nAfter setup, every push automatically indexes your latest source changes into the Brain so your AI assistant can find relevant code with `semantic_search` — no manual re-indexing needed.\n\n---\n\n## 👥 Team Brain — Shared AI Memory for Your Whole Team\n\nOne shared instance. Every developer gets smarter every day.\n\n```yaml\n# GitHub Actions — share the same Brain instance across the whole team\nenv:\n  CACHLY_INSTANCE_ID: ${{ secrets.CACHLY_INSTANCE_ID }}\n\n# Alice's workflow stores a lesson after a successful deploy:\n- name: Store deploy lesson\n  run: |\n    curl -sX POST https://api.cachly.dev/v1/brain/learn \\\n      -H \"Authorization: Bearer ${{ secrets.CACHLY_API_KEY }}\" \\\n      -d '{\"topic\":\"deploy:k8s-timeout\",\"outcome\":\"success\",\n           \"what_worked\":\"Increase readinessProbe.failureThreshold to 10\",\"author\":\"alice\"}'\n\n# Bob's next session-start workflow pulls all team lessons automatically:\n- uses: cachly-dev/cachly-action@v1\n  with:\n    instance-id: ${{ secrets.CACHLY_INSTANCE_ID }}\n    api-key: ${{ secrets.CACHLY_API_KEY }}\n# → \"💡 alice solved deploy:k8s-timeout 1d ago: Increase readinessProbe...\"\n```\n\nSet up a team org at [cachly.dev/teams](https://cachly.dev/teams) — Team €99/mo · 10 seats · Business €299/mo · 50 seats.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcachly-dev%2Fcachly-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcachly-dev%2Fcachly-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcachly-dev%2Fcachly-action/lists"}