Skip to main content

objectiveai_cli/command/agents/
get.rs

1//! `agents get` — read an agent definition by remote path.
2
3use objectiveai_sdk::cli::command::agents::get::{Request, Response};
4
5use crate::context::Context;
6use crate::error::Error;
7
8pub async fn execute(ctx: &Context, request: Request) -> Result<Response, Error> {
9    let path = request.path;
10    Ok(objectiveai_sdk::agent::get_agent(ctx.api_client().await?, path).await?)
11}
12
13pub mod request_schema {
14    use objectiveai_sdk::cli::command::agents::get as sdk;
15    use objectiveai_sdk::cli::command::agents::get::request_schema::{Request, Response};
16
17    use crate::context::Context;
18    use crate::error::Error;
19
20    pub async fn execute(_ctx: &Context, _request: Request) -> Result<Response, Error> {
21        Ok(objectiveai_sdk::cli::command::ResponseSchema(schemars::schema_for!(sdk::Request)))
22    }
23}
24
25pub mod response_schema {
26    use objectiveai_sdk::cli::command::agents::get as sdk;
27    use objectiveai_sdk::cli::command::agents::get::response_schema::{Request, Response};
28
29    use crate::context::Context;
30    use crate::error::Error;
31
32    pub async fn execute(_ctx: &Context, _request: Request) -> Result<Response, Error> {
33        Ok(objectiveai_sdk::cli::command::ResponseSchema(schemars::schema_for!(sdk::Response)))
34    }
35}