Client Libraries

CLP provides language-specific client libraries that wrap the underlying protocol in clean, idiomatic interfaces. These libraries are generated from the protocol definition, ensuring consistency across implementations and minimizing the risk of divergence or miscommunication.

Developers can use these libraries to interact with the CLP calendar engine without needing to handle low-level protocol details.


Available Libraries

Language Status
Ruby πŸ§ͺ Proof of Concept
Elixir πŸ§ͺ Proof of Concept
JavaScript πŸ”œ Planned
TypeScript πŸ”œ Planned
Go πŸ”œ Planned
Python πŸ”œ Planned
Rust πŸ”œ Planned

Generated from the Protocol

Each client is generated using the CLP CLI tool based on the current version of the protocol YAML definition. This means:

  • No hand-written boilerplate
  • Automatic updates when the protocol changes
  • Consistent naming, error handling, and response structures

To generate a client:

clp scaffold ruby --out=./clients/ruby

Example: Using the Ruby Client

Here’s what it looks like to use a generated client in Ruby:

require "clp"

client = CLP::Client.new(api_key: "demo-key")

calendar = client.calendars.create(name: "Team Calendar", timezone: "Europe/Berlin")

puts "Created calendar with ID: #{calendar.id}"

Adding a New Language

Adding support for CLP in a given language: Use the CLI to scaffold a new client:

clp scaffold rust --out=./clients/rust
  1. Extend the generated files or templates as needed
  2. Open a pull request to contribute your client back to the ecosystem

We welcome contributions and are happy to help review and maintain new clients.

Design Principles

All client libraries aim to be:

  1. Idiomatic: Match the conventions of the target language
  2. Minimal: No runtime dependencies beyond what’s needed
  3. Typed: Prefer strong typing and validation where the language supports it
  4. Consistent: Match the structure of the shared protocol definition
  5. Test: 100% Unit test