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
- Extend the generated files or templates as needed
- 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:
- Idiomatic: Match the conventions of the target language
- Minimal: No runtime dependencies beyond whatβs needed
- Typed: Prefer strong typing and validation where the language supports it
- Consistent: Match the structure of the shared protocol definition
- Test: 100% Unit test