jack

package module
v0.0.0-...-d14d940 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2026 License: MIT Imports: 20 Imported by: 0

README

jack

CI Status codecov Go Report Card CodeQL Go Reference License Go Version Release

CLI for managing agentic development sessions for zoobz.io

Documentation

Overview

Package jack provides a CLI for managing agentic development sessions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachSession

func AttachSession(name string) error

AttachSession attaches to an existing tmux session, taking over the terminal.

func CreateSession

func CreateSession(name, dir, shellCmd string) error

CreateSession creates a detached tmux session running the given shell command in the given directory.

func Execute

func Execute()

Execute runs the root command.

func HasSession

func HasSession(name string) bool

HasSession checks whether a tmux session with the given name exists.

func KillSession

func KillSession(name string) error

KillSession terminates a tmux session.

func SessionName

func SessionName(team, repo string) string

SessionName builds the canonical tmux session name for a team and repo.

Types

type BoardProvisioner

type BoardProvisioner func(token, sessionName string) error

BoardProvisioner joins the global board and announces presence.

type Cloner

type Cloner func(url, dir string) error

Cloner clones a git repository into a directory.

type Config

type Config struct {
	Profiles map[string]Profile `yaml:"profiles"`
	Matrix   MatrixConfig       `yaml:"matrix"`
}

Config represents the top-level YAML configuration.

func (Config) Validate

func (c Config) Validate() error

Validate checks the Config for internal consistency.

type DepartureAnnouncer

type DepartureAnnouncer func(token, sessionName string) error

DepartureAnnouncer posts a departure message to the global board.

type DescriptionWriter

type DescriptionWriter func(path, content string) error

DescriptionWriter writes a session description to a file.

type Env

type Env struct {
	ConfigDir string `env:"JACK_CONFIG_DIR" default:"~/.config/jack"`
	DataDir   string `env:"JACK_DATA_DIR"   default:"~/.jack"`
}

Env holds path overrides loaded from environment variables via fig.

func (*Env) Validate

func (e *Env) Validate() error

Validate ensures the configured directories are valid paths.

type FileLinker

type FileLinker func(src, dst string) error

FileLinker symlinks a file from src to dst.

type GitConfig

type GitConfig struct {
	Name  string `yaml:"name"`
	Email string `yaml:"email"`
}

GitConfig holds git identity settings.

type GitHubConfig

type GitHubConfig struct {
	User string `yaml:"user"`
}

GitHubConfig holds GitHub account settings.

type KeyAdder

type KeyAdder func(key string) error

KeyAdder adds an SSH key to the agent.

type Lister

type Lister func() ([]TmuxSession, error)

Lister retrieves tmux sessions.

type MatrixConfig

type MatrixConfig struct {
	Homeserver        string `yaml:"homeserver"`
	RegistrationToken string `yaml:"registration_token"`
}

MatrixConfig holds Matrix homeserver connection settings.

type Profile

type Profile struct {
	Git    GitConfig    `yaml:"git"`
	GitHub GitHubConfig `yaml:"github"`
	SSH    SSHConfig    `yaml:"ssh"`
}

Profile represents a git/GitHub/SSH identity.

type ProjectSelector

type ProjectSelector func(team string, repos []string) (string, error)

ProjectSelector prompts the user to select a project for a team.

type Registry

type Registry struct {
	Projects []RegistryEntry `yaml:"projects"`
}

Registry tracks which repos have been cloned for which teams.

func (*Registry) Add

func (r *Registry) Add(team, repo, url string)

Add records a new project entry, replacing any existing entry for the same team+repo.

func (*Registry) Find

func (r *Registry) Find(team, repo string) *RegistryEntry

Find returns the entry for a given team+repo, or nil if not found.

func (*Registry) ForTeam

func (r *Registry) ForTeam(team string) []RegistryEntry

ForTeam returns all entries for the given team, sorted by repo name.

func (*Registry) Remove

func (r *Registry) Remove(team, repo string)

Remove deletes the entry for a given team+repo if it exists.

func (*Registry) ReposForTeam

func (r *Registry) ReposForTeam(team string) []string

ReposForTeam returns a sorted list of repo names for the given team.

func (*Registry) Teams

func (r *Registry) Teams() []string

Teams returns a sorted list of unique team names in the registry.

type RegistryEntry

type RegistryEntry struct {
	ClonedAt time.Time `yaml:"cloned_at"`
	Team     string    `yaml:"team"`
	Repo     string    `yaml:"repo"`
	URL      string    `yaml:"url"`
}

RegistryEntry records a cloned project for a team.

type RegistryLoader

type RegistryLoader func() (*Registry, error)

RegistryLoader loads the registry from disk.

type RegistrySaver

type RegistrySaver func(*Registry) error

RegistrySaver persists the registry to disk.

type SSHConfig

type SSHConfig struct {
	Key string `yaml:"key"`
}

SSHConfig holds SSH key settings.

type SessionAttacher

type SessionAttacher func(name string) error

SessionAttacher attaches to a tmux session.

type SessionChecker

type SessionChecker func(string) bool

SessionChecker reports whether a tmux session exists.

type SessionCreator

type SessionCreator func(name, dir, shellCmd string) error

SessionCreator creates a detached tmux session.

type SessionInfo

type SessionInfo struct {
	Team string
	Repo string
	TmuxSession
}

SessionInfo is a parsed jack-managed session with team and repo extracted.

type SessionKiller

type SessionKiller func(name string) error

SessionKiller terminates a tmux session.

type TeamSelector

type TeamSelector func(teams []string) (string, error)

TeamSelector prompts the user to select a team.

type TmuxSession

type TmuxSession struct {
	Name     string
	Created  time.Time
	Activity time.Time
	Path     string
	Attached bool
	Windows  int
}

TmuxSession represents a single tmux session as reported by tmux.

func ListSessions

func ListSessions() ([]TmuxSession, error)

ListSessions calls tmux list-sessions and returns all tmux sessions. Returns an empty slice (not an error) if the tmux server is not running.

type TokenDecrypter

type TokenDecrypter func(privKeyPath, agePath string) (string, error)

TokenDecrypter decrypts an age-encrypted file using an SSH private key and returns the plaintext token.

type TokenEncrypter

type TokenEncrypter func(token, pubKeyPath, outPath string) error

TokenEncrypter encrypts a plaintext token using an SSH public key and writes the ciphertext to the given path.

type TokenReader

type TokenReader func(team, project string) string

TokenReader reads the Matrix token for a session from the env file.

Directories

Path Synopsis
Package msg provides Matrix messaging commands for jack.
Package msg provides Matrix messaging commands for jack.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL