MCPcopy Index your code
hub / github.com/d3witt/viking

github.com/d3witt/viking @v0.2.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.2.1 ↗ · + Follow
122 symbols 347 edges 31 files 5 documented · 4%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Viking 🗺️

Simple way to manage your remote machines

Bare metal servers are awesome. They let you pick where to run your software and how to deploy it. You get full control to make the most of the server's resources. No limits, no compromises. That's real freedom.

Viking makes it easier to work with them.

NAME:
   viking - Manage your SSH keys and remote machines

USAGE:
   viking [global options] command [command options]

VERSION:
   v1.0

COMMANDS:
    exec      Execute shell command on machine
    copy, cp  Copy files/folders between local and remote machine
    key       Manage SSH keys
    machine   Manage your machines
    config    Get config directory path
    help, h   Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h     show help
   --version, -v  print the version

🚀 Installation

See releases for pre-built binaries.

On Unix:

env CGO_ENABLED=0 go install -ldflags="-s -w" github.com/d3witt/viking@latest

On Windows cmd:

set CGO_ENABLED=0
go install -ldflags="-s -w" github.com/d3witt/viking@latest

On Windows powershell:

$env:CGO_ENABLED = '0'
go install -ldflags="-s -w" github.com/d3witt/viking@latest

📄 Usage

🛰️ Add machine:

$ viking machine add --name deathstar --key starkey 168.112.216.50 root@61.22.128.69:3000 73.30.62.32:3001
Machine deathstar added.

[!NOTE] The key flag is not required. If a key is not specified, SSH Agent will be used to connect to the server.

📡 Exec command (in parallel on all machines):

$ viking exec deathstar echo 1234
168.112.216.50: 1234
61.22.128.69: 1234
73.30.62.32: 1234

📺 Connect to the machine:

$ viking exec --tty deathstar /bin/bash
root@deathstar:~$

🗂️ Copy files/directories (in parallel to/from all machines):

$ viking cp /tmp/file.txt deathstar:/tmp/
Success: 3, Errors: 0

🔑 Add SSH key from a file

$ viking key add --name starkey --passphrase dart ./id_rsa_star
Key starkey added.

🆕 Generate SSH Key

$ viking key generate --name starkey2
Key starkey2 added.

📋 Copy public SSH Key

$ viking key copy starkey2
Public key copied to your clipboard.

⚙️ Custom config directory

Viking saves data locally. Set VIKING_CONFIG_DIR env variable for a custom directory. Use viking config to check the current config folder.

🤝 Missing a Feature?

Feel free to open a new issue, or contact me.

📘 License

Viking is provided under the MIT License.

Extension points exported contracts — how you extend this code

Executor (Interface)
(no doc) [1 implementers]
sshexec/executor.go

Core symbols most depended-on inside this repo

Close
called by 17
sshexec/executor.go
String
called by 14
sshexec/cmd.go
Wait
called by 6
sshexec/executor.go
Run
called by 6
sshexec/cmd.go
Addr
called by 5
sshexec/executor.go
Command
called by 5
sshexec/cmd.go
GetKeyByName
called by 5
config/key.go
Save
called by 4
config/config.go

Shape

Function 62
Method 44
Struct 15
Interface 1

Languages

Go100%

Modules by API surface

sshexec/executor.go18 symbols
sshexec/cmd.go13 symbols
config/config_file.go11 symbols
cli/command/machine/copy.go7 symbols
config/machine.go6 symbols
streams/stream.go5 symbols
streams/out.go5 symbols
config/key.go5 symbols
cli/command/machine/execute.go5 symbols
streams/in.go4 symbols
archive/tar.go4 symbols
sshexec/client.go3 symbols

For agents

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

⬇ download graph artifact

Ask about this repo answers extend the page