claude-code: added 'commandsDir' option to specify commands from filesystem
This commit is contained in:
parent
a641bbbb9b
commit
be37a3492d
5 changed files with 47 additions and 0 deletions
|
|
@ -26,11 +26,18 @@
|
|||
test-agent = "test content";
|
||||
};
|
||||
agentsDir = ./agents;
|
||||
|
||||
# assert fail: cannot set commands and commandsDir at the same time.
|
||||
commands = {
|
||||
test-command = "test content";
|
||||
};
|
||||
commandsDir = ./commands;
|
||||
};
|
||||
|
||||
test.asserts.assertions.expected = [
|
||||
"`programs.claude-code.package` cannot be null when `mcpServers` is configured"
|
||||
"Cannot specify both `programs.claude-code.memory.text` and `programs.claude-code.memory.source`"
|
||||
"Cannot specify both `programs.claude-code.agents` and `programs.claude-code.agentsDir`"
|
||||
"Cannot specify both `programs.claude-code.commands` and `programs.claude-code.commandsDir`"
|
||||
];
|
||||
}
|
||||
|
|
|
|||
14
tests/modules/programs/claude-code/commands-dir.nix
Normal file
14
tests/modules/programs/claude-code/commands-dir.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
programs.claude-code = {
|
||||
enable = true;
|
||||
commandsDir = ./commands;
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.claude/commands/test-command.md
|
||||
assertLinkExists home-files/.claude/commands/test-command.md
|
||||
assertFileContent \
|
||||
home-files/.claude/commands/test-command.md \
|
||||
${./commands/test-command.md}
|
||||
'';
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
allowed-tools: Bash(echo:*)
|
||||
description: Test command for commandsDir functionality
|
||||
---
|
||||
|
||||
This is a test command to verify that commandsDir works correctly.
|
||||
|
|
@ -6,4 +6,5 @@
|
|||
claude-code-memory-management = ./memory-management.nix;
|
||||
claude-code-memory-from-source = ./memory-from-source.nix;
|
||||
claude-code-agents-dir = ./agents-dir.nix;
|
||||
claude-code-commands-dir = ./commands-dir.nix;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue