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

Method run

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

find_repository_rootFunction · 0.85
create_intentFunction · 0.85

Tested by

no test coverage detected