Skip to content

mentalcaries/codecheck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CodeCheck

A CLI tool to streamline code review workflows for student assignments. CodeCheck automates cloning repositories, installing dependencies, opening projects in VS Code, and starting development servers.

Features

  • Clone GitHub repositories with one command
  • Automatic dependency installation once package.json is present
  • Opens projects directly in VS Code (if installed) for viewing code
  • Auto-detects project type and starts appropriate dev server
  • Simple cleanup workflow after review
  • Configurable download directory

Prerequisites

Installation

go install github.com/mentalcaries/codecheck/cmd/codecheck@latest

Usage

Initial Setup

You'll be prompted to set your download directory. This can be anywhere you'd like the projects to be cloned.

If you need to change the config afterwards, you can run:

codecheck setup

Review a Project

Supports GitHub URLs - HTTP and SSH. If you need to review code on a specific branch, the branch name can be passed as an optional argument. Alternatively, the GitHub branch URL can also be used. Usage:

codecheck review <github-url> [branch]

Examples:

codecheck review https://github.com/student/assignment-1
codecheck review https://github.com/student/project.git
codecheck review [email protected]:student/assignment.git
codecheck review https://github.com/student/project develop # branch name as argument
codecheck review https://github.com/student/project/tree/feature-auth # with branch URL

Branch Support:

  • Clone a specific branch by providing it as an argument
  • Or paste a GitHub branch URL (includes /tree/branch-name)
  • If both are provided, the argument takes priority
  • Defaults to repository's default branch if not specified

What happens:

  1. Clones the repository to your configured directory
  2. Detects project type (static HTML or Node.js)
  3. Installs dependencies (if Node.js project)
  4. Opens project in VS Code
  5. Starts appropriate development server and opens your browser (for frontend projects)
  6. Waits for you to complete your review

When you're done reviewing:

  • Press Ctrl+C to stop the server
  • Choose to delete or keep the project directory

Supported Project Types

  • Static HTML/CSS/JS - Serves with built-in Go file server
  • Webpack - Runs npm run dev with auto port configuration
  • Vite - Runs npm run dev (tested with React)
  • Node.js/Express - Runs npm run dev

Directory Conflict Resolution

If a directory with the same name already exists, you'll be prompted with options:

  • [Enter] - Delete and overwrite existing directory
  • [n] - Clone with modified name (appends username)
  • [q] - Cancel operation

Known Limitations

  • Only supports GitHub URLs (HTTPS and SSH)
  • Webpack projects may require pressing Ctrl+C twice for graceful shutdown
  • Requires VS Code CLI to be configured

Development

Clone and Build Locally

git clone https://github.com/mentalcaries/codecheck
cd codecheck
go install ./cmd/codecheck

Run Without Installing

go run ./cmd/codecheck review <github-url>

Troubleshooting

"Repository not found or is private"

  • Verify the URL is correct
  • Ensure the repository is set to public

"VS Code not available"

  • Install VS Code CLI: Open VS Code → Command Palette (Cmd+Shift+P) → "Shell Command: Install 'code' command in PATH"

Port conflicts

  • CodeCheck serves static html files from Port 5543, Vite auto-assigns and WebPack uses its config
  • If issues persist, manually stop any processes using the ports or manually change the config

License

MIT


Happy reviewing! 🎉

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages