Skip to content

CLI club-context: current_club + ccas use <slug> #86

Description

@Sootopolis

What

A single active current club so slug-requiring subcommands run with no slug argument — like git switch / kubectl config use-context.

  • New config key current_club = "<slug>" in ~/.config/ccas/config.conf.
  • ccas use <slug> sets it (writes the config file).
  • Subcommands that require a club slug (recruit, stats, membership, history, blacklist *) fall back to current_club when no slug is given; an explicit slug always wins.
  • default_clubs (shipped in CLI config file resolution #43) stays the completion-suggestion list; current_club is the single dispatch target.

Why

#43 shipped default_clubs but deliberately did not build the issue's "no slug → use default_clubs, 2+ → error" fallback: a list is only a usable fallback when it holds exactly one, and erroring on every slug-less call when 2+ are set is poor UX. A single current_club is the right model and supersedes the list-as-fallback.

Notes / open questions

  • Writing config from the CLI (ccas use) — needs a HOCON writer or a minimal config rewrite; today CliConfig is read-only.
  • Where ccas use validates the slug: local DB, GET /api/clubs, or no validation.
  • The ServerCommand vs local-command split (from feat(cli): config file resolution + command split #85) makes use a clean new local command.

Relates to #40 (CLI v0). Follow-up from #43 (merged in #85).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cliCLI binary (subcommands, completions, config, packaging)enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions