Hmbown/CodeWhale · warning · anyhow::Error
Usage: /network [list|allow <host>|deny <host>|remove <host>
Error message
Usage: /network [list|allow <host>|deny <host>|remove <host>|default <allow|deny|prompt>]
What it means
Catch-all usage error from the `/network` slash command: the first token did not match any known subcommand (`allow`, `deny`, `remove`, `forget`, `default`), so the full usage line listing every valid form is returned. The empty-input case never reaches here — bare `/network` lists the policy — so this specifically means an unrecognized subcommand was typed.
Source
Thrown at crates/tui/src/commands/groups/utility/network.rs:78
}
let host = normalize_host_arg(host_arg)?;
let edit = match command.as_str() {
"allow" => NetworkEdit::Allow,
"deny" => NetworkEdit::Deny,
_ => NetworkEdit::Remove,
};
update_host(edit, &host)
}
"default" => {
let Some(value) = parts.next() else {
bail!("Usage: /network default <allow|deny|prompt>");
};
if parts.next().is_some() {
bail!("Usage: /network default <allow|deny|prompt>");
}
update_default(value)
}
_ => bail!(usage()),
}
}
fn usage() -> &'static str {
"Usage: /network [list|allow <host>|deny <host>|remove <host>|default <allow|deny|prompt>]"
}
#[derive(Clone, Copy)]
enum NetworkEdit {
Allow,
Deny,
Remove,
}
fn list_policy() -> anyhow::Result<String> {
let path = crate::config_persistence::config_toml_path(None)?;
let doc = load_config_doc(&path)?;
let network = doc.get("network").and_then(Value::as_table);View on GitHub (pinned to 0c42157ee5)
Solutions
- Match the usage line: use list, allow <host>, deny <host>, remove <host>, or default <allow|deny|prompt>
- Run bare `/network` to list current policy and see the command's expectations
- Check the changelog if a remembered subcommand no longer exists
Example fix
// before /network block ads.example.com // after /network deny ads.example.com
Defensive patterns
Strategy: validation
Validate before calling
const NETWORK_SUBCOMMANDS: &[&str] = &["allow", "deny", "remove", "forget", "default"];
if let Some(cmd) = raw.split_whitespace().next() {
anyhow::ensure!(
NETWORK_SUBCOMMANDS.contains(&cmd.to_ascii_lowercase().as_str()),
"unknown subcommand {cmd:?}; valid: {NETWORK_SUBCOMMANDS:?}"
);
} Type guard
fn is_known_network_subcommand(cmd: &str) -> bool {
matches!(cmd, "allow" | "deny" | "remove" | "forget" | "default")
} Prevention
- Offer subcommand completion in the UI so typos never reach dispatch
- Bare /network lists policy — use it to re-learn the command shape after upgrades
When it happens
Trigger: Running `/network <anything>` where the first token is not one of the recognized subcommands, e.g. `/network block`, `/network status`, `/network reset`.
Common situations: Guessing subcommand names from other tools (`block`/`unblock`, `on`/`off`); typos like `/network alllow`; version drift after subcommands were renamed.
Related errors
- Usage: /network {command} <host>
- Usage: /network default <allow|deny|prompt>
- The Codewhale service returned an unexpectedly large respons
- Codewhale account login timed out; run `codewhale account lo
- The Codewhale service returned an account without an ID
AI-assisted analysis of Hmbown/CodeWhale@0c42157ee5 (2026-08-20).
Data as JSON: /api/errors/81bcc2ed1af6bcfa.
Report an issue: GitHub.