Add `dkit app-commands`: look up application command and option types
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 67/100
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
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-typeoroption-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
--jsonwith 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.jsonwithsource,source_rendered, andlast_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
1isCHAT_INPUT; option type11isATTACHMENT. - Register the dataset in
src/dkit/core/data.pyand increase the exact JSON-file count in.github/workflows/ci.ymlby 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 checkandruff format --checkpass. - Update the README and add one bullet to the existing
### Addedblock under[Unreleased]inCHANGELOG.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
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Bytewave1/dkit
-
documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
enhancement good first issue new command
Difficulty 3/5 1-2 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
-
enhancement good first issue new command
Difficulty 3/5 1-2 days Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
enhancement new command
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
Similar issues
-
Import errors are swallowed: PerthImplicitWatermarker silently becomes NonePossibly taken @JonRC claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
resemble-ai/Perth#23 ·
-
correction metadata
Difficulty 2/5 Under an hour Newbie friendliness 65/100
acl-org/acl-anthology#10753 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
earthtojake/text-to-cad#758 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 70/100
DataTalksClub/faq#545 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day