Open-source project
x-motemen/gore avatar
x-motemen/gore

gore runs every line you type through go run, and its own notes point you elsewhere

Yet another Go REPL that works nicely. Featured with line editing, code completion, and more.

5,516 stars153 forksGoMIT

At a glance

What is it?
gore is a Go REPL built on peterh/liner and gopls where each input is executed by go run instead of a long-lived process. It is still shipping tags, and its FAQ tells speed-sensitive users to use gomacro or yaegi instead.
Who is it for?
gore suits a reader who wants a REPL that reads the modules already in the current directory, needs no go get step for a remote package, and starts from one go install, and who does not mind waiting for each line to run. It is a poor fit for anything that measures time inside the REPL, because every line is evaluated repeatedly, and the project sends speed-sensitive users to gomacro or yaegi.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 108 days ago.
What is it written in?
Mainly Go, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • x-motemen/gore5,516 ★ · -2
Star history
Repository2026-09-232026-11-15
x-motemen/gore5.5k5.5k

-2 Stars in the last 53 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

Every line is a separate go run, and the author says so

The design decision everything else follows from is stated in the project's own caveats: gore runs code using go run for each input. That means a fresh process per line rather than a long-lived interpreter, and it has two consequences the project names itself. Every line entered is evaluated repeatedly (issue #67), so you cannot bind the evaluated time with something like time.Now(). The same note says the implementation also makes execution fairly slow (issue #182). The project started from a simple idea to use go run for all REPL input, and the author then adds that there are other REPL implementations that are more actively maintained and run faster, naming gomacro and yaegi as the ones to use. Nothing in the code hides that: a REPL built this way is a convenience for poking at expressions, not a place to run work that has to finish quickly.

No standalone binary, because the Go toolchain has to be there

The install section opens with the reason there is nothing to download: the gore command requires Go tool-chains on runtime, so a standalone binary is not distributed. Installing means building it into your own GOPATH bin:

sh
go install github.com/x-motemen/gore/cmd/gore@latest

Completion is a separate step, listed as also recommended:

sh
go install golang.org/x/tools/gopls@latest   # for code completion

A third route sidesteps both the toolchain question and the second install, because the published image carries the language server with it:

sh
docker run -it --rm ghcr.io/x-motemen/gore

So the trade is explicit: two go install calls on a machine with Go, one docker run on a machine without. The go.mod file puts the floor at go 1.26, and the Dockerfile builds on golang:1.26.4-alpine3.24, which is a recent toolchain to require before you paste the first command.

Completion is gopls over LSP, wired in its own files

The feature list is short: line editing with history, multi-line input, package importing with completion, evaluation of any expressions, statements and function declarations, no evaluated but not used errors, code completion that requires gopls, showing documents, and auto-importing through the -autoimport flag. The dependency list shows how completion is wired. go.mod requires go.lsp.dev/jsonrpc2 v0.10.0, go.lsp.dev/protocol v0.12.0 and go.lsp.dev/uri v0.3.0, which is a language server protocol client rather than a bespoke completer, and golang.org/x/tools v0.46.0 for the tools side. The repository has gopls.go and complete.go at the root next to session.go and commands.go, so completion is a session concern rather than something bolted onto the prompt. The editor itself is peterh/liner v1.2.2, which is where line editing and history come from. Without gopls on the path, the completion entries simply have nothing to talk to.

:import fetches a module without a go get step

The commands are short and each does one thing:

text
:import [<alias>] <package>  Import package
:type <expr>                 Print the type of expression
:print                       Show current source
:write [<filename>]          Write out current source to file
:clear                       Clear the codes
:doc <expr or pkg>           Show document
:verbose [on|off]            Toggle printing of assigned or declared values
:help                        List commands
:quit                        Quit the session

The module story is the part that saves time. gore supports Go modules, and you load local modules by starting gore at the project directory. You do not need go get to check the usage of a remote repository: :import github.com/... downloads that module automatically. You do not need to go get the pretty print module anymore either. The one case that still needs work is local code under $GOPATH, where you have to create the modules file with go mod init and then start gore at the project directory. So the working directory you launch from decides which modules are in scope, and there is no separate step for pulling a dependency you only want to inspect.

GORE_HOME, GORE_PAGER and GORE_VERBOSE are the only knobs

Three environment variables, each with a stated default. GORE_HOME is the directory for the command history file, and it defaults to $XDG_DATA_HOME/gore, or ~/.gore when XDG_DATA_HOME is unset, which means history follows the same XDG convention as the rest of your user data. GORE_PAGER is the pager command used to display :doc output, with less given as the example; if it is unset, documents are printed directly, so long package documentation lands in your terminal unchunked. GORE_VERBOSE takes a boolean false value, written as 0 or false, to suppress the automatic printing of assigned or declared values at startup. It defaults to on, and the :verbose command toggles it during a session. One small inconsistency: the usage section says you quit with Ctrl-D or the :q command, while the command table above lists :quit, and the two are not cross-referenced.

A flat package of root files, with Unix and Windows terminals split

The repository root is a flat Go package rather than a deep tree:

text
cli/  cmd/  doc/
gore.go  session.go  node.go  commands.go  complete.go
gopls.go  gomod.go  quickfix.go  errfilter.go  liner.go
terminal_unix.go  terminal_windows.go  option.go
log.go  debug.go  nodebug.go  utils.go  command_name.go
Makefile  Dockerfile  go.mod  go.sum  LICENSE  README.md

Several root files have a _test.go sibling, and a Makefile drives build, test and lint. Some of the file names map straight onto the behaviour: liner.go wraps the peterh/liner dependency, quickfix.go matches github.com/motemen/go-quickfix, and the terminal handling is split into terminal_unix.go and terminal_windows.go. segmentio/encoding v0.5.4, segmentio/asm v1.2.1 and go.uber.org/zap v1.28.0 sit in the indirect block of go.mod. The build target strips symbols with -s -w and stamps the short revision into cli.revision.

The Makefile tests without -race and lints with one check off

The Makefile is where the project's own opinions show. The test target runs go test -v ./... and carries a comment on the same line: it does not use -race, which increases the duration much. That is a deliberate speed trade in the test suite rather than in the REPL. The lint target runs go vet ./... and then staticcheck with -checks all,-ST1000, so every staticcheck check is on except the package comment rule. Release handling is automated through three tools the Makefile installs on demand: gobump from github.com/x-motemen/gobump for show-version and bump, goxz from Songmu for the cross target, and gocredits for the CREDITS file, which runs go mod tidy first. The bump target refuses to run on a dirty tree and refuses any branch other than main, then tags v$(VERSION) and pushes with --atomic, so a half-finished release cannot land. The Docker build reuses the same path: make install plus go install of gopls, with CGO_ENABLED=0, and then both binaries are moved into /usr/local/bin.

v0.7.0 in July 2026, and the alternatives note is about speed

The tags are few and spread out: v0.6.1 on 2025-06-21, v0.6.2 on 2026-06-16, and v0.7.0 on 2026-07-30. The last push to the default branch, main, is dated 2026-07-30 and the repository is not archived, so the code is still being worked on rather than left in place. That matters when reading the caveat about other REPLs being more actively maintained, because the two statements sit side by side: the author is shipping tags while telling you that a different tool suits you better. Read the caveat as a statement about the execution model, not as a shutdown notice. Two names are credited as authors, motemen and itchyny, and the release titles are plain Release v0.7.0, which tells you nothing about scope. What the tag list does not tell you is which behaviour changed between v0.6.2 and v0.7.0; nothing in the repository summarises it for you.

Editorial conclusion

gore suits a reader who wants a REPL that reads the modules already in the current directory, needs no go get step for a remote package, and starts from one go install, and who does not mind waiting for each line to run. It is a poor fit for anything that measures time inside the REPL, because every line is evaluated repeatedly, and the project sends speed-sensitive users to gomacro or yaegi. Before installing, confirm a Go toolchain is on the machine, since no standalone binary is distributed, and install gopls separately if you want completion outside the Docker image.

Frequently asked questions

Why is gore slow at the prompt?

It evaluates each input with go run, and the project's own notes say every line entered is evaluated repeatedly (issue #67) and that this makes execution fairly slow (issue #182). The same note points at gomacro and yaegi for anyone who needs a faster REPL.

Does gore ship a binary, and what does it need for completion?

No standalone binary is distributed, because the gore command requires Go toolchains on runtime; the install is go install github.com/x-motemen/gore/cmd/gore@latest. Code completion requires gopls, installed on its own with go install golang.org/x/tools/gopls@latest, and the Docker image already contains it.

Where does gore keep its history and what does GORE_PAGER change?

GORE_HOME is the directory for the command history file, defaulting to $XDG_DATA_HOME/gore or ~/.gore when XDG_DATA_HOME is unset. GORE_PAGER is the pager used for :doc output, for example less, and with it unset documents print directly instead.

What do the gore REPL commands :type, :print and :write do?

:type <expr> prints the type of an expression, :print shows the current source, and :write writes the current source out to a file. :doc shows a document, :clear clears the codes, and :verbose toggles the printing of assigned or declared values.

Official sources

  1. Issues
  2. License: MIT
  3. README
  4. Releases
  5. x-motemen/gore on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/x-motemen-gore.svg)](https://hysenlabs.com/projects/x-motemen-gore)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/x-motemen-gore.svg)](https://hysenlabs.com/projects/x-motemen-gore)

Was this useful?