Reference
CLI Reference
gset transpile, gset run, version flags, targets, and exit codes.
USAGE
gset transpile <file> [-t|--to <target>] [-f|--from <lang>] [-o outfile] [--verbose]
gset run <file> [-t|--to <target>] [-f|--from <lang>] [--keep]
gset version
gset helpgset transpile
Parse a source file and print the generated source to stdout:
gset transpile <PATH> [OPTIONS]| Flag | Meaning |
|---|---|
-t, --to <TARGET> | Target language to emit. Default go. --target is accepted as an alias. |
-f, --from <LANG> | Source language, overriding the one inferred from the file extension. |
-o, --output <OUTFILE> | Write the result here instead of stdout. |
--verbose | Print diagnostics even when there are none. |
gset run
Transpile, then execute on the target runtime:
gset run <PATH> [OPTIONS]| Flag | Meaning |
|---|---|
-t, --to <TARGET> | Target language to emit before running. Default go. |
-f, --from <LANG> | Source language, overriding the one inferred from the file extension. |
--keep | Keep the generated file instead of deleting it after the run. |
Execution flow:
- Source language resolved (extension default, overridden by
--from). - Source lowered and emitted for the target (
--to, defaultgo). - Output written to a per-invocation temp directory.
- Target runtime invoked (
go runtoday) and its exit code propagated. - Temp directory removed unless
--keep.
Targets
| Target | Extension | Status |
|---|---|---|
go / golang | .go | Implemented |
python / py / python3 | .py | Implemented |
javascript / js / node | .js | Implemented |
java | .java | Implemented |
ruby / rb | .rb | Implemented |
Any other value is rejected before parsing.
Environment & config
| Variable / file | Effect |
|---|---|
GSET_DEBUG=1 | Debug logging to stderr |
There is no configuration file in the Rust rewrite — the Go-era gset.conf was deleted. A gset.toml (default target, interpreter paths, project root, dependency search roots) is planned but not yet implemented.
Exit codes
| Code | Meaning |
|---|---|
| 0 | success |
| 1 | parse/lowering errors, unreadable input files |
| 2 | target or pipeline errors (e.g. no backend for target) |
Example session
$ gset transpile fib.py -t go # Go source on stdout (with any warnings)
$ gset transpile fib.py -t go -o fib.go # save to a file
$ gset run fib.py -t go # print fib(10) => 55
$ gset transpile fib.py -t python
gset: no backend for target `python`; supported: go