Codect is a free and open-source tool designed to detect whether a piece of code was written by an AI or a human. It supports multiple programming languages and provides detailed insights based on various code features such as entropy, comment ratio, AST complexity, and more.
This monorepo contains three main packages:
# Clone the repository
git clone https://github.com/GustyCube/Codect.git
cd Codect
# Install dependencies
npm install
npm run build
# Install Python dependencies for the API
cd packages/api
pip install -r requirements.txt
cd ../..
The CLI provides a beautiful terminal interface for code analysis:
# Run interactive mode
npx codect
# Analyze a specific file
npx codect analyze path/to/file.py --detailed
# Get help
npx codect --help
Features:
Start the API server:
cd packages/api
python main.py
The API will be available at http://localhost:8000
Health Check
curl http://localhost:8000/health
Basic Analysis (/basic
)
curl -X POST "http://localhost:8000/basic" \
-H "Content-Type: application/json" \
-d '{"code": "def add(x, y): return x + y", "language": "python"}'
Detailed Analysis (/premium
)
curl -X POST "http://localhost:8000/premium" \
-H "Content-Type: application/json" \
-d '{"code": "def add(x, y): return x + y", "language": "python"}'
# Run all packages in development mode
npm run dev
# Run tests
npm test
# Lint code
npm run lint
# Build all packages
npm run build
We welcome contributions! Feel free to:
Codect is licensed under the GNU General Public v3.0 license. You are free to modify and distribute the project as needed.
For questions or contributions, open an issue on GitHub or reach out to [email protected]
.
Let us know if you have any suggestions! 🚀