Skip to content

Add buzz create command for interactive goal creation #272

@narthur

Description

@narthur

Add a buzz create command that interactively prompts the user to create a new Beeminder goal from the CLI, rather than only via the TUI modal (n) or the raw API.

Desired behavior

  • buzz create prompts for: slug, title, type (default hustler), units, and 2 of 3 of goaldate/goalval/rate.
  • Reuse the existing validateCreateGoalInput() validation that backs the TUI modal.
  • Check authentication, validate input, call the existing goal-creation client method, and print the result.
  • Update help text and the "Available commands" error message.

Example:

$ buzz create
Create a new Beeminder goal
===========================

Goal slug: reading
Goal title: Daily Reading
Goal type (default: hustler):
Goal units: pages
Goal date: null
Goal value: 365
Rate: 1

Creating goal...
Successfully created goal: reading

Context

A previous implementation was attempted in PR #197, but it was built against the old monolithic main.go and went stale after that file was split into per-command files and the Beeminder fetchers became context-aware *HTTPClient methods. PR #197 was closed in favor of a fresh implementation against current main. See that PR for the original approach and the goal-creation flow it followed (mirroring buzz add / buzz charge).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions