{"record":{"id":"81bcc2ed1af6bcfa","repo":"Hmbown/CodeWhale","slug":"usage-network-list-allow-host-deny-host-rem","errorCode":null,"errorMessage":"Usage: /network [list|allow <host>|deny <host>|remove <host>|default <allow|deny|prompt>]","messagePattern":"Usage: /network \\[list\\|allow <host>\\|deny <host>\\|remove <host>\\|default <allow\\|deny\\|prompt>\\]","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"warning","filePath":"crates/tui/src/commands/groups/utility/network.rs","lineNumber":78,"sourceCode":"            }\n            let host = normalize_host_arg(host_arg)?;\n            let edit = match command.as_str() {\n                \"allow\" => NetworkEdit::Allow,\n                \"deny\" => NetworkEdit::Deny,\n                _ => NetworkEdit::Remove,\n            };\n            update_host(edit, &host)\n        }\n        \"default\" => {\n            let Some(value) = parts.next() else {\n                bail!(\"Usage: /network default <allow|deny|prompt>\");\n            };\n            if parts.next().is_some() {\n                bail!(\"Usage: /network default <allow|deny|prompt>\");\n            }\n            update_default(value)\n        }\n        _ => bail!(usage()),\n    }\n}\n\nfn usage() -> &'static str {\n    \"Usage: /network [list|allow <host>|deny <host>|remove <host>|default <allow|deny|prompt>]\"\n}\n\n#[derive(Clone, Copy)]\nenum NetworkEdit {\n    Allow,\n    Deny,\n    Remove,\n}\n\nfn list_policy() -> anyhow::Result<String> {\n    let path = crate::config_persistence::config_toml_path(None)?;\n    let doc = load_config_doc(&path)?;\n    let network = doc.get(\"network\").and_then(Value::as_table);","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/commands/groups/utility/network.rs#L60-L96","documentation":"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.","triggerScenarios":"Running `/network <anything>` where the first token is not one of the recognized subcommands, e.g. `/network block`, `/network status`, `/network reset`.","commonSituations":"Guessing subcommand names from other tools (`block`/`unblock`, `on`/`off`); typos like `/network alllow`; version drift after subcommands were renamed.","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"],"exampleFix":"// before\n/network block ads.example.com\n\n// after\n/network deny ads.example.com","handlingStrategy":"validation","validationCode":"const NETWORK_SUBCOMMANDS: &[&str] = &[\"allow\", \"deny\", \"remove\", \"forget\", \"default\"];\nif let Some(cmd) = raw.split_whitespace().next() {\n    anyhow::ensure!(\n        NETWORK_SUBCOMMANDS.contains(&cmd.to_ascii_lowercase().as_str()),\n        \"unknown subcommand {cmd:?}; valid: {NETWORK_SUBCOMMANDS:?}\"\n    );\n}","typeGuard":"fn is_known_network_subcommand(cmd: &str) -> bool {\n    matches!(cmd, \"allow\" | \"deny\" | \"remove\" | \"forget\" | \"default\")\n}","tryCatchPattern":null,"preventionTips":["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"],"tags":["slash-command","network-policy","usage","cli","unknown-command"],"backgroundTag":"unknown-subcommand","analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}