open-index/open-npm huggingface dataset:
npm package: @privy-io/agent-wallet-cli
Description: CLI for AI agents to create Privy wallets and transact
Author: privy.io
Latest version: 0.2.3

# @privy-io/agent-wallet-cli

CLI for AI agents to create Privy wallets and transact.

## Installation

```bash
pnpm add -g @privy-io/agent-wallet-cli
```

## Usage

```bash
privy-agent-wallet login                  # Log in and provision a wallet
privy-agent-wallet logout                 # Log out and clear local session
privy-agent-wallet list-wallets           # List your wallets
privy-agent-wallet rpc --json '<body>'    # Send a wallet RPC request
privy-agent-wallet fund                   # Fund a wallet via onramp
```

### Authentication

The CLI authenticates via a browser-based Privy login flow. Run `privy-agent-wallet login` to open a browser window, sign in, and paste the credentials blob back into the CLI. The session is stored in the system keychain (macOS/Linux) or `~/.privy/session.json`.

```bash
privy-agent-wallet login
# Opens browser → sign in → paste credentials → session saved
```

### Wallet operations

After logging in, the CLI can manage wallets and send transactions:

```bash
# List your wallets
privy-agent-wallet list-wallets

# Send a transaction (Ethereum)
privy-agent-wallet rpc --json '{"method": "eth_sendTransaction", "params": {"transaction": {"to": "0x...", "value": 1000000000000000, "chainId": 8453}}}'

# Sign a message
privy-agent-wallet rpc --json '{"method": "personal_sign", "params": {"message": "hello"}}'

# Fund a wallet
privy-agent-wallet fund
```

## Global options

| Flag              | Description                   |
| ----------------- | ----------------------------- |
| `--api-url <url>` | Override the agent server URL |
| `-V, --version`   | Print version                 |
| `-h, --help`      | Print help                    |

The agent server URL can also be set via the `PRIVY_AGENT_URL` environment variable.

## Local development

### Build the CLI

```bash
# From the repo root
pnpm turbo run build --filter=@privy-io/agent-wallet-cli
```

### Run against a local agent server

Start the agent server (see `apps/agent-server/SETUP.md`), then use the `--local` flag:

```bash
node dist/index.js --local login
node dist/index.js --local list-wallets
```

Or use the convenience script:

```bash
pnpm dev:local -- list-wallets
```

### Watch mode

Rebuild on file changes during development:

```bash
pnpm dev
```

### Type checking

```bash
pnpm check-types
```

## Session storage

The CLI stores its session in the system keychain (macOS/Linux) with a file fallback at `~/.privy/session.json` (`0600` permissions). The session contains the signing keypair, wallet IDs, and addresses.

Run `privy-agent-wallet logout` to clear the session from both keychain and file.

## Agent detection

The CLI automatically detects the calling environment (Cursor, Claude Code, terminal, etc.) and sends a `privy-cli-client` header to the agent server for analytics. This is based on environment variable sniffing and requires no configuration.
npm package: @privy-io/cross-app-connect
Description: Privy cross app wallet connectors for wagmi and RainbowKit
Author: privy.io
Latest version: 0.5.6

# @privy-io/cross-app-connect

Privy cross-app wallet connectors for wagmi and RainbowKit

## Installation

```sh
pnpm install -S @privy-io/cross-app-connect wagmi viem @rainbow-me/rainbowkit
```

## Usage

```ts
import {toPrivyWallet} from '@privy-io/cross-app-connect/rainbow-kit';

import {connectorsForWallets, ConnectButton} from "@rainbow-me/rainbowkit";
import {QueryClient, QueryClientProvider} from '@tanstack/react-query';
import {WagmiProvider, createConfig, http} from 'wagmi';
import {mainnet} from 'wagmi/chains';

const privyWallet = toPrivyWallet({
  id: <privy-wallet-app-id>,
  name: 'Privy wallet app',
  iconUrl: 'https://example.com/image.png',
})

const connectors = connectorsForWallets(
  [
    {
      groupName: "Privy",
      wallets: [privyWallet],
    },
  ],
  {
    appName: "Privy",
    projectId: "Example",
  }
);

export const wagmiConfig = createConfig({
  chains: [mainnet],
  transports: {
    [mainnet.id]: http(),
  },
  connectors,
  ssr: true,
});

const queryClient = new QueryClient();

export default function App({children}: {children: React.ReactNode}) {
  return (
    <WagmiProvider config={wagmiConfig}>
      <QueryClientProvider client={queryClient}>
        <RainbowKitProvider>
          <ConnectButton />
        </RainbowKitProvider>
      </QueryClientProvider>
    </WagmiProvider>
  );
}
```