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

Method run

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

Source from the content-addressed store, hash-verified

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