Register built-in commands
(&mut self)
| 71 | |
| 72 | /// Register built-in commands |
| 73 | fn register_builtin_commands(&mut self) { |
| 74 | self.register(Command { |
| 75 | name: "init".to_string(), |
| 76 | description: "Initialize OpenCode in the current project".to_string(), |
| 77 | template: include_str!("../commands/init.md").to_string(), |
| 78 | source: CommandSource::Builtin, |
| 79 | }); |
| 80 | |
| 81 | self.register(Command { |
| 82 | name: "review".to_string(), |
| 83 | description: "Review the current changes in the project".to_string(), |
| 84 | template: include_str!("../commands/review.md").to_string(), |
| 85 | source: CommandSource::Builtin, |
| 86 | }); |
| 87 | |
| 88 | self.register(Command { |
| 89 | name: "commit".to_string(), |
| 90 | description: "Create a git commit with the current changes".to_string(), |
| 91 | template: include_str!("../commands/commit.md").to_string(), |
| 92 | source: CommandSource::Builtin, |
| 93 | }); |
| 94 | |
| 95 | self.register(Command { |
| 96 | name: "test".to_string(), |
| 97 | description: "Run tests for the project".to_string(), |
| 98 | template: include_str!("../commands/test.md").to_string(), |
| 99 | source: CommandSource::Builtin, |
| 100 | }); |
| 101 | } |
| 102 | |
| 103 | /// Register a new command |
| 104 | pub fn register(&mut self, command: Command) { |