Hmbown/CodeWhale · info
Usage: /network [list|allow |deny |remove |default…
Error message
Usage: /network [list|allow <host>|deny <host>|remove <host>|default <allow|deny|prompt>]
What it means
The fallback arm of network_inner: any subcommand other than list/allow/deny/remove/forget/default (or malformed top-level input) hits `bail!(usage())`, returning the full command usage string as the error. It is the generic bad-invocation guard for the /network command.
Solutions
- Use one of: /network, /network list, /network allow <host>, /network deny <host>, /network remove <host>, /network default <allow|deny|prompt>
- Check spelling of the subcommand
- Run plain `/network` to list current rules
Example fix
// before /network alow github.com // after /network allow github.com
Defensive patterns
Strategy: validation
Validate before calling
const VALID = ['list','allow','deny','remove','forget','default']; if (!VALID.includes(subcommand)) throw new Error(usage());
Try / catch
try { run(input); } catch (e) { if (String(e).startsWith('Usage: /network [')) printUsage(e.message); } Prevention
- Check subcommand spelling before running
- Consult the usage string: list, allow <host>, deny <host>, remove <host>, default <policy>
- No flags like --add exist; only the listed subcommands
When it happens
Trigger: Running `/network foo`, a misspelled subcommand like `/network alow github.com`, or leftover unexpected tokens routed to the catch-all arm.
Common situations: Typos in subcommand names; assuming flags like `--add` exist; translating shell firewall commands (ufw/iptables syntax) into /network.
Understand the failure class
Background: "Unknown argument", "Invalid value", and "must be one of": invalid CLI argument errors explained — this error's family across 35 libraries.
Related errors
- ; publication: ; completed review passes: / ; accumulated…
- Usage: codewhale pet serve
- Usage: /network
- Usage: /network default <allow|deny|prompt>
- A positive pull request number is required
AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22).
Data as JSON: /api/errors/81bcc2ed1af6bcfa.
Report an issue: GitHub.
Appendix: source
Thrown at crates/tui/src/commands/groups/utility/network.rs:77
}
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,
}
/// Resolve the active config document path through the leaf configuration
/// crate (acyclic; no TUI persistence helper).
fn config_toml_path() -> anyhow::Result<PathBuf> {
codewhale_config::resolve_config_path(None)View on GitHub (pinned to 73e0f67d83)