MCPcopy Create free account
hub / github.com/modelcontextprotocol/mcpb / promptBasicInfo

Function promptBasicInfo

src/cli/init.ts:143–185  ·  view source on GitHub ↗
(
  packageData: PackageJson,
  resolvedPath: string,
)

Source from the content-addressed store, hash-verified

141}
142
143export async function promptBasicInfo(
144 packageData: PackageJson,
145 resolvedPath: string,
146) {
147 const defaultName = packageData.name || basename(resolvedPath);
148
149 const name = await input({
150 message: "Extension name:",
151 default: defaultName,
152 validate: (value) => value.trim().length > 0 || "Name is required",
153 });
154
155 const authorName = await input({
156 message: "Author name:",
157 default: getDefaultAuthorName(packageData),
158 validate: (value) => value.trim().length > 0 || "Author name is required",
159 });
160
161 const displayName = await input({
162 message: "Display name (optional):",
163 default: name,
164 });
165
166 const version = await input({
167 message: "Version:",
168 default: packageData.version || "1.0.0",
169 validate: (value) => {
170 if (!value.trim()) return "Version is required";
171 if (!/^\d+\.\d+\.\d+/.test(value)) {
172 return "Version must follow semantic versioning (e.g., 1.0.0)";
173 }
174 return true;
175 },
176 });
177
178 const description = await input({
179 message: "Description:",
180 default: packageData.description || "",
181 validate: (value) => value.trim().length > 0 || "Description is required",
182 });
183
184 return { name, authorName, displayName, version, description };
185}
186
187export async function promptAuthorInfo(packageData: PackageJson) {
188 const authorEmail = await input({

Callers 1

initExtensionFunction · 0.85

Calls 1

getDefaultAuthorNameFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…