Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 29, 2025

Adds user-facing documentation for the Feature CLI at cli/README.md to enable command discovery without reading source code.

Content

  • Build instructions: cd cli && go build -o feature
  • Global flags: --log-format, --log-level, --endpoint with environment variable mappings and defaults
  • Commands: version, getall, get, set, delete, preset with argument specifications
  • Key behavioral distinctions:
    • get returns the feature value, errors if key not found
    • preset only creates if key doesn't exist (idempotent initialization)
    • set always overwrites
  • Examples: Default and remote endpoint usage, JSON logging, combined flags

Usage Pattern

feature [global flags] <command> [command arguments]

# Examples
feature --endpoint prod:8000 get feature-key
ENDPOINT=staging:8000 feature getall
feature preset default-theme dark  # Only sets if doesn't exist
feature set theme light           # Always overwrites
Original prompt

Add a new README file for the Feature CLI in the cli directory of the dkrizic/feature repository.

Context:

  • Repository: dkrizic/feature (ID: 1122968580)
  • Target path: cli/README.md
  • Relevant existing files at commit 86612fd341eb49793cdcc61ff128fec7ba9598fd include:
    • cli/main.go (defines the feature root command, global flags, and subcommands version, getall, get, set, delete, preset)
    • cli/constant/constant.go (defines constants for log-format, log-level, endpoint, enable-opentelemetry, otlp-endpoint)
    • cli/command/* packages providing implementations for the subcommands.

Requirements:

  1. Create a new Markdown file at cli/README.md documenting the CLI.
  2. The README must include:
    • A short description of the Feature CLI and what it does (client for the Feature service, managing feature flags as key/value pairs).
    • Basic build instructions for the CLI (e.g., cd cli && go build -o feature).
    • Overall usage pattern: feature [global flags] <command> [command arguments].
    • Documentation for global flags as defined in cli/main.go and cli/constant/constant.go:
      • --log-format (env: LOG_FORMAT, default text, values text|json)
      • --log-level (env: LOG_LEVEL, default info, values debug|info|warn|error)
      • --endpoint (env: ENDPOINT, default localhost:8000, required, description as Feature service endpoint).
    • Documentation for subcommands and their arguments:
      • version – prints service name and version.
      • getall – streams and prints all features as key: value per line.
      • get <key> – fetches a single feature by key; mention that it prints the feature name when successful.
      • set <key> <value> – sets/updates a feature.
      • delete <key> – deletes a feature.
      • preset <key> <value> – pre-sets/initializes a feature.
    • A simple "Examples" section showing realistic command invocations combining --endpoint and the commands above.
  3. Use clear, concise English suitable for developers familiar with Go and CLI tools.
  4. Ensure Markdown is well structured with headings, code blocks for commands, and bullet lists for arguments.
  5. Do not modify existing Go source files or other documentation unless strictly necessary.

The main goal of this PR is to introduce user-facing documentation for the CLI so that users can discover available commands and parameters without reading the Go source code.

This pull request was created from Copilot chat.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 4 commits December 29, 2025 01:49
Co-authored-by: dkrizic <1181349+dkrizic@users.noreply.github.com>
…ntation

Co-authored-by: dkrizic <1181349+dkrizic@users.noreply.github.com>
Co-authored-by: dkrizic <1181349+dkrizic@users.noreply.github.com>
…ehavior

Co-authored-by: dkrizic <1181349+dkrizic@users.noreply.github.com>
Copilot AI changed the title [WIP] Add new README file for Feature CLI Add CLI README documentation Dec 29, 2025
Copilot AI requested a review from dkrizic December 29, 2025 01: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.

2 participants