MCPcopy Index your code
hub / github.com/alajmo/sake

github.com/alajmo/sake @v0.15.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.15.1 ↗ · + Follow
518 symbols 1,367 edges 66 files 80 documented · 15%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

sake

version

build status

license

Go Report Card

reference

sake is a command runner for local and remote hosts. You define servers and tasks in sake.yaml file and then run the tasks on the servers.

This readme is also accessible on sakecli.com.

sake has tons of features:

  • auto-completion of tasks, servers and tags
  • SSH into servers or docker containers sake ssh <server>
  • list servers/tasks via sake list servers|tasks
  • present task output in a compact table format sake run <task> --output table
  • open task/server in your preferred editor sake edit task <task>
  • import other sake.yaml configs
  • and many more!

demo

Interested in managing your git repositories in a similar way? Check out mani!

Table of Contents

Installation

Packaging status

sake is available on Linux and Mac.

  • Binaries are available on the release page

  • via cURL sh curl -sfL https://raw.githubusercontent.com/alajmo/sake/main/install.sh | sh

  • via Homebrew sh brew tap alajmo/sake brew install sake

  • via MacPorts sh sudo port install sake

  • via Arch sh pacman -S sake

  • via pkg sh pkg install sake

  • Via Go sh go install github.com/alajmo/sake@latest

Auto-completion is available via sake completion bash|zsh|fish and man page via sake gen.

Building From Source

Requires go 1.19 or above.

  1. Clone the repo
  2. Build and run the executable ```sh make build && ./dist/sake

    To build for all target platforms run (requires goreleaser CLI)

    make build-all ```

Usage

Create a New Sake Config

Run the following command:

$ sake init

Initialized sake in /tmp/sake
- Created sake.yaml

Following servers were added to sake.yaml

 Server    | Host
-----------+---------
 localhost | 0.0.0.0

Run Some Commands

# List all servers
$ sake list servers

 Server    | Host
-----------+---------
 localhost | 0.0.0.0

# List all tasks
$ sake list tasks

 Task | Description
------+-------------
 ping | Pong

# Run Task
$ sake run ping --all

TASK ping: Pong ************

0.0.0.0 | pong

# Count number of files in each server in parallel
$ sake exec --all --output table --strategy=free 'find . -type f | wc -l'

 Server    | Output
-----------+--------
 localhost | 1

What's Next

Check out the examples page for more advanced examples and the recipes page for a list of useful recipes.

Documentation

License

The MIT License (MIT)

Copyright (c) 2022 Samir Alajmovic

Extension points exported contracts — how you extend this code

Items (Interface)
(no doc) [6 implementers]
core/dao/theme.go
SSHDialFunc (FuncType)
SSHDialFunc can dial an ssh server and return a client
core/run/ssh.go
Resource (Interface)
(no doc) [7 implementers]
core/dao/common.go
Client (Interface)
(no doc) [2 implementers]
core/run/client.go

Core symbols most depended-on inside this repo

CheckIfError
called by 125
core/errors.go
Ptr
called by 94
core/utils.go
CheckEqS
called by 44
core/test/utils.go
String
called by 43
core/dao/task.go
CheckErr
called by 30
core/test/utils.go
FilterServers
called by 26
core/dao/server.go
printStringField
called by 23
core/print/print_block.go
printBoolField
called by 18
core/print/print_block.go

Shape

Function 227
Method 183
Struct 101
Interface 3
TypeAlias 3
FuncType 1

Languages

Go100%

Modules by API surface

core/errors.go66 symbols
core/run/ssh.go32 symbols
core/dao/server.go32 symbols
core/dao/import_config.go25 symbols
core/dao/task.go20 symbols
core/run/exec.go19 symbols
core/run/text.go18 symbols
core/dao/config.go18 symbols
core/utils.go17 symbols
core/ssh_config.go17 symbols
core/dao/theme.go17 symbols
core/run/client.go16 symbols

For agents

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

⬇ download graph artifact