Skip to content

moexu13/code-squeak-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

Code Squeak API

An API that conducts an AI review of a pull request. It can also post the review as a comment.
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

Product Name Screen Shot

(back to top)

Endpoints

Base URL

  • GET / - Health check endpoint that returns "Code Squeak API"

Code Analysis Endpoints (/api/v1/code-analysis)

  • POST / - Create a code analysis from a diff
    • Analyzes code changes using AI models
    • Accepts diff, prompt, model parameters, and metadata
    • Returns analysis results immediately
  • POST /pr - Analyze a pull request asynchronously
    • Queues a pull request analysis job
    • Requires owner, repo, and pull_number
    • Returns job ID for tracking progress

GitHub Integration Endpoints (/api/v1/github)

  • GET /:owner - List repositories for a GitHub user/organization
    • Returns paginated list of repositories
    • Supports page and per_page query parameters
  • GET /:owner/:repo - Get pull requests for a specific repository
    • Returns pull requests for the specified repository
  • POST /:owner/:repo/:pull_number/comments - Create a comment on a pull request
    • Adds a comment to the specified pull request
    • Requires comment text in request body
  • GET /:owner/:repo/:pull_number/diff - Get the diff for a pull request
    • Returns the code changes (diff) for the specified pull request
    • Diff is sanitized and truncated if too large (>10KB)

Authentication & Rate Limiting

  • All /api/v1/* endpoints require API key authentication
  • GitHub endpoints have additional rate limiting applied
  • Root endpoint (/) is publicly accessible

Built With

  • [![TypeScript][TypeScript.ts]][typescript-url]
  • [![Node.js][Node.js]][Node-url]
  • [![Redis][Redis]][Redis-url]
  • [![Vitest][Vitest]][Vitest-url]

(back to top)

Getting Started

Prerequisites

  1. Node
  2. Redis
  3. npm, pnpm. or yarn
  • npm

    npm install npm@latest -g
    • pnpm
    npm install pnpm@latest -g
    • yarn
    npm install yarn -g

Installation

  1. Get a free API Key at https://example.com
  2. Clone the repo
    git clone https://github.com/moexu13/code-squeak-api.git
  3. Install NPM packages
    npm install
  4. Enter your API in config.js
    const API_KEY = "ENTER YOUR API";

(back to top)

Usage

Use this space to show useful examples of how a project can be used. Additional screenshots, code examples and demos work well in this space. You may also link to more resources.

For more examples, please refer to the Documentation

(back to top)

Roadmap

  • Feature 1
  • Feature 2
  • Feature 3
    • Nested Feature

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Melissa Albarella - @bluesky - moe@melissa-albarella.dev

Project Link: https://github.com/moexu13/code-squeak-api

(back to top)

Acknowledgments

(back to top)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published