個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證GitHub Action to install Cursor CLI and run cursor-agent in CI
翻譯準備中
取自儲存庫 README
正在載入完整 README。
檢視完整 README ↗Run Cursor agents in GitHub Actions using the official @cursor/sdk. An independent project, not affiliated with or endorsed by Cursor.
CURSOR_API_KEY.steps.<id>.outputs.summary for the model response.- name: Run Cursor Agent
id: cursor
uses: PunGrumpy/cursor-action@v2
with:
api-key: ${{ secrets.CURSOR_API_KEY }}
prompt: "Review this PR for security issues and summarize your findings."
- name: Print summary
env:
SUMMARY: ${{ steps.cursor.outputs.summary }}
run: echo "$SUMMARY"
The action runs on ubuntu-latest, windows-latest, and macos-latest.
| Input | Required | Default | Description |
|---|---|---|---|
cursor-version | ❌ | latest | (Deprecated) The SDK automatically manages the agent version. |
api-key | ✅ | — | Cursor API key for authentication |
prompt | ✅ | — | Prompt to pass to cursor-agent |
model | ❌ | default | Model id for the agent (e.g. default, composer-2). The Cursor SDK does not accept auto. |
working-directory | ❌ | . | Working directory for the agent to operate in |
permissions | ❌ | read-only | Built-in tools the agent may use: read-only (read, search, and web tools), read-write (adds file edits; no shell or subagents), or full (the SDK's default toolset). |
timeout | ❌ | 300 | Timeout in seconds for the agent run |
| Output | Description |
|---|---|
summary | Text summary returned by the cursor-agent |
exit-code | Exit code from the cursor-agent process |
status | Run status returned by the cursor-agent (finished, error, or cancelled) |
duration-ms | Execution duration in milliseconds |
total-tokens | Total tokens consumed by the agent run |
input-tokens | Input tokens consumed by the agent run |
output-tokens | Output tokens generated by the agent run |
[!IMPORTANT]
Treat
summaryas untrusted model output. Pass it throughenv:rather than interpolating${{ steps.<id>.outputs.summary }}directly into arun:script or agithub-scriptbody — interpolation splices the text into the script before it executes.
Worked examples, what the action does at runtime, and troubleshooting live in docs/, which is published as the documentation site. The tables above are generated from action.yml by the same script that generates the site's reference page, so neither can drift from the manifest.
bun install
bun run typecheck
bun run test
bun run build
dist/ is committed on purpose — GitHub Actions executes it straight from the tag. If you changed anything under src/, run bun run build and commit the result; CI fails when dist/ is out of date. The bundle only contains this repository's own code (a few KB); @actions/core and @cursor/sdk stay external and are installed by the action at runtime, so package-lock.json must stay in sync with package.json.
bun run docs:reference # regenerate the reference tables from action.yml
bun run docs:dev # http://localhost:3000
docs/ is a separate Fumapress project with its own lockfile, so bun install at the repository root does not pull in its dependencies.
export GITHUB_STEP_SUMMARY="$(mktemp)"
export GITHUB_OUTPUT="$(mktemp)"
env "INPUT_API-KEY=$CURSOR_API_KEY" \
"INPUT_PROMPT=Say 'smoke test passed' and nothing else." \
"INPUT_MODEL=default" \
"INPUT_PERMISSIONS=read-only" \
"INPUT_TIMEOUT=60" \
node dist/index.mjs
CI runs typecheck, lint, test, build, and a dist/ freshness check on every push and pull request. The Docs job regenerates the reference from action.yml, typechecks the site, and builds it.Integration jobs install the action's runtime dependencies and run it with an invalid key on Ubuntu, Windows, and macOS. Being rejected at authentication is the pass condition: it proves the dependency tree resolves and the SDK reaches Cursor, without spending an agent run.Smoke Test runs the action for real and needs a CURSOR_API_KEY on a paid plan, so it only runs from the Actions tab (workflow_dispatch).Release runs Changesets on pushes to main to open a release PR or publish, then moves the major version tag (v2) to the published version.uses: PunGrumpy/cursor-action@v2 tracks the latest v2.x.x. Pin a full tag or a commit SHA if you want a frozen version.This project uses Changesets. See .changeset/README.md for the contribution workflow.