Skip to content

Commit bc3a5ec

Browse files
Release v1.14.0
Origin-SHA: 107e75094781b71b7e6f09aa565dc975e8e34e41 Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent e196185 commit bc3a5ec

16 files changed

Lines changed: 714 additions & 212 deletions

.agents/rules.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ CI runs `pnpm check-api-paths` on every PR; it fails if `src/sdk.ts` or `src/com
8080
Each domain has both a CLI command file (`src/commands/<domain>.ts`) and an SDK class (`src/sdk.ts`):
8181

8282
- **accounts** - Account profile lookup
83+
- **api** - Low-level escape hatch to call any OpenSea API v2 endpoint (CLI only — no SDK class)
8384
- **assets** - Asset movement transactions (transfers)
8485
- **auth** - SIWE login and scoped token management (`login`, `status`, `refresh`, `revoke`, `tokens`, `scopes`, `clear`) plus API key requests (`request-key`)
8586
- **chains** - Chain information and supported networks

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# @opensea/cli
22

3+
## 1.14.0
4+
5+
### Minor Changes
6+
7+
- 66396b6: Add `--private-key` support to `opensea login` for SIWE authentication, enabling server-side agents to log in without a browser.
8+
9+
### Patch Changes
10+
11+
- Updated dependencies [66396b6]
12+
- Updated dependencies [fa2a24e]
13+
- Updated dependencies [333104e]
14+
- Updated dependencies [d7a44df]
15+
- @opensea/api-types@0.8.1
16+
- @opensea/sdk@11.4.8
17+
318
## 1.13.2
419

520
### Patch Changes

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,13 @@ opensea whoami
6060
opensea api request GET /api/v2/account/0xYOUR_WALLET/favorites --params '{"limit":1}'
6161
```
6262

63-
Use `--scopes` with `opensea login` to request a narrower scope set. The `api
64-
request` command supports GET, POST, PUT, PATCH, and DELETE plus JSON body files,
65-
so newly published scoped endpoints are available without waiting for a dedicated
66-
command.
63+
Use `--scopes` with `opensea login` to request a narrower scope set. For
64+
server-side agents, set `OPENSEA_PRIVATE_KEY` and pass `--private-key` (or pass
65+
`--private-key <key>`) to authenticate with SIWE instead of OAuth. Using the
66+
environment variable is recommended to keep the key out of shell history. The
67+
`api request` command supports GET, POST, PUT, PATCH, and DELETE plus JSON body
68+
files, so newly published scoped endpoints are available without waiting for a
69+
dedicated command.
6770

6871
## Quick Start
6972

biome.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"**/*.json",
1313
"!**/.claude",
1414
"!**/typechain",
15+
"!lib",
1516
"!**/dist",
1617
"!**/coverage",
1718
"!**/.vercel",

docs/cli-reference.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,22 @@ expiry. Use `opensea whoami --diagnostic` to inspect decoded JWT claims and
2525
scope differences. Those claims are unverified, provider-specific diagnostics
2626
only and never authorization data.
2727

28+
## Login
29+
30+
```bash
31+
opensea login [--scopes <scopes>] [--client-id <id>] [--device] [--no-browser]
32+
opensea login --private-key [--scopes <scopes>]
33+
opensea login --private-key <key> [--scopes <scopes>]
34+
```
35+
36+
`login` obtains a scoped access token and stores it in `~/.opensea/auth.json`.
37+
By default it runs the OAuth 2.1 authorization-code flow in a browser. Use
38+
`--device` for headless environments or `--no-browser` to print the authorization
39+
URL. Pass `--private-key` to authenticate with SIWE instead of OAuth, which is
40+
useful for server-side agents. Set `OPENSEA_PRIVATE_KEY` and use `--private-key`
41+
without a value to keep the key out of shell history; a raw key can be passed as
42+
an option value when necessary.
43+
2844
## Collections
2945

3046
```bash

package-lock.json

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@opensea/cli",
3-
"version": "1.13.2",
3+
"version": "1.14.0",
44
"type": "module",
55
"description": "OpenSea CLI - Query the OpenSea API from the command line or programmatically",
66
"main": "dist/index.js",
@@ -23,8 +23,8 @@
2323
"prepublishOnly": "npm run build"
2424
},
2525
"dependencies": {
26-
"@opensea/api-types": "^0.8.0",
27-
"@opensea/sdk": "^11.4.7",
26+
"@opensea/api-types": "^0.8.1",
27+
"@opensea/sdk": "^11.4.8",
2828
"@opensea/wallet-adapters": "^0.3.3",
2929
"commander": "^14.0.3",
3030
"zod": "^4.3.6"

src/auth/private-key.ts

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/**
2+
* Resolve the private key to use for SIWE login.
3+
*
4+
* `--private-key` is intentionally an optional-value option. Passing it
5+
* without a value reads `OPENSEA_PRIVATE_KEY`; passing it with a value
6+
* should only be used in scripted/automated contexts because command-line
7+
* arguments can leak into shell history and process listings.
8+
*/
9+
export function resolvePrivateKey(optionValue: string | true | undefined): {
10+
privateKey: string
11+
source: "argument" | "environment"
12+
} {
13+
if (typeof optionValue === "string") {
14+
return { privateKey: optionValue, source: "argument" }
15+
}
16+
17+
const envValue = process.env.OPENSEA_PRIVATE_KEY
18+
if (envValue) {
19+
return { privateKey: envValue, source: "environment" }
20+
}
21+
22+
throw new Error(
23+
"Private key required. Set OPENSEA_PRIVATE_KEY or pass --private-key <key>.",
24+
)
25+
}
26+
27+
/**
28+
* Emit a stderr warning when a private key was passed as an inline command
29+
* argument, so users are nudged toward the environment variable.
30+
*/
31+
export function warnIfInlinePrivateKey(
32+
source: "argument" | "environment",
33+
): void {
34+
if (source === "argument") {
35+
console.error(
36+
"Warning: passing a private key as a command-line argument is insecure " +
37+
"and may be recorded in shell history or visible to other users via ps. " +
38+
"Prefer setting OPENSEA_PRIVATE_KEY and passing --private-key without a value.",
39+
)
40+
}
41+
}

0 commit comments

Comments
 (0)