Skip to content

CLI Overview

The club CLI is a Dart command-line tool for interacting with a club server. It handles authentication, dart pub integration, and publishing.

Installation

The fastest path on Linux and macOS:

Terminal window
curl -fsSL https://club.birju.dev/install.sh | bash

Windows users, air-gapped environments, and anyone who wants to pin a specific version: see the full Installation guide, which covers the install script, manual archive downloads, and building from source.

Verify:

Terminal window
club --version

Command Tree

club
├── login <host> Authenticate via browser OAuth (default), --no-browser, or --key
├── logout [--server <host>] [--all] Remove stored credentials
├── config Show or change default server
│ ├── show Alias for: club config
│ └── set-server <host> Set default server
├── setup [--env-var <NAME>] Register the stored token with dart pub
├── publish [--auto] Publish a package (native flow; resolves server automatically).
│ Add --auto for orchestrated monorepo publishing.
├── prepare Rewrite path/workspace deps to hosted refs in topo order
│ (monorepo prep without publishing)
├── add [<section>:]<package>[:<descriptor>] ...
│ Add hosted dependencies to pubspec.yaml from a logged-in server
├── global Manage globally-installed packages from a club server
│ ├── activate <package> Globally activate a package from a club server
│ └── deactivate <package> Deactivate a globally-installed package
└── mcp [--server <host> --token <pat>]
Start a stdio MCP server so AI clients can browse, search,
and reason about packages on a club server.

<host> is a bare host like myclub.birju.dev. A full URL (https://myclub.birju.dev) is accepted too — both forms map to the same credential. Local dev servers (localhost, 127.0.0.1, 0.0.0.0) default to http://; everything else defaults to https://.

For monorepos and pub workspaces, prepare and publish --auto automate the internal-dependency rewriting that dart pub publish cannot handle. See Monorepo Publishing for the end-to-end workflow.

For AI-assisted workflows, club mcp runs a stdio Model Context Protocol server that exposes read-only tools (search, version listings, README / CHANGELOG, scoring reports, dartdoc summaries) to clients like Claude Desktop, Cursor, Cline, Continue, and Zed. See club mcp for client setup and the full tool list.

Token management (creating, listing, and revoking personal access tokens) and all administrative actions are done from the web UI — they are not exposed as CLI subcommands. See Administration for how to drive admin workflows via the web UI or the HTTP API.

Global Options

OptionDescription
--helpShow help for a command
--version, -vShow the CLI version

Environment variables

VariableDescription
CLUB_TOKENBearer token override. Shadows stored credentials — useful in CI.
NO_COLORDisable ANSI colors (honours no-color.org).
TERM=dumbDisable ANSI colors.

Quick Start

Terminal window
# 1. Log in to your club server
club login myclub.birju.dev
# 2. Configure dart pub to use your server
club setup
# 3a. Publish a single package
cd my_package/
club publish
# 3b. Or, in a monorepo: publish a leaf and every workspace dep it transitively
# references, in topological order. Source files are not modified.
club publish --auto pkg_a pkg_b

How the CLI Works Internally

The club CLI uses the club_api client SDK for all server communication. It does not make raw HTTP calls. This means:

  • All HTTP logic is centralized in the club_api package
  • Bug fixes in the SDK benefit both the CLI and any custom tooling
  • The CLI and your scripts share the same client code