# Installation and CLI

Requires Node.js 20+. The executable is `bin/agenticpad.cjs` relative to the package root. A normal npm install also exposes `agenticpad`. The Skill entry is `skill/agenticpad/SKILL.md` in the same package. Follow that Skill for operation-specific inputs and official wallet signing requirements.

## Install

Download the complete kit and configure your runtime with [website installation](/skill.md#website-installation). Executable paths refer to the installed local package.

From a full source checkout containing lock files:

```sh
npm ci --ignore-scripts --legacy-peer-deps
```

Or install the provided tarball in a new directory:

```sh
mkdir agenticpad-client
cd agenticpad-client
npm init -y
npm install --ignore-scripts --legacy-peer-deps /absolute/agenticpad-kit-0.2.3.tgz
node node_modules/agenticpad-kit/bin/agenticpad.cjs inspect identity --config /absolute/deployment.json
```

Use `node_modules/agenticpad-kit/skill/agenticpad/SKILL.md` as the Skill entry. If your Agent requires its Skills in a separate directory, copy the whole `skill/agenticpad/` folder, then retain the installed package root as the executable/config reference; its relative setup link assumes the original bundled location.

The tarball contains `npm-shrinkwrap.json`, which pins the dependency tree. npm excludes `package-lock.json` from tarballs. To install into an extracted archive rather than as a dependency:

```sh
mkdir extracted-kit
tar -xzf /absolute/agenticpad-kit-0.2.3.tgz -C extracted-kit
cd extracted-kit/package
npm ci --ignore-scripts --legacy-peer-deps
```

No Solidity compiler or protocol source workspace is required. Project introductions do not require a wallet login.

## Official wallet readiness

- **Wallet ready:** If the official Binance Agentic Wallet Skill and `baw` CLI are installed, you are logged in with Developer Mode enabled, and the wallet has an eligible Agent ID and BNB for fees and the intended operation, continue to the configuration below.
- **Wallet setup needed:** Read the [official Binance Agentic Wallet Skill](https://github.com/binance/binance-skills-hub/blob/main/skills/binance-web3/binance-agentic-wallet/SKILL.md) and follow its current installation, login and Developer Mode steps. Prepare an eligible Agent ID and BNB, then return here. Install the [complete official Skill directory](https://github.com/binance/binance-skills-hub/tree/main/skills/binance-web3/binance-agentic-wallet) with its references; a standalone `SKILL.md` download is incomplete.

Follow existing user authorization and the official Skill's signing requirements. Keep credentials in the wallet; never provide a private key to AgenticPad.

## Config and local files

Copy `config/production.example.json` into your runtime directory. It contains the official BSC mainnet deployment addresses and uses chain ID 56. Set the RPC if needed; its chain ID must match the config and deployment. Mainnet contracts are deployed, and AGENTIC has been issued and bound to the Vault. AGENTIC CA: `0xd1Ab31ebeDCB6177E17891d7CE3331E61D5c15bC`. Read the current contract opening state before use; `prepare launch` checks the launch gate, wallet whitelist and configuration. The approved defaults are a 0.001 BNB launch fee, initial tick -191200, 1 billion token supply and a 10 BNB graduation threshold.

Use `wallet.type:"baw"` for production. Optional `wallet.address` verifies the connected wallet. Set `wallet.stateFile` to an absolute runtime path so all resumptions use the same journal.

For local testing, use a supplied completed test config based on `config/local.example.json`. Local mode requires a loopback RPC and `wallet.type:"local"`. Supply the test key through the environment variable named in `wallet.privateKeyEnv` (default `AGENT_KIT_PRIVATE_KEY`). Do not put keys into configs, input files, or a release package.

For BSC public testnet, use `config/testnet.example.json`, `mode:"testnet"`, `chainId:97`, and `wallet.type:"testnet"`. A dedicated test-only `AGENT_KIT_TESTNET_*` key environment variable is required. See [TESTNET.md](TESTNET.md) for setup and asynchronous confirmation. The operator supplies the testnet deployment manifest; the bundled template has no public testnet addresses. Real baw signing remains the mainnet path.

Keep each operation JSON and wallet journal until the workflow settles. Commands print JSON to stdout; errors print `{error,code}` to stderr and exit nonzero. CLI state changes update the same operation file atomically. Run one command per operation at a time.

## Commands

The examples below run from the package root. All flags take a value.

```sh
node bin/agenticpad.cjs inspect identity --config /absolute/deployment.json
node bin/agenticpad.cjs prepare launch --config /absolute/deployment.json --input /absolute/launch.json --out /absolute/launch.operation.json
node bin/agenticpad.cjs preview --config /absolute/deployment.json --operation /absolute/launch.operation.json
node bin/agenticpad.cjs execute --config /absolute/deployment.json --operation /absolute/launch.operation.json
node bin/agenticpad.cjs status --config /absolute/deployment.json --operation /absolute/launch.operation.json
```

Prepare actions: `launch`, `buy`, `sell`, `lp-add`, `lp-increase`, `lp-remove`, `lp-collect`, `creator-claim`. Inspect kinds: `identity`, `token`, `positions`, `creator`; use `--input FILE` for their inputs. Minimal `launch.json` is `{"name":"Example Agent","symbol":"EXA"}`. `inspect token` also returns `poolState` (ordering, decimals, tick, tick spacing, square-root price) and `balances` (raw connected-wallet project token/WBNB balances), so trading and LP preparation do not require custom ABI reads.

Token inspection and buy quotes include `fairLaunch`: active status, end block, cumulative buy limit, used amount and remaining raw token allowance. During the 192,000-block opening period, ordinary pool buys share a cumulative 0.2% supply allowance per wallet and token; selling or transferring does not restore it. The Creator's launch-transaction first buy has a separate 2% hard cap. The kit rejects an over-limit quote before wrap/approve steps. It does not trim budgets. Recommended budgets are 0.1 BNB Creator first buy, 0.01 BNB ordinary buy, or 0.001 BNB small buy, subject to quote and allowance. Amounts require user intent or an authorized strategy; omitted first buy remains zero. Launch fee is 0.001 BNB, so a 0.1 BNB first buy requires 0.101 BNB transaction value plus gas.

`prepare` reads and quotes without submission. `preview` simulates and obtains the current step's wallet preview. `execute` processes one step; repeat preview/execute only after the previous step confirms. Success is top-level `status:"completed"`, with receipt-derived `result`. Quote amounts are estimates and use raw integer strings. See the Skill references for exact input fields and result interpretation.

For a baw App order with `orderId` and no hash, preserve the operation. Obtain the hash from that exact App order and run:

```sh
node bin/agenticpad.cjs resolve --config /absolute/deployment.json --operation /absolute/launch.operation.json --hash 0xACTUAL_TRANSACTION_HASH
```

Continue with status, then the next step. Pending or unknown submissions must not be resent. Read [wallet recovery](../skill/agenticpad/references/wallet.md) for the exact limits and next actions.

## Node API

```js
const { createClient } = require('agenticpad-kit');
const fs = require('node:fs');
const config = JSON.parse(fs.readFileSync('/absolute/deployment.json', 'utf8'));
const file = '/absolute/launch.operation.json';
const persist = op => fs.writeFileSync(file, JSON.stringify(op, null, 2));
const client = createClient(config, { persist });
async function prepare() {
  const op = await client.prepare('launch', { name: 'Example Agent', symbol: 'EXA' });
  persist(op);
  return op;
}
```

Available methods: `inspect(kind,input)`, `prepare(action,input)`, `preview(op)`, `execute(op)`, `status(op)`, `resolve(op,hash)`. Persist the returned/mutated operation after each call, including on errors; the `persist` callback saves before a possible broadcast and immediately after a transaction hash is received. Prefer the CLI for its atomic operation save and locking. The API does not grant signing authorization; review and authorize each necessary step under the official wallet flow.
