Running Files¶
Learn how to execute script files with run.
Basic File Execution¶
Simply provide the file path:
run automatically detects the language from the file extension.
Auto-Detection¶
Supported file extensions:
| Extension | Language |
|---|---|
.py | Python |
.js | JavaScript |
.ts | TypeScript |
.rs | Rust |
.go | Go |
.c | C |
.cpp, .cc, .cxx | C++ |
.java | Java |
.cs | C# |
.rb | Ruby |
.sh | Bash |
.php | PHP |
.lua | Lua |
.pl | Perl |
.swift | Swift |
.kt | Kotlin |
.dart | Dart |
.r | R |
.hs | Haskell |
.ex, .exs | Elixir |
.jl | Julia |
Passing Arguments¶
Arguments after the filename are passed to your script:
Your script receives them normally:
Overriding Language Detection¶
Force a specific language:
# Treat .txt as Python
run --lang python script.txt
# Run extensionless file as Bash
run --lang bash my_script
Working Directory¶
Scripts execute in their directory: