Add `dkit app-commands`: look up application command and option types

Open
#63 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
1-2 days
Newbie friendliness
67/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
cli

Research direction

Read the existing CLI command and dataset registration patterns in src/dkit/core/data.py, then inspect .github/workflows/ci.yml and the README and changelog sections named in the issue. Use the official application command documentation as the source for the two type groups, and add the JSON dataset at src/dkit/data/application_commands.json. Done means both groups support the specified lookups, listing, search and JSON output, with the requested tests, coverage, lint and formatting checks passing.

Written by the indexing model from the issue text.

Description

enhancement new command

Problem

When building Discord application commands, developers often need to look up the numeric values for command types and option types. These tables are documented, but dkit does not currently provide an offline lookup.

Proposed behaviour

Add dkit app-commands to list and look up the documented application command types and option types.

$ dkit app-commands command-type 1
CHAT_INPUT

$ dkit app-commands option-type ATTACHMENT
11

$ dkit --json app-commands option-type 11
  • Require an explicit group (command-type or option-type) because their numeric values overlap.
  • Support listing and searching both groups.
  • Name lookups should be case-insensitive. Unknown groups or values should exit with code 2 and a useful hint.
  • Support --json with stable group, name, value, description/note, and provenance fields.
  • Keep this limited to type lookups; do not include application-command limits.

Data

  • Add src/dkit/data/application_commands.json with source, source_rendered, and last_verified.
  • Copy values only from “Application Command Types” and “Application Command Option Type” in the official docs: developers/interactions/application-commands.mdx (https://discord.com/developers/docs/interactions/application-commands).
  • Examples above are documented: command type 1 is CHAT_INPUT; option type 11 is ATTACHMENT.
  • Register the dataset in src/dkit/core/data.py and increase the exact JSON-file count in .github/workflows/ci.yml by one from the current base branch count.

Acceptance criteria

  • Tests cover both type groups, numeric and name lookups, overlapping values, search/list behavior, JSON output, and invalid input.
  • Tests fail if a documented value or group is changed incorrectly.
  • 100% line and branch coverage; ruff check and ruff format --check pass.
  • Update the README and add one bullet to the existing ### Added block under [Unreleased] in CHANGELOG.md; do not remove existing changelog lines.
  • Please comment on this issue before starting, as required by CONTRIBUTING.md. AI-assisted contributions are welcome; disclose AI use in the PR description.
Dominant language
Python
Stars
1
Forks
7
Avg merge
11h 50m
Merged PRs (30d)
35

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Bytewave1/dkit

All issues in Bytewave1/dkit

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.