Skip to content
VinayakGhaiPublic

About

⚡ One command to compile & run C, ASM, and AVR code. Auto-detects file type, stops on errors, flashes Arduino boards.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

qrun logo

qrun — Quick Run

One command to compile and run C, ASM, and AVR code on Linux, macOS, and Windows.

Release MIT License Platform Supports


No more running 3 commands every time you want to test code. qrun auto-detects your file type and handles the full pipeline — compile → run, or compile → flash — in one shot. If anything fails, it stops immediately and shows you exactly what went wrong.

Features

  • Auto-detection — detects .c, .cpp, .asm, .s automatically
  • Native C/C++ — compiles with gcc/g++ and runs instantly
  • Native ASM — assembles NASM x86-64 and runs via ld
  • AVR C/C++ — compiles with avr-gcc and flashes via avrdude
  • AVR ASM — assembles with avr-as and flashes to board
  • Smart error handling — stops on any failure and shows the exact error
  • AVR auto-detect — finds your serial port automatically (no need to remember /dev/ttyUSB0)
  • Memory report — shows AVR flash/RAM usage after compilation
  • Clean output — color-coded steps: ✔ green for success, ✖ red for errors

Install

Arch Linux (AUR) — simplest

yay -S qrun

Any Linux / macOS — one-liner

curl -fsSL https://raw.githubusercontent.com/VinayakGhai/qrun/main/install.sh | bash

Fedora / RHEL (dnf)

curl -fsSL https://raw.githubusercontent.com/VinayakGhai/qrun/main/install.sh | bash

Manual install (all platforms)

curl -fsSL https://raw.githubusercontent.com/VinayakGhai/qrun/main/qrun -o ~/.local/bin/qrun
chmod +x ~/.local/bin/qrun

Windows (WSL or Git Bash)

curl -fsSL https://raw.githubusercontent.com/VinayakGhai/qrun/main/install.sh | bash

Usage

qrun <file> [options]

Native C / C++

qrun hello.c          # compile hello.c + run it
qrun main.cpp         # C++ works too
qrun hello.c -Wall    # enable all warnings
qrun hello.c --no-run # compile only, don't run

Native x86-64 Assembly (NASM)

qrun hello.asm        # assemble + link + run

AVR (Arduino Uno / Nano by default)

qrun blink.c -avr                          # compile + auto-detect port + flash
qrun blink.c -avr -p /dev/ttyUSB0         # specify port
qrun blink.c -avr -mcu atmega2560         # Arduino Mega
qrun blink.c -avr -mcu attiny85           # ATtiny85
qrun blink.asm -avr                        # AVR Assembly
qrun blink.c -avr --no-run                # compile only, save .hex file

Options

Flag Description Default
-avr AVR mode: compile + flash off
-p <port> AVR serial port auto-detect
-mcu <mcu> AVR MCU target atmega328p
-baud <baud> Upload baud rate 115200
-prog <prog> avrdude programmer arduino
-std <std> C standard (c11, c99, gnu11) c11
-Wall Enable all warnings off
--no-run Compile only off
-o <name> Output binary name auto
--version Show version —
--help Show help —

Examples

Hello World in C

// hello.c
#include <stdio.h>
int main(void) {
    printf("Hello, World!\n");
    return 0;
}
$ qrun hello.c
  ────────────────────────────────────────
  qrun v1.0.0 — Quick Run
  ────────────────────────────────────────
  ◆  File   : hello.c
  ◆  Type   : c
  ◆  Target : Native (x86_64)

  ▸  Compiling hello.c → native binary
  ✔  Compiled successfully

  ── Output ────────────────────────────────
  Hello, World!
  ─────────────────────────────────────────
  ✔  Program exited cleanly (code 0)
  ✔  Done! ✨

AVR Blink (Arduino Uno)

// blink.c
#define F_CPU 16000000UL
#include <avr/io.h>
#include <util/delay.h>

int main(void) {
    DDRB |= (1 << PB5);   // pin 13 = output
    while(1) {
        PORTB ^= (1 << PB5);
        _delay_ms(500);
    }
}
$ qrun blink.c -avr
  ◆  Target : AVR (atmega328p)
  ▸  Compiling blink.c for AVR (atmega328p)
  ✔  Compiled → blink.elf
  ▸  Converting to HEX
  ✔  HEX ready

  Program:     180 bytes (0.5% Full)

  ▸  Flashing → /dev/ttyUSB0 (atmega328p, arduino, 115200 baud)
  ✔  Flashed successfully! Board is running your code.

Error Handling

$ qrun bad.c
  ▸  Compiling bad.c → native binary
  ── Compiler Output ──────────────────────
  bad.c:3:32: error: expected ';' before 'return'
  ─────────────────────────────────────────
  ✖  ERROR: Compilation failed — fix the errors above and try again

Dependencies

Feature Dependency Install (Arch)
Native C/C++ gcc pre-installed / pacman -S gcc
Native ASM nasm, binutils pacman -S nasm binutils
AVR C/C++ avr-gcc, avr-libc pacman -S avr-gcc avr-libc
AVR Flash avrdude pacman -S avrdude

Fedora/RHEL:

dnf install gcc nasm binutils avr-gcc avr-libc avrdude

macOS:

brew install nasm avr-gcc avrdude

Serial Port Permissions (Linux)

If you get Permission denied on /dev/ttyUSB0, add yourself to the uucp group:

sudo usermod -aG uucp $USER
# then log out and back in (or reboot)

License

MIT — see LICENSE


Made with ❤️ for developers who just want to run their code.

About

⚡ One command to compile & run C, ASM, and AVR code. Auto-detects file type, stops on errors, flashes Arduino boards.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages