{"_id":"@afk-watch/cli","_rev":"9-4289a9bd33480f2a55a41e1d4e3f9b90","name":"@afk-watch/cli","dist-tags":{"latest":"0.6.0"},"versions":{"0.1.0":{"name":"@afk-watch/cli","version":"0.1.0","license":"MIT","_id":"@afk-watch/cli@0.1.0","maintainers":[{"name":"jofan","email":"stefan.liden@gmail.com"}],"homepage":"https://afk.watch/setup","bin":{"afk":"dist/index.js"},"dist":{"shasum":"2dc5588d8cc4f043c6f3f7def71bd0a740b9fd4e","tarball":"https://registry.npmjs.org/@afk-watch/cli/-/cli-0.1.0.tgz","fileCount":11,"integrity":"sha512-69ROKxPqL74OCwjCWVOgL4Wz4RUsbXWdwW23VHs+Fo0CTY1Wc7baMN8ZwbJK1HOCN6Du1XmXZWPjPT9zilZ3Kg==","signatures":[{"sig":"MEUCIHoRlVqBnqXKnUcSeRkbXpYscIJOW/HGKApbeXEH0uw9AiEA0TZFXERzs0Nte+5G+Rk6m5/GdIEBiokLDAg4kitjq8Y=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":36302},"type":"module","engines":{"node":">=22"},"gitHead":"b694f59f739c74a5145dd04e9939a09353f66b50","scripts":{"test":"vitest run","build":"tsc && node build.mjs","prepack":"npm run build","typecheck":"tsc --noEmit"},"_npmUser":{"name":"jofan","email":"stefan.liden@gmail.com"},"_npmVersion":"10.9.3","description":"One-command setup for afk.watch agent integrations - wires the Claude Code hooks and stores your key, with a symmetric uninstall.","directories":{},"_nodeVersion":"22.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.10","typescript":"~6.0.3","@types/node":"^26.1.1"},"_npmOperationalInternal":{"tmp":"tmp/cli_0.1.0_1784893392936_0.46847842799111206","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@afk-watch/cli","version":"0.2.0","license":"MIT","_id":"@afk-watch/cli@0.2.0","maintainers":[{"name":"jofan","email":"stefan.liden@gmail.com"}],"homepage":"https://afk.watch/setup","bin":{"afk":"dist/index.js"},"dist":{"shasum":"50f23b115f52870d3a3c69aa9e37c3c1775570e9","tarball":"https://registry.npmjs.org/@afk-watch/cli/-/cli-0.2.0.tgz","fileCount":13,"integrity":"sha512-JgI97tOTv+lj20C1MI4GaIqPI3McB1CEevNYu8two22eiZTLF5NYfNAankZGlE+i5yR2AzWlDpOd4M8xXXaFzQ==","signatures":[{"sig":"MEUCIFTGlry3d6IRi9rrTzS9e/8diBXjAXhqI5qM7eubJeoRAiEAhc6+4e78uSJHczrMToEyTlk5Bq9OF3FAUx4m1eDrltM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":54990},"type":"module","engines":{"node":">=22"},"scripts":{"test":"vitest run","build":"tsc && node build.mjs","prepack":"npm run build","typecheck":"tsc --noEmit"},"_npmUser":{"name":"jofan","email":"stefan.liden@gmail.com"},"_npmVersion":"11.17.0","description":"One-command setup for afk.watch agent integrations - wires the Claude Code hooks and stores your key, with a symmetric uninstall.","directories":{},"_nodeVersion":"26.5.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.10","typescript":"~6.0.3","@types/node":"^26.1.1"},"_npmOperationalInternal":{"tmp":"tmp/cli_0.2.0_1785748712813_0.5095175918005805","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@afk-watch/cli","version":"0.2.1","license":"MIT","_id":"@afk-watch/cli@0.2.1","maintainers":[{"name":"jofan","email":"stefan.liden@gmail.com"}],"homepage":"https://afk.watch/setup","bin":{"afk":"dist/index.js"},"dist":{"shasum":"98b9a7e4b92027e982c96406e31be874a0eaa13b","tarball":"https://registry.npmjs.org/@afk-watch/cli/-/cli-0.2.1.tgz","fileCount":13,"integrity":"sha512-K7d094vp71/RHAQgBLKUtKKHkyR8c2KyB/tf4LCsr0Am/8jQqOaQnQTdb750D9LnQgaB5f3ns5HuLo5QANx3/g==","signatures":[{"sig":"MEQCIEMxxIUO6gERI+Q1qRwmY1uixidFPQSCNHVV+8u/aPOBAiARjSdzI4KtoPW34JXqeH6y0Ok1vMWNAeWLvq6Mi392cQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":55020},"type":"module","engines":{"node":">=22"},"gitHead":"163f113813fcfcce0433020dec5b5518f1a0aed6","scripts":{"test":"vitest run","build":"tsc && node build.mjs","prepack":"npm run build","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:b8b8be01-582e-409a-8dce-c5394c87d402"}},"_npmVersion":"11.19.0","description":"One-command setup for afk.watch agent integrations - wires the Claude Code hooks and stores your key, with a symmetric uninstall.","directories":{},"_nodeVersion":"22.23.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.10","typescript":"~6.0.3","@types/node":"^26.1.1"},"_npmOperationalInternal":{"tmp":"tmp/cli_0.2.1_1785757770495_0.32001073017857595","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@afk-watch/cli","version":"0.3.0","license":"MIT","_id":"@afk-watch/cli@0.3.0","maintainers":[{"name":"jofan","email":"stefan.liden@gmail.com"}],"homepage":"https://afk.watch/setup","bin":{"afk":"dist/index.js"},"dist":{"shasum":"ff0a83f6598f171ed6ea8942cbacc90e66629093","tarball":"https://registry.npmjs.org/@afk-watch/cli/-/cli-0.3.0.tgz","fileCount":13,"integrity":"sha512-+sLkTNC4KnJ3Qvb2g/pRLuL/1BdU9nrbBmN+wJR4tvGKnf2Gsm9uGlSCzXqFMjRvaU/eLu5k+HV0ydSFkMnMJQ==","signatures":[{"sig":"MEYCIQDWkmAyCqBFtoyXK3nJJRs2j25M7CmOvxZWGzXOCVPHHgIhAOIWYFsnGJbzhyMQrxy6ZInLAwlegnHMCcf2T7B+B2Bu","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":57000},"type":"module","engines":{"node":">=22"},"gitHead":"b1c6bcfd48df438bf1127a9e36091953ed888034","scripts":{"test":"vitest run","build":"tsc && node build.mjs","prepack":"npm run build","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:b8b8be01-582e-409a-8dce-c5394c87d402"}},"_npmVersion":"11.19.0","description":"Installer for afk.watch agent integrations - wires Claude Code hooks, installs the skill, and stores your key.","directories":{},"_nodeVersion":"22.23.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.10","typescript":"~6.0.3","@types/node":"^26.1.1"},"_npmOperationalInternal":{"tmp":"tmp/cli_0.3.0_1785921464315_0.592538358505065","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@afk-watch/cli","version":"0.4.0","license":"MIT","_id":"@afk-watch/cli@0.4.0","maintainers":[{"name":"jofan","email":"stefan.liden@gmail.com"}],"homepage":"https://afk.watch/setup","bin":{"afk":"dist/index.js"},"dist":{"shasum":"93c9ef46144e6b87bd2933a7594a9841bed23fb6","tarball":"https://registry.npmjs.org/@afk-watch/cli/-/cli-0.4.0.tgz","fileCount":15,"integrity":"sha512-9+9PbaxSGJgibsAC+doZbmiXQlsPh6HdKNQHLTum3AwLd80YyI/u9xnLyTYKBkt8pGITjuim87ksmNSIWYBozw==","signatures":[{"sig":"MEYCIQCPjKRnmieT9Lm+lhGwfiboZm25KqqOSx5wndetTGIIhwIhAIA36ZHWd0Y2AyQeeMnOgo2jFscq5WKmaUHUuyjho8Sh","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":103819},"type":"module","engines":{"node":">=22"},"gitHead":"25fea3f54d76249a62a43f7861e38d82000c37f1","scripts":{"test":"vitest run","build":"tsc && node build.mjs","prepack":"npm run build","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:b8b8be01-582e-409a-8dce-c5394c87d402"}},"_npmVersion":"11.19.0","description":"Installer for afk.watch integrations - wires Claude Code hooks and optional hosted pickup.","directories":{},"_nodeVersion":"22.23.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"yaml":"^2.9.0","vitest":"^4.1.10","typescript":"~6.0.3","@types/node":"^26.1.1"},"_npmOperationalInternal":{"tmp":"tmp/cli_0.4.0_1786000946893_0.5520571457203516","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"@afk-watch/cli","version":"0.5.0","license":"MIT","_id":"@afk-watch/cli@0.5.0","maintainers":[{"name":"jofan","email":"stefan.liden@gmail.com"}],"homepage":"https://afk.watch/setup","bin":{"afk":"dist/index.js"},"dist":{"shasum":"2e9e4c8cdeb0679e97cc914e79501f9f24030433","tarball":"https://registry.npmjs.org/@afk-watch/cli/-/cli-0.5.0.tgz","fileCount":15,"integrity":"sha512-S964Rh64TPi2gLxpQ/z6ulnJK+cO9Bi2Z3RCZMkN+1oyQzpX+fYfe4ArNyL+48esKnkVBBYIkWrplCY6GBUfeQ==","signatures":[{"sig":"MEQCIF1r0F+N2COdYILE7VRcr8ZpVp24aKjkDB0f9etweMP3AiB0FyLthjaieLV+Rn7VkHVM7qlcgN6W+QsrE0JHzwJ4ZQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":105642},"type":"module","engines":{"node":">=22"},"gitHead":"e7150e650200c94aef765f093f1a8ab4878e64ed","scripts":{"test":"vitest run","build":"tsc && node build.mjs","prepack":"npm run build","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:b8b8be01-582e-409a-8dce-c5394c87d402"}},"_npmVersion":"11.19.0","description":"Installer for afk.watch integrations - wires Claude Code hooks, Claude/Codex skills, and optional hosted pickup.","directories":{},"_nodeVersion":"22.23.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"yaml":"^2.9.0","vitest":"^4.1.10","typescript":"~6.0.3","@types/node":"^26.1.1"},"_npmOperationalInternal":{"tmp":"tmp/cli_0.5.0_1787576082607_0.6460208232016107","host":"s3://npm-registry-packages-npm-production"}},"0.5.1":{"name":"@afk-watch/cli","version":"0.5.1","license":"MIT","_id":"@afk-watch/cli@0.5.1","maintainers":[{"name":"jofan","email":"stefan.liden@gmail.com"}],"homepage":"https://afk.watch/setup","bin":{"afk":"dist/index.js"},"dist":{"shasum":"837d1ea221f60a9c96a40038ed5c21ffde009c68","tarball":"https://registry.npmjs.org/@afk-watch/cli/-/cli-0.5.1.tgz","fileCount":15,"integrity":"sha512-yFixlP1IRNsl+iWIV2S2d3Idbva5uf2MJ0pSe4fihlpTJaUWJpnyv1mfwKoUJjGh2bMS1nGG5LDy8wR+HeXkcQ==","signatures":[{"sig":"MEUCIBgX9iRiuU/SyOrhe8rJAFUVTBiwiapB1Quc7li6nuK+AiEArK2FGuUhZd9+cskOdRT+KwueFECl+uLaHblaOOPVvMQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":106023},"type":"module","engines":{"node":">=22"},"gitHead":"1ad77935ef964314f2458bed7ae5ea24eed349d4","scripts":{"test":"vitest run","build":"tsc && node build.mjs","prepack":"npm run build","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:b8b8be01-582e-409a-8dce-c5394c87d402"}},"_npmVersion":"11.19.0","description":"Installer for afk.watch integrations - wires Claude Code hooks, Claude/Codex skills, and optional hosted pickup.","directories":{},"_nodeVersion":"22.23.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"yaml":"^2.9.0","vitest":"^4.1.10","typescript":"~6.0.3","@types/node":"^26.1.1"},"_npmOperationalInternal":{"tmp":"tmp/cli_0.5.1_1787603710546_0.1369180393817222","host":"s3://npm-registry-packages-npm-production"}},"0.5.2":{"name":"@afk-watch/cli","version":"0.5.2","license":"MIT","_id":"@afk-watch/cli@0.5.2","maintainers":[{"name":"jofan","email":"stefan.liden@gmail.com"}],"homepage":"https://afk.watch/setup","bin":{"afk":"dist/index.js"},"dist":{"shasum":"fb4e5e3cfe2172e23dcf15ea0fa700bbce8825dd","tarball":"https://registry.npmjs.org/@afk-watch/cli/-/cli-0.5.2.tgz","fileCount":15,"integrity":"sha512-MngkAyqRjhyi0Nf4jpb68xOWMAmMu9SX7iTu8nbVnoR6fx4u/z/5BPWf1kQf9t0oaVdGKskfBEYhMsWACc/Muw==","signatures":[{"sig":"MEUCIQCpu0ZSbYiuJCxDg75XFCRHbcryMPqFEqkPRGSZjBDWoQIgB9pjVh7h51ZeBKJSX/8+8f0/xs60XIdTJchkP6ViYb8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":107136},"type":"module","engines":{"node":">=22"},"gitHead":"cbad56c877f719437536b3e4d318ebfc432f274f","scripts":{"test":"vitest run","build":"tsc && node build.mjs","prepack":"npm run build","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:b8b8be01-582e-409a-8dce-c5394c87d402"}},"_npmVersion":"11.19.0","description":"Installer for afk.watch integrations - wires Claude Code hooks, Claude/Codex skills, and optional hosted pickup.","directories":{},"_nodeVersion":"22.23.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"yaml":"^2.9.0","vitest":"^4.1.10","typescript":"~6.0.3","@types/node":"^26.1.1"},"_npmOperationalInternal":{"tmp":"tmp/cli_0.5.2_1787639906454_0.7433234102449122","host":"s3://npm-registry-packages-npm-production"}},"0.6.0":{"name":"@afk-watch/cli","version":"0.6.0","description":"Installer for afk.watch integrations - wires Claude Code hooks, Claude/Codex skills, and optional hosted pickup.","license":"MIT","homepage":"https://afk.watch/setup","type":"module","bin":{"afk":"dist/index.js"},"engines":{"node":">=22"},"scripts":{"prepack":"npm run build","build":"tsc && node build.mjs","typecheck":"tsc --noEmit","test":"vitest run"},"devDependencies":{"@types/node":"^26.1.1","typescript":"~6.0.3","vitest":"^4.1.10","yaml":"^2.9.0"},"publishConfig":{"access":"public"},"gitHead":"5ebe597a2a8c37153892cd389131ee4cff4bb228","_id":"@afk-watch/cli@0.6.0","_nodeVersion":"22.23.2","_npmVersion":"11.19.0","dist":{"integrity":"sha512-aUAp2vO0pTFYGRz9kvGInFndG5jUNB/zO4qHq+a2YUQih/6cR31xBGLp8xK9QfwRpzCdVJ6kS/uaJYJHeroYDQ==","shasum":"999d57780b9c3e6202c298e7e9cdb9f360daf9cb","tarball":"https://registry.npmjs.org/@afk-watch/cli/-/cli-0.6.0.tgz","fileCount":17,"unpackedSize":114345,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQChy1V0cDHVHQp1bPLprLVzOf8fSR6i1x7azmMmXTMICwIgMO1C/xKX801NghuPYE7wrusqTIShIdK3MgjFJLDizMU="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:b8b8be01-582e-409a-8dce-c5394c87d402"}},"directories":{},"maintainers":[{"name":"jofan","email":"stefan.liden@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cli_0.6.0_1787645937008_0.7081844482895194"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-24T11:43:12.771Z","modified":"2026-08-25T08:18:57.533Z","0.1.0":"2026-07-24T11:43:13.082Z","0.2.0":"2026-08-03T09:18:32.968Z","0.2.1":"2026-08-03T11:49:30.656Z","0.3.0":"2026-08-05T09:17:44.451Z","0.4.0":"2026-08-06T07:22:27.048Z","0.5.0":"2026-08-24T12:54:42.759Z","0.5.1":"2026-08-24T20:35:10.719Z","0.5.2":"2026-08-25T06:38:26.603Z","0.6.0":"2026-08-25T08:18:57.154Z"},"license":"MIT","homepage":"https://afk.watch/setup","description":"Installer for afk.watch integrations - wires Claude Code hooks, Claude/Codex skills, and optional hosted pickup.","maintainers":[{"name":"jofan","email":"stefan.liden@gmail.com"}],"readme":"# @afk-watch/cli\n\nInstaller for the afk.watch agent integrations. It wires the **Claude Code**\nlifecycle hooks (`scripts/afk-hook.mjs`, issue #36), installs the `afk-watch`\nskill for Claude Code and Codex, and can generate the opt-in hosted pickup workflow, so runs show up in the\napp without hand-editing `settings.json`. Every path has a symmetric uninstall. The idempotent\n`settings.json` merge at its core (`src/settings.ts`) is runtime-agnostic and will\nback future runtimes too (issue #35).\n\n## Use\n\n```\nnpx @afk-watch/cli@latest init --key key_live_xxx --test\n```\n\n- Stores the key in `~/.config/afk.watch/config.json`.\n- Installs the hook handler to `~/.config/afk.watch/afk-hook.mjs` and merges the four\n  afk hooks into your Claude Code `settings.json` - idempotently (re-running never\n  duplicates), preserving your existing hooks and settings.\n- Installs the **afk-watch skill** to `~/.claude/skills/afk-watch/` and\n  `~/.agents/skills/afk-watch/`, giving Claude Code `/afk-watch [issue]` and Codex\n  `$afk-watch [issue]`. `--project` puts both copies in the corresponding project\n  directories. A re-run replaces them, so a CLI upgrade cannot leave a stale copy.\n- Checks **issue resolution** in the current repo, by importing the handler it just\n  installed, and prints what a session here would report against - or why it wouldn't\n  be reported at all (you're on `main`, no GitHub remote, …). `--test` proves the key\n  and push delivery; this proves the path a real session takes. See\n  [ADR 0008](../../docs/adr/0008-unresolvable-sessions-surface-locally.md).\n- `--test` fires a confirmation run so your phone lights up right away.\n\nOnce installed, hand the agent an issue directly:\n\n```\n/afk-watch #33     # claim issue 33, work it, report the run\n/afk-watch         # find open `ready-for-agent` issues and claim the oldest\n$afk-watch #33     # the same explicit pickup in Codex\n```\n\nThe skill claims an issue by swapping `ready-for-agent` for `in-progress` **before**\nstarting work, so a second pass can't pick up the same one. That is an advisory lock,\nnot a real one - two runs started in the same moment can still race.\n\n```\nafk uninstall                     # remove the hooks, handler, skill, and key\nafk uninstall --keep-key          # ...but keep the stored key\nafk uninstall --pickup            # ...and remove the generated hosted workflow\n```\n\n### Optional automatic local pickup\n\n`init` installs the skill but cannot create a Claude Desktop scheduled task. Open\nthe repository you want watched in Claude Desktop and say exactly:\n\n> Create a scheduled task named afk.watch pickup that runs /afk-watch every 5 minutes\n> in this folder using auto permission mode.\n\nUse **auto** permission mode: it is the safest unattended mode that can edit files,\nrun commands, commit, and open PRs, while still blocking actions it judges risky.\nDo not use `bypassPermissions`. Pickup works only while Claude Desktop is open and\nthe machine is awake; closing the lid stops it. `/loop` is session-scoped and is not\nthe unattended mechanism.\n\n### Optional automatic hosted pickup\n\nIf pickup must continue while your machine is off, opt in per repository:\n\n```\nnpx @afk-watch/cli@latest init --pickup\n```\n\nRun it from inside the repository. This writes `.github/workflows/afk-pickup.yml` at\nthe **repository root** - the only place GitHub reads workflows from - without\ntouching sibling workflows, and errors out rather than writing anything when there is\nno repository.\n\nThe generated file carries its own `afk-template-version` and an\n`afk-template-sha256` of the rest of its body, which is how the CLI tells its own\noutput from yours. An untouched copy - of any version - is a no-op to re-install, is\nupgraded in place when a newer template ships, and is removed by\n`afk uninstall --pickup`. Edit it and the digest stops matching: from then on neither\ncommand writes or deletes that file. `init` tells you a newer template exists (and\nflags a security-relevant one) so you can merge it yourself; `uninstall` reminds you\nthe file keeps firing on `ready-for-agent` until you delete it. Run from outside a\nrepository, uninstall skips the workflow half with an explanation and still removes\nthe hooks, handler, skill, and stored key.\n\nHosted pickup runs on `ubuntu-latest` and needs two repository Actions secrets:\n`AFK_KEY` and `ANTHROPIC_API_KEY`. A Claude Pro/Max subscription does **not**\nauthenticate hosted CI. Anthropic usage is billed per token in addition to GitHub\nActions minutes. Commit and merge the workflow to the repository's default branch;\nGitHub does not deliver `issues` events to a workflow that exists only on a feature\nbranch. It also needs *Settings > Actions > General > \"Allow GitHub Actions to create\nand approve pull requests\"*, because the runner is deleted when the job ends: the\nworkflow has the agent commit to `afk-pickup/issue-<n>-<run id>-<attempt>` (a fresh\nbranch per run, so it never collides with what an earlier pickup pushed), push, and\nopen a pull request, and verifies that before reporting `done`. Work left\nuncommitted, unpushed, or without an open pull request carrying those exact commits\nfails the run instead of being reported as finished - though a run that pushed its\nwork and then left a stray file behind still names the pull request holding the\ncommits, rather than claiming everything was lost.\n\n**That pull request runs no CI.** GitHub does not fire `pull_request` or `push`\nworkflow runs for anything created with the built-in `GITHUB_TOKEN`, and this path\nkeeps to two secrets - no PAT, no GitHub App - so there is nothing else to open it\nwith. It arrives with no checks on it. The agent has to run the project's own\nvalidation inside the job and report which commands it ran, but that is its word,\nnot a check run: trigger the repository's checks yourself and confirm they pass\nbefore merging. Every report repeats this on the line that names the pull request.\n\nBecause each run has its own branch, a second pickup of an issue whose pull request\nis still open would produce two pull requests for the same work. So it refuses: the\nrun starts nothing, spends no tokens, reports the open pull request's URL, and swaps\n`ready-for-agent` for `in-progress`. Nothing is ever closed, deleted, or\nforce-pushed on your behalf - **you** decide whether that pull request merges or\ncloses, and re-applying `ready-for-agent` afterwards picks the issue up again.\n\nHosted pickup is opt-in because of that billing and secret setup; plain `init` keeps\nthe local/manual paths only. It requires CLI 0.4.0 or newer.\n\n**Issue text is agent instructions.** The agent is handed the issue text and runs\nunattended with a token that can write contents, issues, and pull requests. Event\nfields never reach a shell command, but nothing stops issue *prose* from steering an\nagent asked to follow it. So the workflow picks up an issue only when GitHub reports\nits author's `author_association` as `OWNER`, `MEMBER`, or `COLLABORATOR`.\n\nOnly the title and body from that gated event reach the agent, and it is told not to\nfetch or obey issue comments, other issues, or reviews. **Comments are not trusted\npickup input** - anyone can comment on an admitted issue whatever their association,\nso a thread-reading agent would take instructions from exactly the people the gate\nexcludes. Put what you want done in the issue body before you tap.\n\nThat is the relationship GitHub declares in the event payload, **not** a check that\nthe author has write access here: `MEMBER` means a member of the owning organization,\nwhich in an org whose base permission is Read (the default) includes people with no\nwrite access to this repository, and `COLLABORATOR` covers read-only invitees. It\nnarrows pickup to people already inside your org or repo; it does not verify they\ncould push the change themselves.\n\nEverything else is excluded - `CONTRIBUTOR`, `FIRST_TIME_CONTRIBUTOR`, and `NONE`,\nand `NONE` is also what GitHub reports for issues filed by a GitHub App or bot, so\nautomated backlog items are never picked up either. In every excluded case the label\nstays on and you work it by hand (locally with `/afk-watch`, or by re-filing it in\nyour own words). Residual risk stands for everyone the gate admits: they can steer\nthe agent through issue text.\n\nIf setup fails before the afk.watch run is created (a missing secret, an unreachable\nAPI), the `ready-for-agent` label is left in place, so a tap from the phone is never\nsilently swallowed.\n\n### Options\n\n| | |\n|---|---|\n| `--key <key>` | your API key (or set `AFK_KEY`). Prompted on a terminal if omitted. |\n| `--global` | write to `~/.claude/settings.json` (default; applies everywhere). |\n| `--project` | write to `./.claude/settings.json` (this repo only). |\n| `--test` | fire a post-install confirmation run. |\n| `--pickup` | install or upgrade the opt-in hosted Actions workflow in this repository; with `uninstall`, remove it. Either way, a file you edited is left alone. |\n| `--api <url>` | API base (default `https://api.afk.watch/v1`). |\n| `--agent <name>` | agent label shown on runs (default `claude-code`). |\n| `-y, --yes` | don't prompt; use flags/env and defaults. |\n\nThe curl form (served from the API origin) just runs this CLI:\n\n```\ncurl -fsSL https://afk.watch/install.sh | AFK_KEY=key_live_xxx sh\n```\n\n## Develop\n\n```\nnpm run build      # tsc → dist/, bundle the hook, skill, hosted workflow, and shebang\nnpm test           # vitest (pure merge, config, init/uninstall, arg parsing,\n                   #   the hook handler end to end - src/hook.test.ts, and\n                   #   what the tarball ships - src/packaging.test.ts, which\n                   #   packs the package, so it is the slow one)\nnpm run typecheck\n```\n\nEditing `templates/afk-pickup.yml` invalidates the `# afk-template-sha256:` line in\nits own header, which is what marks a generated file as ours. `npm test` fails with\nthe replacement line printed in full - paste it over the old one. Bump\n`# afk-template-version:` in the same edit whenever the change ships to users, so an\ninstalled copy can say which version it came from.\n\nUnlike the rest of the workspace (consumed as TS source by bundler-aware tools), this\npackage is executed by the end user's Node, so it builds to plain ESM with NodeNext\nresolution and explicit `.js` import extensions. See\n[`docs/adr/0004-cli-installer-distribution.md`](../../docs/adr/0004-cli-installer-distribution.md).\n","readmeFilename":"README.md"}