MCPcopy Index your code
hub / github.com/Ali-aqrabawi/gomiko

github.com/Ali-aqrabawi/gomiko @v0.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.0 ↗ · + Follow
229 symbols 533 edges 35 files 8 documented · 3%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Gomiko

Build Status GolangCI published

Gomiko is a Go implementation of netmiko. It serves as multi-vendor networking SDK that helps communicate and execute commands via an interactive shell without needing to care about handling device prompts and terminal modes.

Supports

  • Cisco IOS
  • Cisco IOS XR
  • Cisco ASA
  • Cisco NX-OS
  • Mikrotik RouterOS
  • Arista EOS
  • Juniper JunOS

Installation

get gomiko pkg: go get -u github.com/Ali-aqrabawi/gomiko/pkg.

Examples :

import (
    "fmt"
    "log"
    "github.com/Ali-aqrabawi/gomiko/pkg"
)

func main() {

     device, err := gomiko.NewDevice("192.168.1.1", "admin", "password", "cisco_ios", 22)

     if err != nil {
        log.Fatal(err)
     }

     //Connect to device
     if err := device.Connect(); err != nil {
        log.Fatal(err)
     }

     // send command
     output1, _ := device.SendCommand("show vlan")

     // send a set of config commands
     commands := []string{"vlan 120", "name v120"}
     output2, _ := device.SendConfigSet(commands)

     device.Disconnect()

     fmt.Println(output1)
     fmt.Println(output2)

}

create device with enable password:

import (
    "fmt"
    "log"
    "github.com/Ali-aqrabawi/gomiko/pkg"
)

func main() {

     device, err := gomiko.NewDevice("192.168.1.1", "admin", "password", "cisco_ios", 22, gomiko.SecretOption("enablePass"))

     if err != nil {
        log.Fatal(err)
     }     

}

create device with custom timeout:

import (
    "fmt"
    "log"
    "github.com/Ali-aqrabawi/gomiko/pkg"
)

func main() {

     device, err := gomiko.NewDevice("192.168.1.1", "admin", "password", "cisco_ios", 22, gomiko.SecretOption("enablePass"), gomiko.TimeoutOption(10))

     if err != nil {
        log.Fatal(err)
     }     

}

Extension points exported contracts — how you extend this code

Device (Interface)
(no doc) [11 implementers]
pkg/types/device.go
IDriver (Interface)
(no doc) [5 implementers]
pkg/driver/driverFactory.go
Connection (Interface)
(no doc) [3 implementers]
pkg/connections/connection.go
DeviceOption (FuncType)
(no doc)
pkg/options.go
CiscoDevice (Interface)
(no doc) [8 implementers]
pkg/types/device.go

Core symbols most depended-on inside this repo

SendCommand
called by 28
pkg/types/device.go
Connect
called by 18
pkg/types/device.go
Disconnect
called by 18
pkg/types/device.go
SendConfigSet
called by 14
pkg/types/device.go
SetTimeout
called by 9
pkg/types/device.go
SetSecret
called by 6
pkg/types/device.go
NewDriver
called by 5
pkg/driver/driverFactory.go
Read
called by 4
pkg/connections/connection.go

Shape

Method 141
Function 64
Struct 19
Interface 4
FuncType 1

Languages

Go100%

Modules by API surface

pkg/lib/arista/eos_test.go19 symbols
pkg/driver/driver_test.go16 symbols
pkg/types/device.go13 symbols
pkg/lib/cisco/base_test.go13 symbols
pkg/lib/mikrotik/routerOS_test.go12 symbols
pkg/lib/juniper/junos_test.go12 symbols
pkg/lib/cisco/asa_test.go11 symbols
pkg/driver/driver.go10 symbols
pkg/driver/driverFactory.go9 symbols
pkg/lib/cisco/base.go8 symbols
pkg/connections/ssh.go8 symbols
pkg/lib/sros/sros.go7 symbols

For agents

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

⬇ download graph artifact