mirror of
https://github.com/nenadilic84/claudex.git
synced 2025-10-28 00:02:05 -07:00
Prepare project for GitHub publishing
- Update README with detailed usage instructions - Add GitHub community files (CONTRIBUTING, CODE_OF_CONDUCT, etc.) - Set up CI workflows for automated testing - Create CHANGELOG for version tracking - Add SECURITY guidelines - Update licensing and author information
This commit is contained in:
parent
b55cd15de2
commit
57dac558f4
21
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
21
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
## Description
|
||||
<!--- Describe your changes in detail -->
|
||||
|
||||
## Motivation and Context
|
||||
<!--- Why is this change required? What problem does it solve? -->
|
||||
|
||||
## How Has This Been Tested?
|
||||
<!--- Please describe how you tested your changes. -->
|
||||
|
||||
## Types of changes
|
||||
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
|
||||
- [ ] Bug fix (non-breaking change which fixes an issue)
|
||||
- [ ] New feature (non-breaking change which adds functionality)
|
||||
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
|
||||
|
||||
## Checklist:
|
||||
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
|
||||
- [ ] My code follows the code style of this project.
|
||||
- [ ] I have updated the documentation accordingly.
|
||||
- [ ] I have added tests to cover my changes.
|
||||
- [ ] All new and existing tests passed.
|
||||
32
.github/workflows/python-tests.yml
vendored
Normal file
32
.github/workflows/python-tests.yml
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
name: Python Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main, master ]
|
||||
pull_request:
|
||||
branches: [ main, master ]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [3.8, 3.9, '3.10', '3.11']
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
|
||||
pip install -e .
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
pytest
|
||||
15
CHANGELOG.md
Normal file
15
CHANGELOG.md
Normal file
@ -0,0 +1,15 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to claudex will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [0.1.0] - 2025-04-26
|
||||
|
||||
### Added
|
||||
- Initial release of claudex
|
||||
- FastAPI-based proxy for converting Anthropic API requests to OpenAI format
|
||||
- Support for environment variable configuration
|
||||
- Basic test suite
|
||||
- Documentation
|
||||
63
CODE_OF_CONDUCT.md
Normal file
63
CODE_OF_CONDUCT.md
Normal file
@ -0,0 +1,63 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
We as members, contributors, and leaders pledge to make participation in our
|
||||
community a harassment-free experience for everyone, regardless of age, body
|
||||
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||
identity and expression, level of experience, education, socio-economic status,
|
||||
nationality, personal appearance, race, caste, color, religion, or sexual
|
||||
identity and orientation.
|
||||
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||
diverse, inclusive, and healthy community.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to a positive environment include:
|
||||
|
||||
* Demonstrating empathy and kindness toward other people
|
||||
* Being respectful of differing opinions, viewpoints, and experiences
|
||||
* Giving and gracefully accepting constructive feedback
|
||||
* Accepting responsibility and apologizing to those affected by our mistakes,
|
||||
and learning from the experience
|
||||
* Focusing on what is best not just for us as individuals, but for the overall
|
||||
community
|
||||
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
* The use of sexualized language or imagery, and sexual attention or advances of
|
||||
any kind
|
||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or email address,
|
||||
without their explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Enforcement Responsibilities
|
||||
|
||||
Community leaders are responsible for clarifying and enforcing our standards of
|
||||
acceptable behavior and will take appropriate and fair corrective action in
|
||||
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||
or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies within all community spaces, and also applies when
|
||||
an individual is officially representing the community in public spaces.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported to the community leaders responsible for enforcement through GitHub issues.
|
||||
All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 2.1, available at
|
||||
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
||||
41
CONTRIBUTING.md
Normal file
41
CONTRIBUTING.md
Normal file
@ -0,0 +1,41 @@
|
||||
# Contributing to claudex
|
||||
|
||||
Thank you for your interest in contributing to claudex! This document outlines how you can contribute to this project.
|
||||
|
||||
## Getting Started
|
||||
|
||||
1. Fork the repository
|
||||
2. Clone your fork: `git clone https://github.com/your-username/claudex.git`
|
||||
3. Set up the development environment as described in the README
|
||||
4. Create a branch for your changes: `git checkout -b feature/your-feature-name`
|
||||
|
||||
## Pull Request Process
|
||||
|
||||
1. Make your changes and commit them using descriptive commit messages
|
||||
2. Push your changes to your fork
|
||||
3. Submit a pull request to the main repository
|
||||
4. Your PR will be reviewed, and changes may be requested
|
||||
|
||||
## Development Guidelines
|
||||
|
||||
- Follow the existing code style
|
||||
- Add tests for new features or bug fixes
|
||||
- Update documentation as needed
|
||||
|
||||
## Testing
|
||||
|
||||
Before submitting your PR, make sure all tests pass:
|
||||
|
||||
```bash
|
||||
pytest
|
||||
```
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
Please note that this project adheres to a code of conduct. By participating, you are expected to uphold this code.
|
||||
|
||||
## Questions?
|
||||
|
||||
If you have any questions about contributing, please open an issue for discussion.
|
||||
|
||||
Thank you for your contributions!
|
||||
2
LICENSE
2
LICENSE
@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2025
|
||||
Copyright (c) 2025 nenadilic84
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
38
README.md
38
README.md
@ -1,12 +1,6 @@
|
||||
# claudex
|
||||
|
||||
A CLI proxy to run Claude API requests (Anthropic-style) against OpenAI-compatible LLM providers (like OpenRouter), either for local development, automation, or as a bridge to OpenAI tooling.
|
||||
|
||||
## Features
|
||||
|
||||
- FastAPI-based proxy for low-latency, robust relaying.
|
||||
- Converts Anthropic Claude v3-style and Claude tool-calls API to OpenAI-compatible requests.
|
||||
- Flexible environment variable configuration for provider settings.
|
||||
A CLI proxy to run Claude API requests (Anthropic-style) against OpenAI-compatible LLM providers (like OpenRouter), enabling Claude Code to work with any OpenAI-compatible endpoint.
|
||||
|
||||
## Requirements
|
||||
|
||||
@ -17,7 +11,7 @@ A CLI proxy to run Claude API requests (Anthropic-style) against OpenAI-compatib
|
||||
## Setup
|
||||
|
||||
```bash
|
||||
git clone <your-repo-url>
|
||||
git clone https://github.com/nenadilic84/claudex.git
|
||||
cd claudex
|
||||
python3 -m venv .venv
|
||||
source .venv/bin/activate
|
||||
@ -42,7 +36,7 @@ After setup and installing dependencies, you can run the proxy in either of thes
|
||||
|
||||
```bash
|
||||
# Run as module:
|
||||
python -m claudex --host 0.0.0.0 --port 8082 --reload
|
||||
python -m claudex.main --host 0.0.0.0 --port 8082 --reload
|
||||
|
||||
# Or (if installed as a script):
|
||||
claudex --host 0.0.0.0 --port 8082 --reload
|
||||
@ -54,12 +48,32 @@ claudex --host 0.0.0.0 --port 8082 --reload
|
||||
uvicorn claudex.proxy:app --host 0.0.0.0 --port 8082 --reload
|
||||
```
|
||||
|
||||
---
|
||||
### Using with Claude CLI
|
||||
|
||||
In a second terminal, you can now use the Claude CLI tool with this:
|
||||
In a second terminal, you can now use the Claude CLI tool with this proxy:
|
||||
|
||||
```bash
|
||||
ANTHROPIC_BASE_URL=http://localhost:8082 DISABLE_PROMPT_CACHING=1 claude
|
||||
```
|
||||
|
||||
---
|
||||
This allows you to use Claude Code with any OpenAI-compatible LLM provider, such as:
|
||||
- OpenRouter
|
||||
- Together.ai
|
||||
- Local LLM endpoints
|
||||
- Any other OpenAI-compatible API
|
||||
|
||||
## API Endpoints
|
||||
|
||||
- `GET /` - Health check endpoint
|
||||
- `POST /v1/messages` - Main endpoint that receives Anthropic API requests, converts them to OpenAI format, and returns converted responses
|
||||
|
||||
## Development
|
||||
|
||||
Run tests:
|
||||
```bash
|
||||
pytest
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
MIT License - Copyright (c) 2025 nenadilic84
|
||||
25
SECURITY.md
Normal file
25
SECURITY.md
Normal file
@ -0,0 +1,25 @@
|
||||
# Security Policy
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
If you discover a security vulnerability in claudex, please report it by creating a new issue with the label "security".
|
||||
|
||||
Please include the following information in your report:
|
||||
- A description of the vulnerability
|
||||
- Steps to reproduce the issue
|
||||
- Potential impact of the vulnerability
|
||||
- Any suggestions for remediation if applicable
|
||||
|
||||
We take security issues seriously and will respond as quickly as possible to address any concerns.
|
||||
|
||||
## Supported Versions
|
||||
|
||||
Only the latest version of claudex is currently supported with security updates.
|
||||
|
||||
## Security Best Practices
|
||||
|
||||
When using claudex:
|
||||
1. Never commit API keys or sensitive information to your repository
|
||||
2. Always use environment variables for configuration as shown in the documentation
|
||||
3. Keep dependencies updated to the latest secure versions
|
||||
4. Properly secure your API endpoints when deploying to production environments
|
||||
@ -2,7 +2,7 @@
|
||||
name = "claudex"
|
||||
version = "0.1.0"
|
||||
description = "Anthropic Claude/OpenRouter proxy toolkit for the CLI"
|
||||
authors = [{ name="Your Name" }]
|
||||
authors = [{ name="nenadilic84" }]
|
||||
|
||||
dependencies = [
|
||||
"fastapi>=0.95.0",
|
||||
|
||||
0
scripts/run_proxy.py
Normal file → Executable file
0
scripts/run_proxy.py
Normal file → Executable file
Loading…
x
Reference in New Issue
Block a user