jackwener/OpenCLI · error · ArgumentError
name required
Error message
name required
What it means
Thrown as an ArgumentError when the required positional 'name' argument is missing or only whitespace. The command validates args.name before doing any filesystem work, since a skill lookup without a name is meaningless.
Source
Thrown at clis/trae-solo/skill-fs.js:104
},
});
// -------- skill-fs-show --------
cli({
site: 'trae-solo',
name: 'skill-fs-show',
access: 'read',
description: 'Print a skill\'s SKILL.md content + on-disk path.',
domain: 'localhost',
browser: false,
strategy: Strategy.LOCAL,
args: [
{ name: 'name', positional: true, required: true, help: 'Skill name (folder under ~/.trae/skills/)' },
],
columns: ['Field', 'Value'],
func: async (args) => {
const name = String(args.name || '').trim();
if (!name) throw new ArgumentError('name required');
const dir = path.join(TRAE_SKILLS_DIR, name);
if (!fs.existsSync(dir)) {
throw new CommandExecutionError(`Skill "${name}" not found.`, `Tried: ${dir}`);
}
const meta = parseSkillMd(dir);
const skillMd = path.join(dir, 'SKILL.md');
const content = fs.existsSync(skillMd) ? fs.readFileSync(skillMd, 'utf-8') : '(no SKILL.md)';
return [
{ Field: 'Name', Value: meta.name },
{ Field: 'Path', Value: dir },
{ Field: 'Description', Value: (meta.description || '').slice(0, 200) },
{ Field: 'Tags', Value: (meta.tags || []).join(', ') },
{ Field: 'Author', Value: meta.author },
{ Field: 'Version', Value: meta.version },
{ Field: 'Files', Value: fs.readdirSync(dir).join(', ').slice(0, 200) },
{ Field: 'SKILL.md (head)', Value: content.slice(0, 1200) },
];
},View on GitHub (pinned to 49907e53dc)
Solutions
- Pass the skill folder name as the positional argument, e.g. the command with 'my-skill'.
- In scripts, guard the variable: [ -n "$SKILL" ] || exit 1 before invoking.
- Use --help to confirm argument order and required flags.
Example fix
// before await run(['skill-fs', 'show', '']) // after await run(['skill-fs', 'show', 'my-skill'])
Defensive patterns
Strategy: validation
Validate before calling
function requireSkillName(args) {
const name = String(args.name || '').trim();
if (!name) throw new Error('Pass a skill name, e.g. skill-fs show <name>');
return name;
} Type guard
function isNonEmptyString(v) {
return typeof v === 'string' && v.trim().length > 0;
} Try / catch
try {
await skillFsShow(name);
} catch (e) {
if (e instanceof ArgumentError && /name required/.test(e.message)) {
// print usage / prompt for the name
} else throw e;
} Prevention
- Always pass the positional name; quote shell variables so they don't expand empty.
- Validate user input is non-empty before calling.
- Check --help for required arguments.
When it happens
Trigger: Calling the skill-fs show/detail command without the positional name, or with an empty/whitespace string (e.g. name="" or name=" ").
Common situations: Scripting the CLI with an unquoted variable that expands to empty; forgetting the positional argument; passing flags only and assuming a default skill.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- douyin delete aweme_id cannot be empty
- douyin delete aweme_id must be a numeric id
- eastmoney convertible --limit must be an integer between 1 a
- INVALID_ARGUMENT
- limit must be a positive integer ≤ ${max}
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/70dd65ddbd30b7b1.
Report an issue: GitHub.