MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / run

Method run

atomic-cli/src/commands/intent/new.rs:214–243  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

212
213impl Command for IntentNew {
214 fn run(&self) -> CliResult<()> {
215 if self.template != "feature" {
216 return Err(CliError::InvalidArgument {
217 message: format!(
218 "unknown template '{}' (only 'feature' is implemented)",
219 self.template
220 ),
221 });
222 }
223
224 let root = find_repository_root()?;
225 let repo = Repository::open(&root).map_err(CliError::Repository)?;
226
227 let (created, kind) =
228 create_intent(&repo, &self.title, &self.kind, self.review.as_deref())?;
229
230 println!("Created intent: {}", created.id);
231 println!(" file: .vault/{}", created.intent_file);
232 println!(" template: {}", self.template);
233 println!(" kind: {kind}");
234 if let Some(target) = &self.review {
235 println!(" reviews: {target}");
236 }
237 println!();
238 println!("Edit the directive stubs, then:");
239 println!(" atomic intent validate {}", created.id);
240 println!(" atomic intent attest {}", created.id);
241
242 Ok(())
243 }
244}
245
246#[cfg(test)]

Callers

nothing calls this directly

Calls 2

find_repository_rootFunction · 0.85
create_intentFunction · 0.85

Tested by

no test coverage detected