Add disco llm command for LLM coding agents#118
Open
emanuelefaja wants to merge 1 commit intoletsdiscodev:mainfrom
Open
Add disco llm command for LLM coding agents#118emanuelefaja wants to merge 1 commit intoletsdiscodev:mainfrom
disco llm command for LLM coding agents#118emanuelefaja wants to merge 1 commit intoletsdiscodev:mainfrom
Conversation
Emits a single markdown bundle (narrative + auto-generated command reference) suitable for piping into a skill file. Supports `--save` to write `./DISCO.md`, `--install <claude|codex|all>` to install as an agent skill at the user-global path, and `--url` to print the hosted llms.txt URL. The narrative is bundled at build time from disco.cloud/llms.txt (refreshed via `npm run sync:llms-narrative`); the command reference is generated at runtime from `this.config.commands` so it always matches the installed binary. Closes letsdiscodev#115
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #115.
What
New top-level
disco llmcommand that emits a single markdown bundle (narrative + auto-generated command reference) suitable for piping into a coding agent's skill file. One invocation gives an LLM the full surface of the CLI.Why bundle the narrative instead of fetching
llms.txtat runtimeThree reasons:
llms.txtevolves; an installed CLI version may have features the hosted text doesn't describe (or vice versa). Bundling guarantees the narrative matches the command reference (which is generated from the same binary).--urlis the escape hatch for users who want the latest hosted copy verbatim.Refresh mechanism:
scripts/sync-llms-narrative.jscurlsdisco.cloud/llms.txtand writessrc/llm/narrative.ts.RELEASE.mdinstructs runningnpm run sync:llms-narrativebefore tagging a release.Why the command reference is auto-generated
The command-reference section walks
this.config.commandsat runtime — every command, flag, arg, and example comes from oclif's loaded metadata. New commands appear in the dump automatically with no manual update; the reference can never drift from the installed binary.Install target scope (v1)
Two user-global skill targets — both clean, conflict-free, project-state untouched:
claude~/.claude/skills/disco/SKILL.mdcodex~/.codex/skills/disco/SKILL.mdall--installalways requires an explicit value (Flags.stringwith enumclaude|codex|all). If a target file already exists, the command errors and prints the path;--forceoverrides. With--install all, existence is checked across all targets before any write, so a partial-state failure isn't possible.Deferred to a follow-up:
.cursor/rules/disco.mdc) — project-scope-only convention;--savealready covers project-scoped use.Files
src/commands/llm.tssrc/llm/render.ts(pure render functions)src/llm/narrative.ts(8KB snapshot ofllms.txt, auto-generated)scripts/sync-llms-narrative.jstest/commands/llm.test.ts(12 tests)package.json(+sync:llms-narrativescript)RELEASE.md(pre-tag refresh step)Test plan
npm run build— cleannpm test— 12 new tests passing; existing tests untouchednpm run lint— no errors in new filesdisco llm— narrative + 65 command sections, sorted, hidden +llmitself filtered outdisco llm --url— prints exactly the URLdisco llm --save— writes./DISCO.md; matches stdoutdisco llm --install all(viaHOME=$(mktemp -d)) — both files written with YAML frontmatterdisco llm --install claudeagainst existing file — errors with path;--forceoverwritesdisco llm --install bogus— oclif rejects with valid-options errordisco llm --save --url— oclif rejects (mutually exclusive)