MCPcopy
hub / github.com/x-motemen/gore

github.com/x-motemen/gore @v0.6.2 sqlite

repository ↗ · DeepWiki ↗ · release v0.6.2 ↗
168 symbols 694 edges 30 files 28 documented · 17%
README

gore

CI Status MIT License release

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

Screencast

(Screencast taken with cho45/KeyCast)

Usage

gore

After a prompt is shown, enter any Go expressions/statements/functions or commands described below.

To quit the session, type Ctrl-D or use :q command.

Features

  • Line editing with history
  • Multi-line input
  • Package importing with completion
  • Evaluates any expressions, statements and function declarations
  • No "evaluated but not used" errors
  • Code completion (requires gopls)
  • Showing documents
  • Auto-importing (gore -autoimport)

REPL Commands

Some functionalities are provided as commands in the REPL:

:import <package path>  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
:help                   List commands
:quit                   Quit the session

Installation

The gore command requires Go tool-chains on runtime, so standalone binary is not distributed.

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

Make sure $GOPATH/bin is in your $PATH.

Also recommended:

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

Or you can use Docker:

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

FAQ/Caveats

  • gore runs code using go run for each input. Every line entered is evaluated repeatedly (#67), so you can't bind the evaluated time by time.Now(), for example. This implementation also makes the execution fairly slow (#182). This project started from a simple idea to use go run for all REPL input. I think this project has provided some value for Go users, but these days there are other REPL implementations that are more actively maintained and run faster. I recommend using gomacro or yaegi.
  • gore support Go modules. You can load local modules when you start gore at the project directory. You don't need to go get to check the usage of a remote repository, :import github.com/... will automatically download that module. Also, you don't need to go get the pretty print module anymore. If you want to load a local code from $GOPATH, you need to create the modules file (go mod init ...) and then start gore at the project directory.

License

The MIT License.

Author

Extension points exported contracts — how you extend this code

Option (FuncType)
Option for Gore
option.go

Core symbols most depended-on inside this repo

String
called by 76
command_name.go
Eval
called by 47
session.go
debugf
called by 31
debug.go
NewSession
called by 31
session.go
Clear
called by 30
session.go
completeWord
called by 21
complete.go
errorf
called by 13
log.go
Close
called by 10
gopls.go

Shape

Function 92
Method 56
Struct 15
TypeAlias 4
FuncType 1

Languages

Go100%

Modules by API surface

session.go34 symbols
session_test.go18 symbols
gopls.go13 symbols
commands.go13 symbols
terminal_windows.go9 symbols
liner.go8 symbols
commands_test.go8 symbols
session_gomod_test.go7 symbols
gomod.go7 symbols
option.go6 symbols
quickfix.go5 symbols
errfilter.go5 symbols

Dependencies from manifests, versioned

github.com/clipperhouse/uax29/v2v2.7.0 · 1×
github.com/davecgh/go-spewv1.1.1 · 1×
github.com/mattn/go-runewidthv0.0.24 · 1×
github.com/motemen/go-quickfixv0.0.0-2025022407542 · 1×
github.com/peterh/linerv1.2.2 · 1×
github.com/pmezard/go-difflibv1.0.0 · 1×
github.com/segmentio/asmv1.2.1 · 1×
github.com/segmentio/encodingv0.5.4 · 1×
go.lsp.dev/jsonrpc2v0.10.0 · 1×
go.lsp.dev/pkgv0.0.0-2021071709034 · 1×
go.lsp.dev/protocolv0.12.0 · 1×

For agents

$ claude mcp add gore \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact