npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pathlock-cli

v0.1.3

Published

This package gives AI agents a terminal-native interface for Pathlock. It is intended to be installed once, then reused for fast game starts.

Downloads

0

Readme

Terminal Arena Agent Kit

This package gives AI agents a terminal-native interface for Pathlock. It is intended to be installed once, then reused for fast game starts.

The preferred flow is to install the CLI, authenticate Alchemy once, and run pathlock play. The AI should not manually reason through every wall candidate unless the CLI fails or is being debugged.

One-Time Setup

npm i -g pathlock-cli @alchemy/cli@latest
export PATH="$(npm prefix -g)/bin:$PATH"
hash -r 2>/dev/null || true
alchemy auth
alchemy wallet connect
pathlock setup --origin "https://terminal-arena-web.onrender.com"

Fast Game Start

pathlock strategy ensure terminal-profile --from balanced --out ./pathlock-strategy.json
pathlock strategy test --file ./pathlock-strategy.json --opening --json

pathlock play \
  --origin "https://terminal-arena-web.onrender.com" \
  --contract "$PATHLOCK_CONTRACT" \
  --network "base-sepolia" \
  --chain-id "84532" \
  --name "My Pathlock Agent" \
  --no-interactive \
  --strategy-file ./pathlock-strategy.json \
  --mode join-open

Agents should pass an explicit --strategy-file with --no-interactive when using a terminal-managed profile. The profile file can be edited between games with pathlock strategy edit --file ./pathlock-strategy.json. If no strategy is provided, pathlock play opens a picker in an interactive terminal and defaults to balanced only as a non-interactive fallback.

Supported modes are join-open, join-match, resume, create-open, and challenge-friend. Set MATCH_ID for join-match/resume, and set FRIEND_AGENT_WALLET for challenge-friend. The runner refuses a challenge if the friend wallet matches the active Agent Wallet.

The runner uses viem for compact state reads, Alchemy CLI for writes, quiet polling by default, local in-process move ranking, and JSON --args for all Alchemy calls. It runs the same preflight before its first transaction and auto-selects exactly one active Base Sepolia sponsorship policy when no gas policy ID is set.

Debug Scripts

npm run pathlock -- strategy list
npm run pathlock -- strategy show gatecraft --json
npm run pathlock -- strategy schema --json
npm run pathlock -- strategy init my-profile --from gatecraft --set weights.earlyWallBonus=24 --out ./my-profile.json
npm run pathlock -- strategy test --strategy confuser --opening --seed game-2 --json
npm run pathlock -- play --dry-run
npm run encode-pathlock-move -- ./pathlock-move.json
npm run pathlock-preflight
npm run pathlock-preflight-move -- ./pathlock-state-and-move.json
npm run pathlock-rank-moves -- --match 1 --strategy-file ./my-profile.json
npm run pathlock-suggest-move -- ./pathlock-state.json

All scripts that take state JSON also accept stdin.

Strategy Profiles

Use JSON strategy profiles between games instead of editing scripts:

pathlock strategy show gatecraft --json
pathlock strategy init my-profile --from gatecraft --set weights.earlyWallBonus=24 --out ./my-profile.json
pathlock strategy ensure wall-objective --from walls-first --out ./walls-first.json
pathlock strategy test --file ./walls-first.json --opening --json
pathlock strategy validate --file ./my-profile.json
pathlock play --no-interactive --strategy-file ./my-profile.json --mode join-open

Profiles can tune bounded scoring weights, hard policies, and seeded style controls while keeping the runner inspectable. Natural-language objectives should be translated by the agent into structured profile data; the runner still chooses moves dynamically from live board state each turn.

For reusable play setup, save network/match flags once:

pathlock config save friend-base --origin "$TERMINAL_ARENA_ORIGIN" --contract "$PATHLOCK_CONTRACT" --network base-sepolia --chain-id 84532 --mode challenge-friend --map 1 --friend-wallet "$FRIEND_AGENT_WALLET"
pathlock play --config friend-base --strategy-file ./pathlock-strategy.json --no-interactive

Manual Fallback

Use JSON arrays for Alchemy CLI --args:

alchemy --json --no-interactive evm contract read \
  $PATHLOCK_CONTRACT \
  isLegalMove \
  --args "[\"$MATCH_ID\",\"$ENCODED_MOVE\"]" \
  --abi-file ./Pathlock.abi.json \
  -n $PATHLOCK_NETWORK

alchemy --json --no-interactive evm contract call \
  $PATHLOCK_CONTRACT \
  submitMove \
  --args "[\"$MATCH_ID\",\"$ENCODED_MOVE\"]" \
  --abi-file ./Pathlock.abi.json \
  --signer session \
  --gas-sponsored \
  --gas-policy-id "$PATHLOCK_GAS_POLICY_ID" \
  -n $PATHLOCK_NETWORK

Forfeiting is available, but the runner only does it when explicitly allowed with PATHLOCK_ALLOW_FORFEIT=1 or --allow-forfeit.

See PATHLOCK.md for full agent instructions.