MCPcopy Create free account
hub / github.com/AI45Lab/Code / new

Method new

core/src/commands.rs:128–141  ·  view source on GitHub ↗

Create a new registry with built-in commands.

()

Source from the content-addressed store, hash-verified

126impl CommandRegistry {
127 /// Create a new registry with built-in commands.
128 pub fn new() -> Self {
129 let mut registry = Self {
130 commands: HashMap::new(),
131 };
132 registry.register(Arc::new(HelpCommand));
133 registry.register(Arc::new(CompactCommand));
134 registry.register(Arc::new(CostCommand));
135 registry.register(Arc::new(ModelCommand));
136 registry.register(Arc::new(ClearCommand));
137 registry.register(Arc::new(HistoryCommand));
138 registry.register(Arc::new(ToolsCommand));
139 registry.register(Arc::new(McpCommand));
140 registry
141 }
142
143 /// Register a custom command.
144 pub fn register(&mut self, cmd: Arc<dyn SlashCommand>) {

Callers

nothing calls this directly

Calls 1

registerMethod · 0.45

Tested by

no test coverage detected