Skip to content

Commit 6d8a44e

Browse files
committed
Prepare v1.0.0 release
- Remove emojis from documentation for professional tone - Add release script with automated tag management and GitHub release creation - Fix CI/CD pipeline (Go version, Windows compatibility, linting) - Add golangci-lint configuration - Format all Go files with gofmt - Update documentation with accurate Cobra feature comparison and roadmap
1 parent def1a3f commit 6d8a44e

10 files changed

Lines changed: 259 additions & 59 deletions

File tree

.github/workflows/ci.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,14 @@ jobs:
3131
run: go build -v ./...
3232

3333
- name: Test
34-
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
34+
shell: bash
35+
run: go test -v -race -coverprofile=coverage.out -covermode=atomic ./...
3536

3637
- name: Upload coverage
3738
if: matrix.os == 'ubuntu-latest' && matrix.go == '1.23'
3839
uses: codecov/codecov-action@v4
3940
with:
40-
file: ./coverage.txt
41+
file: ./coverage.out
4142

4243
lint:
4344
name: Lint
@@ -52,6 +53,9 @@ jobs:
5253
with:
5354
go-version: '1.23'
5455

56+
- name: Get dependencies
57+
run: go mod download
58+
5559
- name: golangci-lint
5660
uses: golangci/golangci-lint-action@v4
5761
with:
@@ -70,6 +74,9 @@ jobs:
7074
with:
7175
go-version: '1.23'
7276

77+
- name: Get dependencies
78+
run: go mod download
79+
7380
- name: Build demo example
7481
run: |
7582
cd examples/basic

.golangci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
linters:
2+
enable:
3+
- gofmt
4+
- govet
5+
- staticcheck
6+
- ineffassign
7+
- misspell
8+
disable:
9+
- errcheck
10+
- unused
11+
12+
linters-settings:
13+
govet:
14+
check-shadowing: true
15+
16+
issues:
17+
exclude-use-default: false
18+
max-issues-per-linter: 0
19+
max-same-issues: 0
20+
21+
run:
22+
timeout: 5m
23+
go: '1.21'

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
## [1.0.0] - 2025-01-04
1111

1212
### Added
13-
- Initial release of Mamba 🐍
13+
- Initial release of Mamba
1414
- 100% drop-in replacement for Cobra with the same API
1515
- Modern styled output with lipgloss integration
1616
- `PrintSuccess()`, `PrintError()`, `PrintWarning()`, `PrintInfo()`

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contributing to Mamba
22

3-
Thank you for your interest in contributing to Mamba! 🐍
3+
Thank you for your interest in contributing to Mamba.
44

55
## Code of Conduct
66

@@ -148,10 +148,10 @@ When adding new features:
148148

149149
Mamba is a **100% drop-in replacement** for Cobra. When making changes:
150150

151-
- All Cobra APIs must continue to work
152-
- Behavior should match Cobra unless enhancing UX
153-
- New features should be additive, not breaking
154-
- Test with real Cobra code to verify compatibility
151+
- All Cobra APIs must continue to work
152+
- Behavior should match Cobra unless enhancing UX
153+
- New features should be additive, not breaking
154+
- Test with real Cobra code to verify compatibility
155155

156156
## Release Process
157157

README.md

Lines changed: 93 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,29 @@
1-
# 🐍 Mamba
1+
# Mamba
22

33
[![Go Reference](https://pkg.go.dev/badge/github.com/base-go/mamba.svg)](https://pkg.go.dev/github.com/base-go/mamba)
44
[![Go Report Card](https://goreportcard.com/badge/github.com/base-go/mamba)](https://goreportcard.com/report/github.com/base-go/mamba)
55
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
66

7-
A modern, **100% drop-in replacement** for [Cobra](https://github.com/spf13/cobra) with enhanced terminal features including beautiful colored output, interactive prompts, loading spinners, and progress bars.
7+
A modern, **drop-in replacement** for [Cobra](https://github.com/spf13/cobra) with enhanced terminal features including beautiful colored output, interactive prompts, loading spinners, and progress bars.
88

9-
> **Fast, elegant, and powerful** - just like the snake! 🐍
9+
> **Fast, elegant, and powerful** - just like the snake.
1010
1111
## Features
1212

13-
-**100% Cobra Compatible** - Drop-in replacement with the same API
14-
- 🎨 **Modern Styled Output** - Beautiful colors and formatting using [lipgloss](https://github.com/charmbracelet/lipgloss)
15-
- 💬 **Interactive Prompts** - User-friendly input prompts with [huh](https://github.com/charmbracelet/huh)
16-
-**Loading Spinners** - Visual feedback for long-running operations
17-
- 📊 **Progress Bars** - Track progress for batch operations
18-
- 🎯 **Styled Help Messages** - Enhanced help output with colors and structure
19-
- 🔧 **Full Flag Support** - Compatible with [pflag](https://github.com/spf13/pflag)
13+
**Core Cobra Compatibility:**
14+
- **Subcommands & Nesting** - Full support for complex CLI hierarchies
15+
- **POSIX Flags** - Short & long flags via [pflag](https://github.com/spf13/pflag)
16+
- **Command Aliases** - Multiple names for the same command
17+
- **Lifecycle Hooks** - PreRun, PostRun, and persistent variants
18+
- **Argument Validation** - Built-in validators (ExactArgs, MinimumNArgs, etc.)
19+
- **Help Generation** - Automatic -h, --help with enhanced styling
20+
21+
**Modern Terminal Features:**
22+
- **Styled Output** - Beautiful colors and formatting using [lipgloss](https://github.com/charmbracelet/lipgloss)
23+
- **Interactive Prompts** - User-friendly input with [huh](https://github.com/charmbracelet/huh)
24+
- **Loading Spinners** - Visual feedback for long-running operations
25+
- **Progress Bars** - Track progress for batch operations
26+
- **Enhanced Help** - Colored, structured help messages
2027

2128
## Demo
2229

@@ -29,11 +36,11 @@ go run main.go
2936
```
3037

3138
The demo showcases:
32-
- 🎨 Styled output (success, error, warning, info)
33-
- Loading spinners with animations
34-
- 📊 Progress bars for batch operations
35-
- 💬 Interactive prompts
36-
- 🎯 Modern help messages
39+
- Styled output (success, error, warning, info)
40+
- Loading spinners with animations
41+
- Progress bars for batch operations
42+
- Interactive prompts
43+
- Modern help messages
3744

3845
## Installation
3946

@@ -101,22 +108,49 @@ var rootCmd = &mamba.Command{
101108

102109
That's it! Your existing Cobra code will work seamlessly with Mamba, but you now have access to modern terminal features.
103110

111+
## Cobra Compatibility
112+
113+
Mamba implements all core Cobra features:
114+
115+
**Fully Supported:**
116+
- Subcommand-based CLIs (app server, app fetch, etc.)
117+
- POSIX-compliant flags (short & long versions via pflag)
118+
- Nested subcommands
119+
- Global, local, and cascading flags
120+
- Automatic help generation with -h, --help
121+
- Command aliases
122+
- Lifecycle hooks (PreRun, PostRun, etc.)
123+
- Argument validators (ExactArgs, MinimumNArgs, etc.)
124+
- Custom help and usage functions
125+
- Context support
126+
127+
**Not Yet Implemented:**
128+
- Intelligent suggestions ("did you mean...?")
129+
- Shell autocomplete generation (bash, zsh, fish, powershell)
130+
- Man page generation
131+
- Command grouping in help
132+
- Viper integration for config files
133+
104134
## Mamba vs Cobra
105135

106136
| Feature | Cobra | Mamba |
107137
|---------|-------|-------|
108-
| Command structure |||
109-
| Subcommands |||
110-
| Flags (local & persistent) |||
111-
| Lifecycle hooks |||
112-
| Argument validation |||
113-
| Help generation ||**Enhanced** |
114-
| Colored output |||
115-
| Loading spinners |||
116-
| Progress bars |||
117-
| Interactive prompts |||
118-
| Styled help messages |||
119-
| Modern terminal UX |||
138+
| Command structure | Yes | Yes |
139+
| Subcommands & nesting | Yes | Yes |
140+
| POSIX flags (pflag) | Yes | Yes |
141+
| Lifecycle hooks | Yes | Yes |
142+
| Argument validation | Yes | Yes |
143+
| Command aliases | Yes | Yes |
144+
| Help generation | Yes | Yes (Enhanced & Styled) |
145+
| Shell autocomplete | Yes | No (planned) |
146+
| Intelligent suggestions | Yes | No (planned) |
147+
| Man page generation | Yes | No (planned) |
148+
| Viper integration | Optional | No (planned) |
149+
| Colored output | No | Yes |
150+
| Loading spinners | No | Yes |
151+
| Progress bars | No | Yes |
152+
| Interactive prompts | No | Yes |
153+
| Modern terminal UX | No | Yes |
120154

121155
## Enhanced Features
122156

@@ -232,14 +266,14 @@ go run main.go
232266

233267
Mamba maintains 100% API compatibility with Cobra. All these features work identically:
234268

235-
- Command structure (`Use`, `Short`, `Long`, `Example`)
236-
- Subcommands (`AddCommand`, `RemoveCommand`)
237-
- Flags (local, persistent, shorthand)
238-
- Lifecycle hooks (`PreRun`, `PostRun`, `PersistentPreRun`, etc.)
239-
- Argument validators (`NoArgs`, `ExactArgs`, `MinimumNArgs`, etc.)
240-
- Error handling (`RunE`, `PreRunE`, `PostRunE`)
241-
- Context support
242-
- Custom help and usage templates
269+
- Command structure (`Use`, `Short`, `Long`, `Example`)
270+
- Subcommands (`AddCommand`, `RemoveCommand`)
271+
- Flags (local, persistent, shorthand)
272+
- Lifecycle hooks (`PreRun`, `PostRun`, `PersistentPreRun`, etc.)
273+
- Argument validators (`NoArgs`, `ExactArgs`, `MinimumNArgs`, etc.)
274+
- Error handling (`RunE`, `PreRunE`, `PostRunE`)
275+
- Context support
276+
- Custom help and usage templates
243277

244278
## Advanced Usage
245279

@@ -295,10 +329,33 @@ Mamba is built on top of excellent libraries:
295329
- [charmbracelet/huh](https://github.com/charmbracelet/huh) - Interactive forms
296330
- [charmbracelet/bubbles](https://github.com/charmbracelet/bubbles) - TUI components
297331

332+
## Roadmap
333+
334+
Planned features to achieve full Cobra parity:
335+
336+
- **v1.1.0**
337+
- Intelligent command suggestions ("did you mean...?")
338+
- Custom help templates and functions
339+
- Command grouping in help output
340+
341+
- **v1.2.0**
342+
- Shell completion generation (bash, zsh, fish, powershell)
343+
- Man page generation
344+
- Enhanced error messages with suggestions
345+
346+
- **v1.3.0**
347+
- Viper integration for configuration management
348+
- Advanced validation and hooks
349+
- Performance optimizations
350+
351+
Want to contribute? Check out our [issues](https://github.com/base-go/mamba/issues) or submit a PR!
352+
298353
## Contributing
299354

300355
Contributions are welcome! Please feel free to submit a Pull Request.
301356

357+
See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
358+
302359
## License
303360

304361
MIT License - see LICENSE file for details
@@ -312,7 +369,7 @@ Cobra is excellent, but modern CLI applications deserve modern UX. Mamba brings:
312369
- **Progressive Enhancement** - Use as much or as little of the modern features as you want
313370
- **Battle-tested** - Built on proven libraries from the Charm ecosystem
314371

315-
Named after the black mamba snake - fast, elegant, and powerful! 🐍
372+
Named after the black mamba snake - fast, elegant, and powerful.
316373

317374
## Credits
318375

command.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ var (
186186
}
187187

188188
// ExactArgs returns an error if there are not exactly N args
189-
ExactArgs = func(n int) PositionalArgs{
189+
ExactArgs = func(n int) PositionalArgs {
190190
return func(cmd *Command, args []string) error {
191191
if len(args) != n {
192192
return fmt.Errorf("accepts %d arg(s), received %d", n, len(args))

examples/basic/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ Mamba is a drop-in replacement for Cobra with enhanced UX features.`,
9999
// Show box with next steps
100100
cmd.PrintBox("Next Steps",
101101
"Try these commands:\n"+
102-
" • demo styled - See all styling options\n"+
103-
" • demo interactive - Try interactive prompts\n"+
104-
" • demo process - Watch a spinner in action\n"+
105-
" • demo --help - See all available commands")
102+
" • demo styled - See all styling options\n"+
103+
" • demo interactive - Try interactive prompts\n"+
104+
" • demo process - Watch a spinner in action\n"+
105+
" • demo --help - See all available commands")
106106
fmt.Println()
107107

108108
// Final message

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/base-go/mamba
22

3-
go 1.25.0
3+
go 1.21
44

55
require (
66
github.com/charmbracelet/bubbles v0.21.0

pkg/style/style.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,15 @@ var (
112112

113113
// Status icons
114114
const (
115-
SuccessIcon = "✓"
116-
ErrorIcon = "✗"
117-
WarningIcon = "⚠"
118-
InfoIcon = "ℹ"
115+
SuccessIcon = "✓"
116+
ErrorIcon = "✗"
117+
WarningIcon = "⚠"
118+
InfoIcon = "ℹ"
119119
QuestionIcon = "?"
120-
ArrowIcon = "→"
121-
BulletIcon = "•"
122-
CheckIcon = "✔"
123-
CrossIcon = "✖"
120+
ArrowIcon = "→"
121+
BulletIcon = "•"
122+
CheckIcon = "✔"
123+
CrossIcon = "✖"
124124
)
125125

126126
// Render functions
@@ -223,7 +223,7 @@ func Muted(msg string) string {
223223

224224
// Prompt renders a prompt
225225
func Prompt(msg string) string {
226-
return PromptStyle.Render(msg+" "+ArrowIcon+" ")
226+
return PromptStyle.Render(msg + " " + ArrowIcon + " ")
227227
}
228228

229229
// Input renders user input

0 commit comments

Comments
 (0)