Skip to content

Conversation

@aaronelliotross
Copy link
Collaborator

Summary

This PR adds a comprehensive command-line interface (CLI) for the ActionKit API, making it easy to perform CRUD operations directly from the terminal.

Features

  • Intuitive command structure: actionkit [METHOD] RESOURCE [PARAMS...]
  • Full resource support: All ActionKit resources (users, donations, campaigns, petitions, transactions, etc.)
  • Smart parameter parsing: Automatic type conversion for integers, booleans, floats, and null values
  • Flexible authentication: Environment variables or CLI options
  • Pretty output: JSON formatted by default, with --raw option for unformatted output
  • Excellent discoverability: Helpful error messages list all available resources

Usage Examples

# Get a user by ID (method defaults to 'get')
actionkit users id=123

# Search users by email
actionkit search users email=test@example.com

# Create a new user
actionkit post users email=new@example.com first_name=John

# Update a user
actionkit patch users/123 first_name=Jane

# Delete a user
actionkit delete users/123

Files Changed

  • actionkit/cli.py (new): Complete CLI implementation using Click framework
  • setup.py: Added click>=8.0 dependency and console_scripts entry point
  • actionkit/users.py: Fixed regex pattern to use raw string (bug fix)
  • CLAUDE.md (new): Documentation for future Claude Code sessions
  • CLI_USAGE.md (new): Comprehensive usage guide with examples

Test Plan

  • CLI installs correctly via pip install -e .
  • Help command displays proper usage: actionkit --help
  • Unknown resources display helpful error with full resource list
  • Parameter parsing handles various types correctly
  • Integration test with actual ActionKit instance (requires credentials)

Generated with Claude Code

This commit introduces a new CLI tool for interacting with the ActionKit API,
making it easy to perform CRUD operations from the command line.

Features:
- Intuitive command structure: actionkit [METHOD] RESOURCE [PARAMS...]
- Support for all ActionKit resources (users, donations, campaigns, etc.)
- Smart parameter parsing with automatic type conversion
- Multiple authentication methods (env vars or CLI options)
- Pretty-printed JSON output
- Helpful error messages and resource discovery

Technical changes:
- Add actionkit/cli.py with Click-based CLI implementation
- Update setup.py to add click dependency and console_scripts entry point
- Fix regex pattern in Users.id() to use raw string
- Add CLAUDE.md for future Claude Code context
- Add CLI_USAGE.md with comprehensive usage examples

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants