fix(slashcommand): discover nested opencode commands
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -235,4 +235,24 @@ Use plural command.
|
||||
expect(duplicates).toHaveLength(1)
|
||||
expect(duplicates[0]?.content).toContain("Use plural command.")
|
||||
})
|
||||
|
||||
it("discovers nested opencode project commands", () => {
|
||||
const commandsDir = join(projectDir, ".opencode", "commands", "refactor")
|
||||
|
||||
mkdirSync(commandsDir, { recursive: true })
|
||||
writeFileSync(
|
||||
join(commandsDir, "code.md"),
|
||||
`---
|
||||
description: Nested command
|
||||
---
|
||||
Use nested command.
|
||||
`,
|
||||
)
|
||||
|
||||
const commands = discoverCommandsSync(projectDir)
|
||||
const nestedCommand = commands.find((command) => command.name === "refactor:code")
|
||||
|
||||
expect(nestedCommand?.content).toContain("Use nested command.")
|
||||
expect(nestedCommand?.scope).toBe("opencode-project")
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user