netpad-cli
v0.8.0
Published
NetPad CLI for plugin management, workflows, and more.
Maintainers
Readme
NetPad CLI 🚀
A professional CLI tool for managing NetPad plugins, workflows, and more.
Features
- 🔌 Plugin Management - Create, publish, and list NetPad plugins
- 🔐 Authentication - OAuth2 device code flow with Google/GitHub
- 📦 Scaffolding - Multiple plugin templates (basic, API, database, transformer)
- ✅ Validation - Comprehensive plugin validation and testing
- 🌐 Multi-Instance - Support for SaaS and self-hosted NetPad instances
Installation
# Install globally via npm
npm install -g netpad-cli
# Verify installation
netpad-cli --versionQuick Start
# Authenticate with NetPad
netpad-cli login --google
# Create a new plugin
netpad-cli plugin create my-awesome-plugin
# Validate plugin (dry run)
netpad-cli plugin publish --dry-run
# Publish to NetPad
netpad-cli plugin publish
# List available plugins
netpad-cli plugin listCommands
Plugin Management
netpad-cli plugin create <name> # Scaffold a new plugin
netpad-cli plugin publish [path] # Publish a plugin
netpad-cli plugin publish --dry-run # Validate without publishing
netpad-cli plugin list # List available plugins
netpad-cli plugin list --scope public # Filter by scopeAuthentication
netpad-cli login # Interactive login
netpad-cli login --google # Google OAuth
netpad-cli login --github # GitHub OAuth
netpad-cli logout # Clear credentials
netpad-cli whoami # Show auth statusOther Commands
netpad-cli status # NetPad instance status
netpad-cli help # Show all commandsAuthentication
NetPad CLI uses OAuth2 Device Code Flow for secure authentication:
- Run login command:
netpad-cli login --google - Visit verification URL: CLI opens browser automatically
- Enter device code: Complete OAuth in browser
- CLI receives token: Stored securely in
~/.netpadrc
Supports Google OAuth, GitHub OAuth, and email/password authentication.
Plugin Development
Create Plugin
# Interactive creation
netpad-cli plugin create my-plugin
# Choose from templates:
# - Basic: Simple data processing
# - API: External API integration
# - Database: Database connectivity
# - Transformer: Data transformationPlugin Structure
my-plugin/
├── manifest.json # Plugin metadata
├── package.json # Node.js dependencies
├── src/
│ ├── runner.js # Plugin execution logic
│ ├── shape.js # UI component definition
│ └── icon.svg # Plugin icon
├── tests/
│ └── runner.test.js # Unit tests
└── README.md # DocumentationPublishing
# Validate plugin
netpad-cli plugin publish --dry-run
# Publish to NetPad
netpad-cli plugin publish
# Check status
netpad-cli plugin list --scope privateConfiguration
The CLI stores configuration in ~/.netpadrc:
{
"apiKey": "mcp_your_api_key_here",
"baseUrl": "https://netpad.io"
}Requirements
- Node.js: >=16.0.0
- NetPad Instance: Compatible with NetPad v2.0+
- Authentication: Valid NetPad account
Examples
Example 1: Create and Publish Plugin
# Create plugin
netpad-cli plugin create url-shortener
# Edit plugin files
cd url-shortener
# ... implement your logic ...
# Test and publish
netpad-cli plugin publish --dry-run
netpad-cli plugin publishExample 2: Different NetPad Instance
# Login to custom instance
netpad-cli login --url https://my-netpad.company.com
# Create and publish
netpad-cli plugin create company-plugin
netpad-cli plugin publishTroubleshooting
Common Issues
Authentication Failed
# Check auth status
netpad-cli whoami
# Re-authenticate
netpad-cli login --googlePlugin Validation Errors
# Check detailed validation
netpad-cli plugin publish --dry-run
# Common fixes:
# - Ensure manifest.json is valid
# - Check all required files exist
# - Verify plugin name formatConnection Issues
# Check NetPad status
netpad-cli status
# Verify URL and connectivity
netpad-cli login --url https://your-netpad-instance.comDevelopment
Local Development
# Clone repository
git clone https://github.com/mrlynn/netpad-cli.git
cd netpad-cli
# Install dependencies
npm install
# Run locally
node bin/netpad-cli.js --help
# Run tests
npm testContributing
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Add tests for new functionality
- Run tests:
npm test - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
Links
- GitHub: https://github.com/mrlynn/netpad-cli
- npm Package: https://www.npmjs.com/package/netpad-cli
- NetPad: https://netpad.io
- Issues: Report bugs and request features
License
MIT License - see LICENSE file for details.
Author
NetPad Team - [email protected]
🚀 Build amazing NetPad plugins with ease!
