Skip to content

Initialize Go module and project scaffolding#26

Merged
ran-codes merged 1 commit intomainfrom
issue-1/project-scaffolding
Feb 17, 2026
Merged

Initialize Go module and project scaffolding#26
ran-codes merged 1 commit intomainfrom
issue-1/project-scaffolding

Conversation

@ran-codes
Copy link
Copy Markdown
Owner

Summary

Sets up the foundational project structure so all subsequent Phase 1 issues (#2#6) have a compilable skeleton to build on.

  • Initialized Go module as github.com/ran-codes/zenodo-cli
  • Created entry point at cmd/zenodo/main.go
  • Created root cobra command (internal/cli/root.go) with all global flags from the spec: --token, --profile, --sandbox, --output, --fields, --verbose
  • Established the full directory layout per PLAN.md: internal/{cli,api,config,model,output,validate}
  • Added cobra and viper as dependencies
  • Updated .gitignore to exclude build artifacts

Code changes

File What
cmd/zenodo/main.go Entry point — calls cli.Execute()
internal/cli/root.go Root cobra command with 6 global persistent flags
go.mod / go.sum Module init + cobra/viper deps
.gitignore Added /zenodo, /zenodo.exe, dist/

Verification

  • go build ./cmd/zenodo/ compiles successfully
  • ./zenodo --help prints CLI description

Closes #1

🤖 Generated with Claude Code

Set up the foundational project structure for the Zenodo CLI:
- Initialize Go module (github.com/ran-codes/zenodo-cli)
- Create entry point at cmd/zenodo/main.go
- Create root cobra command with global flags (--token, --profile,
  --sandbox, --output, --fields, --verbose)
- Establish directory layout: internal/cli, internal/api,
  internal/config, internal/model, internal/output, internal/validate
- Add cobra and viper dependencies
- Update .gitignore for build artifacts

Closes #1

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 17, 2026 19:23
@ran-codes ran-codes merged commit 4e45cdf into main Feb 17, 2026
5 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Initial scaffolding for a new Go-based CLI (zenodo) to serve as the foundation for upcoming Phase 1 work (config, API client, validation, etc.).

Changes:

  • Initialized Go module (github.com/ran-codes/zenodo-cli) and added initial dependencies (cobra/viper).
  • Added cmd/zenodo/main.go entrypoint that executes the CLI root command.
  • Added initial root cobra command with persistent/global flags and updated .gitignore for build artifacts.

Reviewed changes

Copilot reviewed 3 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
cmd/zenodo/main.go Minimal CLI entrypoint wiring to cli.Execute()
internal/cli/root.go Root cobra command + global persistent flags
go.mod Module initialization and dependency declarations
go.sum Dependency checksums for cobra/viper and transitive deps
.gitignore Ignore built binaries and dist/ output

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1 to +2
module github.com/ran-codes/zenodo-cli

Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

PR description says the full internal/{cli,api,config,model,output,validate} layout was added, but only internal/cli exists in this change (empty directories aren’t tracked by git). If those folders are part of the scaffolding requirement, add minimal placeholder files (e.g., doc.go with package declarations) so the structure is actually present in the repository.

Copilot uses AI. Check for mistakes.
rootCmd.PersistentFlags().String("token", "", "API token (prefer ZENODO_TOKEN env var or keyring)")
rootCmd.PersistentFlags().String("profile", "", "Config profile to use")
rootCmd.PersistentFlags().Bool("sandbox", false, "Use Zenodo sandbox environment")
rootCmd.PersistentFlags().StringP("output", "o", "", "Output format: json, table, csv (default: table for TTY, json for pipe)")
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

The --output flag help text claims a dynamic default (“table for TTY, json for pipe”), but the actual default is the empty string. Either implement that defaulting behavior (e.g., in PersistentPreRunE) or change the help text to match the current behavior to avoid misleading users.

Suggested change
rootCmd.PersistentFlags().StringP("output", "o", "", "Output format: json, table, csv (default: table for TTY, json for pipe)")
rootCmd.PersistentFlags().StringP("output", "o", "", "Output format: json, table, csv")

Copilot uses AI. Check for mistakes.
Comment on lines +14 to +16
github.com/spf13/cobra v1.10.2 // indirect
github.com/spf13/pflag v1.0.10 // indirect
github.com/spf13/viper v1.21.0 // indirect
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

cobra is imported in the codebase, but it’s listed as // indirect in go.mod, and viper is listed even though it is not imported anywhere yet. Please run go mod tidy and keep direct dependencies (like cobra) unmarked, and avoid adding unused dependencies (viper) until they’re actually used (or add the minimal code that uses it).

Suggested change
github.com/spf13/cobra v1.10.2 // indirect
github.com/spf13/pflag v1.0.10 // indirect
github.com/spf13/viper v1.21.0 // indirect
github.com/spf13/cobra v1.10.2
github.com/spf13/pflag v1.0.10 // indirect

Copilot uses AI. Check for mistakes.
@ran-codes ran-codes deleted the issue-1/project-scaffolding branch February 18, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Initialize Go module and project scaffolding

2 participants