Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/claude.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Claude

# Review on every ready PR, then auto-approve when Claude rates the diff low risk
# against "Review risk boundaries" in AGENTS.md. Approvals are submitted by the Claude
# GitHub App, and only once duneanalytics/cli is on the allowlist in duneanalytics/actions.

on:
pull_request:
types: [opened, ready_for_review, reopened]
issue_comment:
types: [created]

permissions:
contents: read
pull-requests: write
checks: read
statuses: read
id-token: write

jobs:
claude:
# Public repository: PRs from forks get no secrets or OIDC token, so they are skipped.
# Org members can still run "@claude review" on any PR.
if: github.event_name == 'issue_comment' || github.event.pull_request.head.repo.full_name == github.repository
uses: duneanalytics/actions/.github/workflows/claude.yml@main
with:
# The self-hosted runner group does not allow public repositories.
runs-on: '"ubuntu-latest"'
auto-approve: true
# Decision comments only, until they look right; then set to false.
dry-run: true
deny-paths: |
.github/*
install.sh
.goreleaser.yml
AGENTS.md
CLAUDE.md
authconfig/*
tracking/*
secrets:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
SIETCH_APP_PRIVATE_KEY: ${{ secrets.SIETCH_APP_PRIVATE_KEY }}
51 changes: 51 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Agent Instructions for cli

> Keep this document lean. It is a navigation and working guide; usage belongs in `README.md`.

## Overview

`dune` is Dune's public command-line client. Commands call the REST API through
`duneapi-client-go`; only features with no REST endpoint call the Dune MCP server
through `dunemcp/`. Users and scripts depend on command names, flags, exit codes and
`-o json` output.

## Repository Map

| Path | Responsibility |
| ------------------------ | -------------------------------------------------------- |
| `cmd/` | One package per command group; `cmd/main.go` is the entry. |
| `cli/` | Root command and wiring. |
| `cmdutil/`, `output/` | Shared flag parsing, clients and text/JSON output. |
| `dunemcp/` | Small MCP client and its test fake. |
| `authconfig/` | API key and identity stored on the user's disk. |
| `tracking/` | Amplitude usage telemetry. |
| `install.sh`, `.goreleaser.yml`, `flake.nix` | Distribution. |

## Build & Test

```bash
make lint
make test
```

`flake.nix` pins a `vendorHash`; update it when `go.mod` or `go.sum` changes.

## Review risk boundaries

Claude auto-approve may approve a pull request only when every change is low risk:
bug fixes and features inside `cmd/`, `cli/`, `cmdutil/`, `output/` and `dunemcp/`,
tests, documentation, and patch or minor bumps of existing Go dependencies.

These changes need a human review:

- Everything under `.github/`, `install.sh`, `.goreleaser.yml`, and `AGENTS.md` or `CLAUDE.md`.
- `authconfig/`: how the API key is read, stored or written, and file permissions.
- `tracking/`: what telemetry is sent, when, or how users opt out.
- Sending the API key or user data to a new host, or changing which host a command calls.
- Breaking changes for users and scripts: removing or renaming a command or flag,
changing a flag's default, changing the exit code of an existing case, or removing or
renaming a key in `-o json` output.
- Newly added dependencies, major-version bumps of a dependency (a `0.x` minor counts as
major), the Go version in `go.mod`, and dependencies from a source other than the Go
module proxy (`replace` directives, forks).
- Deleting a test whose subject code stays.
Loading