Skip to content

feat: Go CLI skeleton — version command and lola mod stubs#188

Open
mrbrandao wants to merge 11 commits into
LobsterTrap:mainfrom
mrbrandao:go-port-00
Open

feat: Go CLI skeleton — version command and lola mod stubs#188
mrbrandao wants to merge 11 commits into
LobsterTrap:mainfrom
mrbrandao:go-port-00

Conversation

@mrbrandao

@mrbrandao mrbrandao commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

Bootstraps the Lola Go CLI with the initial project structure, version
command, and lola mod skeleton. This is the first PR in the Go port
series (go-port-00), establishing the foundation for all subsequent
command implementations.

  • Bootstrap Go CLI with Cobra (main.go, cmd/root.go)
  • lola version / lola --version / lola -v with dynamic version
    resolution (ldflags → go install module version → VCS commit hash →
    0.0.0-dev fallback)
  • lola mod command group with 6 no-op subcommands: add, rm, ls,
    info, update, init
  • internal/modules/ domain package with stub functions and per-package
    error sentinel (ErrNotImplemented)
  • mk/go.mk with go-build, go-test, go-vet Makefile targets
  • .gitignore updated with Go and SuperPowers sections

Test plan

  • lola --version / lola -v prints version string (e.g. 0.0.0-dev+279d87c)
  • lola version prints lola version 0.0.0-dev+279d87c linux/amd64
  • lola mod --help lists all 6 subcommands, no search
  • Each lola mod <sub> prints not yet implemented to stderr, exits 1
  • Arg validation rejects wrong arg count before hitting stubs
  • make go-test passes
  • make go-vet clean

Related issues

Closes #182 — Go project skeleton
Part of the Go migration (ADR: go-migration)

AI Disclosure

AI-assisted with Claude Code

Summary by CodeRabbit

  • New Features

    • Introduced CLI application with module management capabilities including add, remove, list, initialize, info, and update commands.
    • Added version command to display application version and runtime platform information.
  • Chores

    • Configured build infrastructure with automated testing and version injection.
    • Updated ignore rules for local development tools and build artifacts.

@mrbrandao mrbrandao added the enhancement New feature or request label Jun 11, 2026
mrbrandao and others added 11 commits June 11, 2026 15:25
Add .tool-versions to .gitignore to prevent local asdf
version configuration from being tracked by git.
Initialize Go module and root command scaffold for the lola
CLI, using github.com/spf13/cobra as the CLI framework.
… domain

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… test

- Replace currentVersion() call in versionCmd.Run with cmd.Root().Version for
  single source of truth between 'lola version' and 'lola --version'
- Add boundary test case for exactly 7-char vcsRevision to cover
  min(7, len(vcsRevision)) logic
- All tests pass including new case

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Adds Go build targets to the Makefile alongside existing Python targets.
Includes version stamping from git tags via LDFLAGS when on a tag,
otherwise falls through to VCS stamping for dev builds.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Add standard Go ignores (binaries, test artifacts, coverage output,
go.work), exclude also custom bin/ dir
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 830e232e-fe66-401c-868f-537d9924ae69

📥 Commits

Reviewing files that changed from the base of the PR and between 279d87c and b96a95a.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (16)
  • .gitignore
  • Makefile
  • cmd/mod.go
  • cmd/root.go
  • cmd/version.go
  • cmd/version_test.go
  • go.mod
  • internal/modules/add.go
  • internal/modules/errors.go
  • internal/modules/info.go
  • internal/modules/init.go
  • internal/modules/ls.go
  • internal/modules/rm.go
  • internal/modules/update.go
  • main.go
  • mk/go.mk

📝 Walkthrough

Walkthrough

This PR establishes the Go project skeleton for lola, introducing build infrastructure, a Cobra-based CLI framework with root and version commands, and a module management command group with operation stubs that currently return a sentinel "not yet implemented" error.

Changes

Go Project Skeleton

Layer / File(s) Summary
Build and Project Setup
.gitignore, Makefile, go.mod, mk/go.mk
Project configuration for Go development: ignore rules for Go artifacts and tooling, module definition with dependencies (Cobra, pflag, mousetrap), Makefile include directive, and build targets for compilation with version injection, testing, and linting.
CLI Framework and Version Resolution
cmd/root.go, cmd/version.go, cmd/version_test.go, main.go
Entry point and root command setup with version resolution via build-time injection, module build info fallback, git commit hash, or development default. Version subcommand prints platform info. Comprehensive table-driven tests validate version resolution across release, development, and missing-context scenarios.
Module Management Command Structure
cmd/mod.go, internal/modules/errors.go, internal/modules/add.go, internal/modules/rm.go, internal/modules/ls.go, internal/modules/info.go, internal/modules/init.go, internal/modules/update.go
Mod command group with six subcommands (add, rm, ls, info, init, update), each requiring/accepting appropriate arguments and delegating to corresponding stub functions in the modules package. Shared error sentinel enables unified "not yet implemented" response for all operations pending future development.

Sequence Diagram

sequenceDiagram
  participant main as main()
  participant Execute as cmd.Execute()
  participant rootCmd as rootCmd
  participant versionCmd as versionCmd
  participant resolveVersion as resolveVersion()
  
  main->>Execute: invoke
  Execute->>rootCmd: rootCmd.Execute()
  rootCmd->>rootCmd: Load version via currentVersion()
  rootCmd->>versionCmd: Register versionCmd
  rootCmd->>resolveVersion: Resolve version<br/>with fallback chain
  resolveVersion-->>rootCmd: Return version string
  rootCmd-->>Execute: Command result
  Execute-->>main: Return or exit(1)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Suggested reviewers

  • sergio-correia
  • SecKatie

Poem

🐰 A skeleton of Go, now taking form,
With Cobra's framework keeping CLI warm,
Version strings resolved through fallback chains,
Mod commands waiting—no implementation pains!
Building blocks in place, the foundation's strong. 🏗️

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: establishing a Go CLI skeleton with a version command and module management stubs.
Linked Issues check ✅ Passed All coding requirements from issue #182 are met: Go project skeleton established, phased scaffolding provided, and no-op commands implemented to lay out structure.
Out of Scope Changes check ✅ Passed All changes align with the stated objectives: CLI scaffolding, version command, module stubs, internal package structure, Makefile targets, and build configuration.
Docstring Coverage ✅ Passed Docstring coverage is 83.33% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5e2ae4b9dc

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread go.mod
@rjeffman

Copy link
Copy Markdown
Collaborator

Note: This is not a review.

@mrbrandao try to use an agent to extract the feature files from #184 and write the steps for Go to check the feasibility of that PR for the Go implementation. (No need to change this PR, just a test to see how it goes.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] - Go project skeleton

2 participants