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

Method run

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

Source from the content-addressed store, hash-verified

141
142impl Command for IntentNew {
143 fn run(&self) -> CliResult<()> {
144 if self.template != "feature" {
145 return Err(CliError::InvalidArgument {
146 message: format!(
147 "unknown template '{}' (only 'feature' is implemented)",
148 self.template
149 ),
150 });
151 }
152
153 if crate::commands::rpc::intent_new(self)? {
154 return Ok(());
155 }
156
157 let root = find_repository_root()?;
158 let repo = crate::commands::open_repository_with_vault(&root)?;
159
160 let (created, kind) =
161 create_intent(&repo, &self.title, &self.kind, self.review.as_deref())?;
162
163 println!("Created intent: {}", created.id);
164 println!(" file: .vault/{}", created.intent_file);
165 println!(" template: {}", self.template);
166 println!(" kind: {kind}");
167 if let Some(target) = &self.review {
168 println!(" reviews: {target}");
169 }
170 println!();
171 println!("Edit the directive stubs, then:");
172 println!(" atomic intent validate {}", created.id);
173 println!(" atomic intent attest {}", created.id);
174
175 Ok(())
176 }
177}
178
179#[cfg(test)]

Callers

nothing calls this directly

Calls 4

intent_newFunction · 0.85
find_repository_rootFunction · 0.85
create_intentFunction · 0.85

Tested by

no test coverage detected