cdp-docs-cli
Version:
CLI tool to set up CDP (Coinbase Developer Platform) documentation and integration in your project
222 lines (165 loc) ⢠5.86 kB
Markdown
# š CDP Docs CLI
A CLI tool to quickly set up Coinbase Developer Platform (CDP) documentation and integration in your Node.js projects.
## š¦ Installation
### Global Installation (Recommended)
```bash
npm install -g cdp-docs-cli
```
### Using npx (No Installation Required)
```bash
# Install globally first, then use commands
npm install -g cdp-docs-cli
cdp-setup
```
## šÆ What This Package Does
When you install and run this CLI tool, it will:
1. **š Create Documentation Structure**: Sets up a `/doc/cdp/` directory in your project
2. **š Copy Documentation**: Adds comprehensive CDP wallet API documentation
3. **š§ Integration Guides**: Provides step-by-step setup and integration guides
4. **š¦ Install Dependencies**: Optionally installs required CDP packages
5. **š Environment Setup**: Creates environment file templates with CDP credentials
## š Quick Start
### Interactive Setup (Recommended)
```bash
# Install globally first
npm install -g cdp-docs-cli
# Then run interactive setup
cdp-setup
```
This will guide you through:
- Setting up documentation
- Installing CDP dependencies
- Creating environment templates
- Configuring your project
### Manual Setup
```bash
# Install globally first
npm install -g cdp-docs-cli
# Setup documentation only
cdp-docs setup
# List available documentation
cdp-docs list
# Setup with custom path
cdp-docs setup --path ./docs/coinbase
# Force overwrite existing files
cdp-docs setup --force
```
## š Generated Directory Structure
After running the setup, your project will have:
```
your-project/
āāā doc/
ā āāā cdp/
ā āāā wallet/ # Wallet API documentation
ā ā āāā wallet-start.md
ā ā āāā fund.md
ā ā āāā transfer.md
ā ā āāā managing-accounts.md
ā ā āāā policies.md
ā ā āāā importing.md
ā ā āāā exporting.md
ā ā āāā wallet-accounts.md
ā āāā integration/ # Integration guides
ā ā āāā SETUP-CDP-WALLET.md
ā ā āāā INTEGRATION-SUMMARY.md
ā ā āāā cdp-wallet.md
ā ā āāā context.md
ā ā āāā directory.md
ā āāā examples/ # Code examples (future)
āāā .env.local.example # Environment template
āāā package.json # Updated with CDP dependencies
```
## š§ Dependencies Installed
The CLI will optionally install these packages:
### Runtime Dependencies
- `@coinbase/cdp-sdk` - Official Coinbase Developer Platform SDK
- `dotenv` - Environment variable management
- `viem` - Ethereum interaction library
### Dev Dependencies
- `@types/node` - Node.js TypeScript definitions
## š Environment Setup
The tool creates a `.env.local.example` file with the required CDP configuration:
```bash
# CDP (Coinbase Developer Platform) Configuration
# Get these values from https://portal.cdp.coinbase.com/
# Your CDP API credentials
CDP_API_KEY_ID=your_actual_key_id_here
CDP_API_KEY_SECRET=your_actual_key_secret_here
CDP_WALLET_SECRET=your_actual_wallet_secret_here
# Network configuration (optional)
# CDP_NETWORK_ID=base-sepolia # Use base-sepolia for testing, base-mainnet for production
```
## š Available Commands
### `cdp-docs`
Main documentation management command:
```bash
cdp-docs setup [options] # Setup CDP documentation
cdp-docs list # List available documentation
cdp-docs --help # Show help
```
#### Options:
- `-f, --force` - Overwrite existing files
- `-p, --path <path>` - Custom documentation path (default: ./doc/cdp)
### `cdp-setup`
Interactive setup wizard:
```bash
cdp-setup # Run interactive setup
```
## šļø Integration Guide
After running the setup:
1. **Get CDP Credentials**:
- Visit [https://portal.cdp.coinbase.com/](https://portal.cdp.coinbase.com/)
- Create API keys and wallet secret
2. **Configure Environment**:
```bash
cp .env.local.example .env.local
# Edit .env.local with your actual credentials
```
3. **Review Documentation**:
- Read `./doc/cdp/integration/SETUP-CDP-WALLET.md`
- Follow `./doc/cdp/integration/INTEGRATION-SUMMARY.md`
4. **Start Building**:
- Use the wallet API documentation in `./doc/cdp/wallet/`
- Implement CDP features in your application
## š Features
### š Comprehensive Documentation
- Complete wallet API v2 documentation
- Step-by-step integration guides
- Security best practices
- Troubleshooting guides
### š ļø Developer Experience
- Interactive CLI setup
- Automatic dependency management
- Environment template generation
- Force overwrite options
### š Security First
- Environment variable management
- Private key handling best practices
- Testnet-first development approach
### š Multi-Network Support
Documentation covers:
- **Base** (Layer 2 Ethereum)
- **Ethereum** (Mainnet & Testnets)
- **Solana** (Mainnet & Devnet)
## š Requirements
- **Node.js**: 16.0.0 or higher
- **npm**: 7.0.0 or higher
- **Operating System**: macOS, Linux, Windows
## š¤ Contributing
This package is maintained by [must-be-ash](https://github.com/must-be-ash).
## š License
MIT
## š Support
- **NPM Package**: [https://www.npmjs.com/package/cdp-docs-cli](https://www.npmjs.com/package/cdp-docs-cli)
- **CDP Documentation**: [https://docs.cdp.coinbase.com/](https://docs.cdp.coinbase.com/)
- **Base Network**: [https://base.org/](https://base.org/)
- **Issues**: [GitHub Issues](https://github.com/must-be-ash/cdp-docs-cli/issues)
## š Version History
### 1.0.0
- Initial release
- CDP documentation setup
- Interactive CLI
- Dependency management
- Environment templates
---
**Built with ā¤ļø for the CDP developer community**