Loading...
Loading...
Lets an AI agent or CLI session sign in to Internet Identity and act as a user's app-specific principal (e.g. for oisy.com or nns.ic0.app) via `icp identity link web`. Use when the user asks an agent to log in to an II-powered app, obtain a delegation, or make authorized canister calls on their behalf. Do NOT use for adding II sign-in to a frontend — use the user-sign-in skill instead.
npx skill4agent add dfinity/icskills agent-web-identityicp identity link web--app <domain>icpicp-cliPress Enter to log in at https://id.ai/cliprintf '\n' | icp identity link web .../dev/nullPress Enter to log inicp identity link webicp--identity <NAME>icp identity listicp identity list<agent>-<app>-<YYYYMMDD-HHMM>claude-oisy-20260611-1530cursor-oisy-...agent-icp identity list$NAME--appicp identity listreauthicp identity listclaude-oisy-*icp identity delete <NAME>--app--app--app oisy.comicp identity link web--ttlicp identity reauth <NAME>icp canister callDo you want to send this message? [y/N]User cancelled.'()'whoami<APP_DOMAIN>oisy.comnns.ic0.app# 1. Pick a fresh name (never reuse an existing identity, even one
# already linked for this app); confirm it doesn't exist
icp identity list
NAME="agent-<app>-$(date +%Y%m%d-%H%M)"
# substitute your own agent prefix for "agent" if known,
# e.g. claude-oisy-20260611-1530, cursor-oisy-...
# 2. Start the link flow IN THE BACKGROUND (keeps the localhost
# listener alive while the user signs in). Use your harness's
# background-execution mode if it has one; in a plain shell:
printf '\n' | icp identity link web "$NAME" --app <APP_DOMAIN> \
> "/tmp/icp-link-$NAME.log" 2>&1 &
# Pipe a real newline to answer the "Press Enter to log in" prompt.
# Do NOT use `< /dev/null`: on 0.3.2 a bare EOF does not satisfy the
# prompt, so the command hangs and you'd have to restart it — which
# prompts the user a second time. The newline starts the flow on the
# first try.
# 3. Read the command's output (the log file above). After the Enter
# prompt it tries to open the user's browser; if a sign-in URL is
# printed instead, relay it to the user. Wait for them to confirm
# sign-in (first run may require enabling CLI access in II settings
# — restart from step 2 if so)
# 4. Confirm the identity was created
icp identity listicp canister call --identity "$NAME" --network ic \
ivcos-eqaaa-aaaab-qablq-cai whoami '()'icp canister call --help--identity'()'<APP_DOMAIN>icp-cliICP_HOMEclaude-oisy-<short-id>icp-cliicp identity delete <NAME>deleteremoveicp identity listclaude-oisy-*icp identity delete <NAME>