Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tjamet/goterm2
Go implementation of the python iterm2 library
https://github.com/tjamet/goterm2
experimental extensions golang-library iterm2
Last synced: 8 days ago
JSON representation
Go implementation of the python iterm2 library
- Host: GitHub
- URL: https://github.com/tjamet/goterm2
- Owner: tjamet
- License: bsd-3-clause
- Created: 2019-08-16T15:12:28.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-10-02T10:19:35.000Z (about 5 years ago)
- Last Synced: 2024-06-20T11:59:45.050Z (5 months ago)
- Topics: experimental, extensions, golang-library, iterm2
- Language: Go
- Size: 354 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Golang implementation of iterm2 python's remote API
[![GoDoc](https://godoc.org/github.com/tjamet/goterm2?status.svg)](http://godoc.org/github.com/tjamet/goterm2)
# Notice
The code is in early stage and the repository currently doesn't offer all features provided by the [python reference implementation](https://github.com/gnachman/iTerm2/tree/master/api/library/python/iterm2)
The provided primitives are currently low level
# Usage
To list all current iterm sessions, copy the following lines
```
package mainimport (
"fmt"
"os"log "github.com/sirupsen/logrus"
iterm2 "github.com/tjamet/goterm2"
"github.com/tjamet/goterm2/api"
)func main() {
logger := log.New()
logger.SetOutput(os.Stdout)
logger.SetLevel(log.TraceLevel)
i, err := iterm2.New()
if err != nil {
fmt.Println(err)
os.Exit(1)
}
i.Logger(logger)
fmt.Println(i.ListSessions(&api.ListSessionsRequest{}))
}
```This library requires your iterm to be configured to run the `Python API` in the menus: `iTerm2` > `Preferences` > `general` > `magic`
as shown below![](img/settings.png)
You will then need to accept the connection as shown below
![](img/accept.png)