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

Method execute

atomic-cli/src/commands/org/create.rs:81–120  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

79
80impl OrgCreate {
81 async fn execute(&self) -> CliResult<()> {
82 // Build client using current default org (doesn't matter which org
83 // we're scoped to — the server creates a new org regardless).
84 let client = build_client(None, None).await?;
85
86 let info = atomic_teams::org::create_org(&client, &self.name, self.email.as_deref())
87 .await
88 .map_err(|e| CliError::RemoteError {
89 message: e.to_string(),
90 url: None,
91 })?;
92
93 print_success(&format!("Created organization: {}", info.slug));
94 println!();
95
96 let table = KeyValueTable::new()
97 .add("Name", &info.name)
98 .add("Slug", &info.slug)
99 .add("Kind", &info.kind)
100 .add("Plan", &info.plan);
101 let table = if let Some(email) = &info.email {
102 table.add("Email", email)
103 } else {
104 table
105 };
106 let table = table.add("ID", info.id.to_string());
107
108 println!("{table}");
109
110 print_next_steps(&[
111 (
112 &format!("atomic org set {}", info.slug),
113 "Set as your default org",
114 ),
115 ("atomic org member add <id>", "Add members to the org"),
116 ("atomic team create <name>", "Create a team"),
117 ]);
118
119 Ok(())
120 }
121}
122
123#[cfg(test)]

Callers 1

runMethod · 0.45

Calls 5

build_clientFunction · 0.85
create_orgFunction · 0.85
print_successFunction · 0.85
print_next_stepsFunction · 0.85
addMethod · 0.45

Tested by

no test coverage detected