LinuxCommandLibrary

codecrafters

Run and manage CodeCrafters challenges locally

TLDR

Run tests without committing changes

$ codecrafters test
copy

Run tests for all previous stages and the current stage without committing changes
$ codecrafters test --previous
copy

Commit changes and submit, to move to the next stage
$ codecrafters submit
copy

Update language version
$ codecrafters update-buildpack
copy

SYNOPSIS

codecrafters <command> [<options>]

PARAMETERS

--help
    Print help information

--version
    Print version information

-v, --verbose
    Increase verbosity of output

--clear
    Clear screen before running tests

--no-color
    Disable colored output

--working-directory <DIR>
    Set working directory for command

DESCRIPTION

Codecrafters is a powerful command-line interface (CLI) tool for the Codecrafters.io platform, where developers recreate popular software like Git, Redis, Docker, and SQLite from scratch in their preferred programming language. It streamlines challenge workflows by providing essential commands to scaffold projects, test implementations against official test suites, submit solutions for verification, and benchmark performance against reference implementations.

Users start by authenticating with codecrafters login, then clone repositories or scaffold new ones. The tool fetches test cases from the platform, runs them locally, and reports failures with detailed feedback. It's ideal for hands-on learning, interviews, and skill-building, supporting languages via Cargo, Homebrew, or direct binaries. Open-source and actively maintained, it ensures compatibility with evolving challenges.

CAVEATS

Requires internet for login, tests, and submissions. Some challenges need specific language runtimes. Not all challenges support benchmarking.

INSTALLATION

Via Homebrew: brew install codecrafters/tap/codecrafters-cli
Via Cargo: cargo install codecrafters-cli

AUTHENTICATION

Run codecrafters login with GitHub account linked to Codecrafters.

COMMON WORKFLOW

1. codecrafters scaffold <challenge>
2. Implement code.
3. codecrafters test
4. codecrafters submit

HISTORY

Released in 2020 alongside Codecrafters platform launch. Developed by Puneet Wadhwa and team as Rust CLI. Frequent updates for new challenges; v0.50+ added multi-language support and improved benchmarking.

SEE ALSO

cargo(1), brew(1), git(1)

Copied to clipboard