affaan-m/ECC · error · Error
Unknown argument: ${arg}
Error message
Unknown argument: ${arg} What it means
After confirming the URL scheme is https, _validate_import_url() requires a non-empty hostname. This catches malformed URLs that have a scheme but no host — e.g. 'https:///path' or 'https://:443/x'. Without a hostname the subsequent DNS resolution and connection would fail confusingly, so the validator fails fast with a clear message.
Source
Thrown at scripts/catalog.js:92
parsed.help = true;
} else if (arg === '--json') {
parsed.json = true;
} else if (arg === '--family') {
if (!args[index + 1]) {
throw new Error('Missing value for --family');
}
parsed.family = normalizeFamily(args[index + 1]);
index += 1;
} else if (arg === '--target') {
if (!args[index + 1]) {
throw new Error('Missing value for --target');
}
parsed.target = args[index + 1];
index += 1;
} else if (parsed.command === 'show' && !parsed.componentId) {
parsed.componentId = arg;
} else {
throw new Error(`Unknown argument: ${arg}`);
}
}
return parsed;
}
function printProfiles(profiles) {
console.log('Install profiles:\n');
for (const profile of profiles) {
console.log(`- ${profile.id} (${profile.moduleCount} modules)`);
console.log(` ${profile.description}`);
}
}
function printComponents(components) {
console.log('Install components:\n');
for (const component of components) {
console.log(`- ${component.id} [${component.family}]`);View on GitHub (pinned to 01e15490f0)
Solutions
- Include a valid hostname in the URL: 'https://example.com/instinct.md'.
- If building the URL from parts, validate each component (host non-empty) before assembling.
- Use urllib.parse.urlunparse with a populated netloc rather than manual string concatenation.
Example fix
# before
url = f'https:///{path}' # host dropped
_validate_import_url(url)
# after
import urllib.parse
url = urllib.parse.urlunparse(('https', 'example.com', f'/{path}', '', '', ''))
_validate_import_url(url) Defensive patterns
Strategy: validation
Validate before calling
# Require a non-empty hostname before validating.
import urllib.parse
parsed = urllib.parse.urlparse(source)
if not parsed.hostname:
raise SystemExit(f'URL is missing a hostname: {source!r}') Type guard
import urllib.parse
def url_has_host(s) -> bool:
return bool(urllib.parse.urlparse(s).hostname) Prevention
- Build URLs with urllib.parse.urlunparse from validated components rather than string concatenation.
- Reject empty hostnames at the config/input boundary.
When it happens
Trigger: Passing 'https:///instinct.md' (triple slash, no host); 'https://:443/file' (port but no host); a URL constructed by string concatenation that dropped the hostname segment.
Common situations: A templating/string-building bug omitted the host; a config field for the host was empty and was concatenated into the URL; copy-paste error.
Related errors
- Refusing to run install from untrusted repo root ${normalize
- Missing value for --target
- Catalog show requires an install component ID
- Unknown catalog command: ${options.command}
- Failed to read ${path.basename(filePath)}: ${error.message}
AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13).
Data as JSON: /api/errors/36e6b4222c0f1084.
Report an issue: GitHub.