Skip to content

cg api contribution

The contribution service endpoint. See cg api for how these relate to the higher-level commands.

Every command also accepts -h / --help.

Command Summary
cg api contribution Contribution service commands.
cg api contribution find-contribution Find a contribution by its opaque contribution ID.
cg api contribution find-new-contribution-count Count new contributions published since a given point in time.
cg api contribution find-contribution-moderators List the moderators who have cast a given vote ('validate'/'deny') on a PENDING contribution's approve/reject moderation gate--the privileged gate that actua...
cg api contribution get-all-pending-contributions Get pending (community-review-queue) contributions.
cg api contribution get-personal-contributions List every contribution (any status--draft/PENDING/APPROVED/REFUSED/etc.) authored by a codingamer.
cg api contribution update-contribution Submit a new version of a contribution's content.
cg api contribution create-contribution Create a brand new contribution. A JSON-serialized CgContributionData object is read from stdin.
cg api contribution delete-contribution Delete a contribution.

cg api contribution

Contribution service commands.

usage: cg api contribution [-h] COMMAND ...

Subcommands

  • find-contribution — Find a contribution by its opaque contribution ID.
  • find-new-contribution-count — Count new contributions published since a given point in time.
  • find-contribution-moderators — List the moderators who have cast a given vote ('validate'/'deny') on a PENDING contribution's approve/reject moderation gate--the privileged gate that actually decides whether it gets published or rejected (3 votes either way, confirmed live). Distinct from the ungated community vote (cg api vote find-votable-values-by-id)--do not conflate the two.
  • get-all-pending-contributions — Get pending (community-review-queue) contributions.
  • get-personal-contributions — List every contribution (any status--draft/PENDING/APPROVED/REFUSED/etc.) authored by a codingamer. Unlike get-all-pending-contributions, this genuinely filters to just that codingamer's own contributions.
  • update-contribution — Submit a new version of a contribution's content. A JSON-serialized CgContributionData object is read from stdin.
  • create-contribution — Create a brand new contribution. A JSON-serialized CgContributionData object is read from stdin.
  • delete-contribution — Delete a contribution.

cg api contribution find-contribution

Find a contribution by its opaque contribution ID.

usage: cg api contribution find-contribution [-h] [--arg2-false] CONTRIBUTION-ID

Arguments

  • CONTRIBUTION-ID — Opaque contribution ID string.

Options

  • --arg2-false — Set the API's second (purpose unknown) argument to False instead of the default True.

cg api contribution find-new-contribution-count

Count new contributions published since a given point in time.

usage: cg api contribution find-new-contribution-count [-h] [--codingamer-id ID]
                                                       [--since TIMESTAMP]

Options

  • -g, --codingamer-id ID — Codingamer to count new contributions for. Defaults to the logged-in codingamer's ID.
  • --since TIMESTAMP — Count contributions published after this point in time. Can be milliseconds since epoch (e.g., '1680000000000'), a duration string (e.g., '1h30m'), a relative duration from now (e.g., '-1h30m'), or an ISO 8601 datetime string. Defaults to now.

cg api contribution find-contribution-moderators

List the moderators who have cast a given vote ('validate'/'deny') on a PENDING contribution's approve/reject moderation gate--the privileged gate that actually decides whether it gets published or rejected (3 votes either way, confirmed live). Distinct from the ungated community vote (cg api vote find-votable-values-by-id)--do not conflate the two.

usage: cg api contribution find-contribution-moderators [-h] CONTRIBUTION-NUMERIC-ID ACTION

Arguments

  • CONTRIBUTION-NUMERIC-ID — The contribution's numeric ID (CgContribution.id)--NOT the opaque public handle used by every other cg api contribution command.
  • ACTION — 'validate' (approve) or 'deny' (reject).

cg api contribution get-all-pending-contributions

Get pending (community-review-queue) contributions.

usage: cg api contribution get-all-pending-contributions [-h] [--type-filter FILTER]
                                                         [--codingamer-id ID] [--page PAGE]

Options

  • -t, --type-filter FILTER (default: ALL) — Category filter: 'ALL', 'CLASHOFCODE', or 'PUZZLE'. Defaults to 'ALL'.
  • -g, --codingamer-id ID — Must equal the logged-in codingamer's own ID (server-enforced). Defaults to the logged-in codingamer's ID.
  • -n, --page PAGE (default: 1) — Assumed 1-indexed page number; unconfirmed. Defaults to 1.

cg api contribution get-personal-contributions

List every contribution (any status--draft/PENDING/APPROVED/REFUSED/etc.) authored by a codingamer. Unlike get-all-pending-contributions, this genuinely filters to just that codingamer's own contributions.

usage: cg api contribution get-personal-contributions [-h] [--codingamer-id ID] [--page PAGE]

Options

  • -g, --codingamer-id ID — Must equal the logged-in codingamer's own ID (server-enforced). Defaults to the logged-in codingamer's ID.
  • -n, --page PAGE (default: 1) — 1-indexed page number (confirmed live via the server's own INVALID_PAGE error detail). Defaults to 1.

cg api contribution update-contribution

Submit a new version of a contribution's content. A JSON-serialized CgContributionData object is read from stdin.

usage: cg api contribution update-contribution [-h] [--draft] [--ready-for-moderation]
                                               [--codingamer-id ID]
                                               CONTRIBUTION-ID PUZZLE-TYPE PREV-VERSION

Arguments

  • CONTRIBUTION-ID — Opaque contribution ID string.
  • PUZZLE-TYPE — The type of the contribution, e.g. 'PUZZLE_INOUT'.
  • PREV-VERSION — The contribution's current version number, as last retrieved via find-contribution (an idempotency/concurrency check--rejected if stale).

Options

  • --draft — Submit as a private, unpublished draft. Defaults to false.
  • --ready-for-moderation — Formally submit for moderation. Defaults to false.
  • -g, --codingamer-id ID — The authoring codingamer's numeric ID. Defaults to the logged-in codingamer's ID.

cg api contribution create-contribution

Create a brand new contribution. A JSON-serialized CgContributionData object is read from stdin.

usage: cg api contribution create-contribution [-h] [--draft] [--ready-for-moderation]
                                               [--codingamer-id ID]
                                               PUZZLE-TYPE

Arguments

  • PUZZLE-TYPE — The type of the contribution, e.g. 'PUZZLE_INOUT'.

Options

  • --draft — Create as a private, unpublished draft. Defaults to false.
  • --ready-for-moderation — Formally submit for moderation. Defaults to false.
  • -g, --codingamer-id ID — The authoring codingamer's numeric ID. Defaults to the logged-in codingamer's ID.

cg api contribution delete-contribution

Delete a contribution.

usage: cg api contribution delete-contribution [-h] [--codingamer-id ID] CONTRIBUTION-ID

Arguments

  • CONTRIBUTION-ID — Opaque contribution ID string of the contribution to delete.

Options

  • -g, --codingamer-id ID — The authoring codingamer's numeric ID. Defaults to the logged-in codingamer's ID.

Generated from the parser itself. For when to use these, see the CLI guides.