Skip to content

feat(init): implement interactive wizard for agk init -i#18

Open
kunalkushwaha wants to merge 1 commit into
mainfrom
feat/init-wizard
Open

feat(init): implement interactive wizard for agk init -i#18
kunalkushwaha wants to merge 1 commit into
mainfrom
feat/init-wizard

Conversation

@kunalkushwaha

Copy link
Copy Markdown
Member

What

Implements the interactive init wizard. The -i/--interactive flag was already parsed and passed into GenerateOptions.Interactive, but no generator ever read it — so agk init -i behaved exactly like a non-interactive init. This wires it to a real guided setup flow.

This is feature A1 from the FEATURES.md roadmap (and the long-standing "Interactive Init Wizard" roadmap item).

Behavior

$ agk init -i
🧙 AGK interactive project setup

Project name [my-agent]: wizbot
Template:
  * 1) quickstart
    2) workflow
Choose (number or name) [quickstart]: 2
LLM provider:
  * 1) openai
    2) anthropic
    3) ollama
Choose (number or name) [openai]: ollama
Description (optional): My wizard agent

📦 Creating new AgenticGoKit project: wizbot ...
  • Prompts for project name, template, LLM provider, and description, then scaffolds the chosen project.
  • agk init -i can be run with no project-name arg — the wizard asks for it (args validation relaxed for interactive mode).
  • Choices accept a number or a name; empty input takes the default; EOF falls back to defaults (no hang).

Design for testability

The prompt flow is a small prompter decoupled from os.Stdin/os.Stdout (io.Reader/io.Writer), so the wizard is unit-tested with piped input.

Testing

  • go build, go vet, go test ./..., gofmt all green.
  • Unit tests: full wizard flow, name prompting, EOF-defaults, invalid-then-valid choice.
  • Verified end-to-end by piping answers into agk init -i: scaffolds the workflow template with the ollama provider correctly wired into the generated main.go (plugins/llm/ollama, Provider: "ollama").

Independent branch off main (alongside #13#17).

🤖 Generated with Claude Code

The `-i/--interactive` flag was parsed but never did anything. This wires it
to a guided setup flow that prompts for project name, template, LLM provider,
and description, then scaffolds the chosen project.

- stdin/stdout-driven prompter (decoupled for testing) with number-or-name
  choice selection and safe defaults (EOF falls back to defaults, no hang).
- `agk init -i` may be run with no project-name arg; the wizard asks for it.
- Unit tests cover the wizard flow, name prompting, EOF defaults, and
  invalid-then-valid choice handling.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant