Skip to content

README lacks a minimal working code example near the top #104

Description

@codeforester

Problem

The README opens with a clear value proposition, design goals, and feature list — all well-written. However, the first actual code showing the App/command/Context API doesn't appear until the "Consumer Profiles" section, after several paragraphs of prose.

For a PyPI package, the typical evaluation pattern is: land on pypi.org → click through to the README → scan for a code block in the first screenful. If there's no code visible immediately, many readers bounce before reading the substance.

What's missing

A 10–15 line "Hello World" block immediately after the install instruction — showing the minimal pattern a new user can copy-paste:

import base_cli

app = base_cli.App(name="hello", version="0.1.0")

@app.command()
def hello_command(ctx: base_cli.Context, name: str = "world") -> int:
    ctx.log.info("Hello, %s!", name)
    return base_cli.ExitCode.SUCCESS

if __name__ == "__main__":
    base_cli.run_app(app)

Why this matters

  • PyPI's package description renders the README. Users reading the PyPI page see whatever is in the first screenful.
  • The examples/minimal_cli/ directory already contains a working example — the README should surface it prominently rather than leaving it as a repo-only discovery.
  • docs/adopter-readiness.md already assumes the reader knows the basic App/command/context shape. The README should give them that shape upfront.

Proposed location

Add the code block immediately after the pip install base-cli instruction and the one-paragraph description of what base_cli does, before "Design Goals".

Metadata

Metadata

Assignees

Labels

documentationDocumentation improvements

Type

No type

Projects

Status
Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions