@blockmind/cli
v0.4.0
Published
Typed CLI and API client for BlockMind
Readme
@blockmind/cli
Typed CLI and API client for BlockMind.
Install
npm i -g @blockmind/cliSetup
- Get an API key from your BlockMind account settings
- Set the environment variable:
export BLOCKMIND_API_KEY=your_api_key_hereOptionally set a custom API base URL (defaults to http://blockmind.localhost:1355):
export BLOCKMIND_API_BASE_URL=https://www.blockmind.appCLI Usage
# Check API connectivity
blockmind health
# Auto-discovered commands from agent OpenAPI operation IDs
blockmind portfolio list
blockmind positions list --portfolio-id <uuid>
blockmind market prices --limit 25 --format table
# Generic fallback by operationId
blockmind call portfolio_snapshot '{"portfolioId":"<uuid>"}'Programmatic Usage
import { BlockMindClient } from '@blockmind/cli'
const client = new BlockMindClient({
apiKey: process.env.BLOCKMIND_API_KEY,
baseUrl: 'https://www.blockmind.app',
})
// Methods are auto-discovered from the OpenAPI spec.
// Input/output types will be fully typed once the Agent API
// routes add .describe() schemas (tracked separately).
const portfolios = await client.portfolioList()
const snapshot = await client.portfolioSnapshot({
portfolioId: '<uuid>',
})Publishing
Releases are automated via GitHub Actions. To publish a new version:
cd packages/cli
# Bump version and create a cli-prefixed tag
VERSION=$(npm version patch | sed 's/^v//') # or minor, major
git tag -d "v${VERSION}" 2>/dev/null # remove npm's default tag
git tag "cli-v${VERSION}"
# Push commit + tag
git push origin HEAD --follow-tagsLicense
MIT
