| name | no-content-response-custom-commands |
| description | How to author custom commands for the no-content-response CLI using the co-generated SDK. |
Custom Commands for no-content-response
Overview
The no-content-response CLI supports user-authored custom commands that are
compiled into the binary alongside the auto-generated API commands.
Custom commands get a fully-wired SDK client that inherits the CLI's
auth, retries, TLS, base URL, and global headers — zero configuration required.
Architecture
cli/no-content-response/custom.rs ← Your command handlers (protected by .fernignore)
cli/no-content-response/sdk.rs ← Generated bridge: client() + block_on()
cli/no-content-response/main.rs ← Generated entrypoint (calls custom::register)
no-content-response-sdk/ ← Co-generated typed SDK crate
no-content-response-types/ ← Co-generated typed model crate
Adding a Custom Command
1. Edit cli/no-content-response/custom.rs
This file is protected by .fernignore — fern generate will never
overwrite it. Register commands in the register() function:
use no_content_response_sdk::api::*;
pub fn register(app: CliApp) -> CliApp {
let app = app.command(
clap::Command::new("get")
.about("Get Contact")
.(clap::Arg::().())
,
|matches, ctx| {
= matches.get_one::<>().();
= super::sdk::(ctx);
= super::sdk::(
client.contacts.(id),
)?;
(, serde_json::(&result).());
(())
},
);
app
}