First off, thank you for considering contributing to the Dodo Payments CLI! It's people like you that make this tool great for everyone.
We welcome contributions of all kinds - bug reports, feature requests, documentation improvements, and code contributions.
- Code of Conduct
- Getting Started
- Development Setup
- Project Structure
- How to Contribute
- Coding Guidelines
- Pull Request Process
- Adding New Commands
- Community
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to support@dodopayments.com.
- Bun >= 1.0 (recommended) or Node.js >= 18
- A Dodo Payments account (for testing)
-
Fork the repository on GitHub
-
Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/dodopayments-cli.git cd dodopayments-cli -
Install dependencies:
bun install
-
Create a branch for your changes:
git checkout -b feature/your-feature-name
-
Run the CLI locally:
bun run index.ts <command>
-
Build the project:
bun run build
dodopayments-cli/
├── src/ # All CLI source code
│ ├── index.ts # Main CLI entrypoint (command router)
│ │
│ ├── commands/ # Domain-based command modules
│ │ ├── addons/ # Add-on related commands
│ │ ├── ai/ # AI agent related commands
│ │ ├── checkout/ # Checkout commands
│ │ ├── customers/ # Customer management commands
│ │ ├── discounts/ # Discount/coupon commands
│ │ ├── licences/ # License management commands
│ │ ├── login/ # Authentication/login commands
│ │ ├── logout/ # Authentication/logout commands
│ │ ├── payments/ # Payment-related commands
│ │ ├── products/ # Product management commands
│ │ ├── refund/ # Refund commands
│ │ └── webhook/ # Webhook-related commands
│ │
│ ├── ui/ # CLI presentation layer (output/help/logo)
│ │ ├── help.ts # Help rendering
│ │ ├── index.ts # Barrel export for UI utilities
│ │ └── logo.ts # CLI logo/banner
│ │
│ └── utils/ # Shared utilities (config, client, helpers)
│
├── build-binaries.ts # Script to generate distributable binaries
├── .github/
│ ├── ISSUE_TEMPLATE/
│ ├── PULL_REQUEST_TEMPLATE.md
│ └── workflows/
│
├── CONTRIBUTING.md
├── CODE_OF_CONDUCT.md
├── LICENSE
├── README.md
Before creating a bug report, please check existing issues to avoid duplicates. When creating a bug report, include:
- A clear, descriptive title
- Steps to reproduce the issue
- Expected behavior vs actual behavior
- Your environment (OS, Bun/Node version, CLI version)
- Any relevant error messages or logs
Feature requests are welcome! Please include:
- A clear description of the feature
- The problem it solves or use case it addresses
- Any alternative solutions you've considered
- Check the issues for open tasks
- Comment on an issue to let others know you're working on it
- Follow the coding guidelines
- Submit a pull request
- Use TypeScript: All code should be written in TypeScript
- Use Bun APIs: Prefer Bun's built-in APIs when available
- Keep it simple: Write clear, readable code
- Add comments: Document complex logic and non-obvious decisions
- Use 2 spaces for indentation
- Use single quotes for strings
- Add semicolons at end of statements
- Use
constby default,letwhen reassignment is needed
- Interactive by default: Use prompts for required inputs when not provided as arguments
- Helpful error messages: Provide clear, actionable error messages
- Consistent output: Use consistent formatting across all commands
-
Update documentation if you're adding or changing functionality
-
Follow the PR template - Fill out all sections completely
-
Link related issues - Reference any issues your PR addresses
-
Keep PRs focused - One feature or fix per PR
-
Write clear commit messages - Describe what and why
-
Ensure the build passes - Run
bun run buildbefore submitting -
Request review - Tag maintainers for review
To add a new command to the CLI:
-
Add the command handler in
index.ts:case 'your-command': await handleYourCommand(); break;
-
Implement the handler function:
- Use
inquirerfor interactive prompts - Use the
dodopaymentsSDK for API calls - Handle errors gracefully with helpful messages
- Use
-
Update the README with documentation for the new command
-
Test thoroughly in both test and live modes
async function handleYourCommand() {
// 1. Parse any arguments
const args = process.argv.slice(3);
// 2. Prompt for missing inputs
const answers = await inquirer.prompt([
{
type: 'input',
name: 'someInput',
message: 'Enter value:',
}
]);
// 3. Make API call
const result = await dodo.someResource.someMethod({
// ...
});
// 4. Display results
console.log(result);
}- Discord: Join our community for help and discussion
- GitHub Issues: For bug reports and feature requests
- Twitter: Follow @dodopayments for updates
We appreciate all contributors! Your contributions help make the Dodo Payments CLI better for everyone.
Thank you for contributing to Dodo Payments CLI!