devflow

package module
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: MIT Imports: 12 Imported by: 0

README

DevFlow

Project Badges

Automated Git and Go workflows with minimal output.

Commands

  • gotest - Run tests, vet, race detection, and coverage
  • push - Git add, commit, tag, and push
  • gopush - Complete workflow: test + push + update dependents
  • devbackup - Configure and execute automated backups

Installation

go install github.com/tinywasm/devflow/cmd/gotest@latest
go install github.com/tinywasm/devflow/cmd/push@latest
go install github.com/tinywasm/devflow/cmd/gopush@latest
go install github.com/tinywasm/devflow/cmd/devbackup@latest

Quick Start

# Test your project
gotest

# Push changes
push "fix: bug correction"

# Test + push + update dependents
gopush "feat: new feature"

Library Usage

import "github.com/tinywasm/devflow"

// Git workflow
git := devflow.NewGit()
summary, _ := git.Push("commit message", "v1.0.0")

// Go project workflow
goHandler := devflow.NewGo(git)
summary, _ := goHandler.Push("commit message", "", false, false, "..")

// Optional: Enable logging for debugging
git.SetLog(log.Println)
goHandler.SetLog(log.Println)

Features

  • Zero configuration - Auto-detects test types and project structure
  • Minimal output - Single-line summaries optimized for LLM/MCP contexts
  • Smart defaults - Auto-generates tags, detects WASM tests, filters output
  • Dependent updates - Automatically updates modules that depend on yours

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunCommand

func RunCommand(name string, args ...string) (string, error)

RunCommand executes a shell command It returns the output (trimmed) and an error if the command fails

func RunCommandSilent

func RunCommandSilent(name string, args ...string) (string, error)

RunCommandSilent executes a command (alias for RunCommand now, as RunCommand is also silent on success) kept for backward compatibility if needed, or we can remove it. The previous implementation was identical except for logging.

func RunShellCommand added in v0.0.10

func RunShellCommand(command string) (string, error)

RunShellCommand executes a shell command in a cross-platform way On Windows: uses cmd.exe /C On Unix (Linux/macOS): uses sh -c

Types

type Bashrc added in v0.0.10

type Bashrc struct {
	// contains filtered or unexported fields
}

Bashrc handles updates to .bashrc file using markers

func NewBashrc added in v0.0.10

func NewBashrc() *Bashrc

NewBashrc creates a new Bashrc handler for ~/.bashrc

func (*Bashrc) Get added in v0.0.10

func (b *Bashrc) Get(key string) (string, error)

Get reads a variable value from .bashrc file

func (*Bashrc) Set added in v0.0.10

func (b *Bashrc) Set(key, value string) error

Set updates or creates a variable in .bashrc If value is empty, removes the variable

type ConsoleFilter

type ConsoleFilter struct {
	// contains filtered or unexported fields
}

ConsoleFilter buffers console output and filters out passing tests when in quiet mode.

func NewConsoleFilter

func NewConsoleFilter(quiet bool, output func(string)) *ConsoleFilter

func (*ConsoleFilter) Add

func (cf *ConsoleFilter) Add(input string)

func (*ConsoleFilter) Flush

func (cf *ConsoleFilter) Flush()

type DevBackup added in v0.0.10

type DevBackup struct {
	// contains filtered or unexported fields
}

DevBackup handles backup operations

func NewDevBackup added in v0.0.10

func NewDevBackup() *DevBackup

NewDevBackup creates a new DevBackup instance

func (*DevBackup) GetCommand added in v0.0.10

func (d *DevBackup) GetCommand() (string, error)

GetCommand retrieves the backup command First checks environment variable, then falls back to .bashrc

func (*DevBackup) Run added in v0.0.10

func (d *DevBackup) Run() (string, error)

Run executes the backup command asynchronously Returns a message for the summary or empty string if not configured

func (*DevBackup) SetCommand added in v0.0.10

func (d *DevBackup) SetCommand(command string) error

SetCommand sets the backup command in .bashrc and current environment

type Git

type Git struct {
	// contains filtered or unexported fields
}

Git handler for Git operations

func NewGit

func NewGit() *Git

NewGit creates a new Git handler

func (*Git) GenerateNextTag

func (g *Git) GenerateNextTag() (string, error)

GenerateNextTag calculates the next semantic version

func (*Git) GetLatestTag

func (g *Git) GetLatestTag() (string, error)

GetLatestTag gets the latest tag

func (*Git) Push

func (g *Git) Push(message, tag string) (string, error)

Push executes the complete push workflow (add, commit, tag, push) Returns a summary of operations and error if any.

func (*Git) SetLog

func (g *Git) SetLog(fn func(...any))

SetLog sets the logger function

type Go

type Go struct {
	// contains filtered or unexported fields
}

Go handler for Go operations

func NewGo

func NewGo(gitHandler *Git) *Go

NewGo creates a new Go handler

func (*Go) Push

func (g *Go) Push(message, tag string, skipTests, skipRace bool, searchPath string) (string, error)

Push executes the complete workflow for Go projects Parameters:

message: Commit message
tag: Optional tag
skipTests: If true, skips tests
skipRace: If true, skips race tests
searchPath: Path to search for dependent modules (default: "..")

func (*Go) SetLog

func (g *Go) SetLog(fn func(...any))

SetLog sets the logger function

func (*Go) Test

func (g *Go) Test(verbose bool) (string, error)

Test executes the test suite for the project

Directories

Path Synopsis
cmd
devbackup command
gopush command
gotest command
push command

Jump to

Keyboard shortcuts

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