@@ -39,10 +39,15 @@ import { loadGitignore, shouldIgnore } from "../../utils/ignore";
3939const AUTH_NAMESPACE = "enact:auth" ;
4040const ACCESS_TOKEN_KEY = "access_token" ;
4141
42+ /** Tool visibility levels */
43+ export type ToolVisibility = "public" | "private" | "unlisted" ;
44+
4245interface PublishOptions extends GlobalOptions {
4346 dryRun ?: boolean ;
4447 tag ?: string ;
4548 skipAuth ?: boolean ;
49+ public ?: boolean ;
50+ unlisted ?: boolean ;
4651}
4752
4853/**
@@ -203,10 +208,18 @@ async function publishHandler(
203208 header ( `Publishing ${ toolName } @${ version } ` ) ;
204209 newline ( ) ;
205210
211+ // Determine visibility (private by default for security)
212+ const visibility : ToolVisibility = options . public
213+ ? "public"
214+ : options . unlisted
215+ ? "unlisted"
216+ : "private" ;
217+
206218 // Show what we're publishing
207219 keyValue ( "Name" , toolName ) ;
208220 keyValue ( "Version" , version ) ;
209221 keyValue ( "Description" , manifest . description ) ;
222+ keyValue ( "Visibility" , visibility ) ;
210223 if ( manifest . tags && manifest . tags . length > 0 ) {
211224 keyValue ( "Tags" , manifest . tags . join ( ", " ) ) ;
212225 }
@@ -290,6 +303,7 @@ async function publishHandler(
290303 info ( "Would publish to registry:" ) ;
291304 keyValue ( "Tool" , toolName ) ;
292305 keyValue ( "Version" , version ) ;
306+ keyValue ( "Visibility" , visibility ) ;
293307 keyValue ( "Source" , toolDir ) ;
294308
295309 // Show files that would be bundled
@@ -326,6 +340,7 @@ async function publishHandler(
326340 manifest : manifest as unknown as Record < string , unknown > ,
327341 bundle,
328342 rawManifest : rawManifestContent ,
343+ visibility,
329344 } ) ;
330345 } ) ;
331346
@@ -337,10 +352,15 @@ async function publishHandler(
337352
338353 // Success output
339354 newline ( ) ;
340- success ( `Published ${ result . name } @${ result . version } ` ) ;
355+ success ( `Published ${ result . name } @${ result . version } ( ${ visibility } ) ` ) ;
341356 keyValue ( "Bundle Hash" , result . bundleHash ) ;
342357 keyValue ( "Published At" , result . publishedAt . toISOString ( ) ) ;
343358 newline ( ) ;
359+ if ( visibility === "private" ) {
360+ dim ( "This tool is private - only you can access it." ) ;
361+ } else if ( visibility === "unlisted" ) {
362+ dim ( "This tool is unlisted - accessible via direct link, not searchable." ) ;
363+ }
344364 dim ( `Install with: enact install ${ toolName } ` ) ;
345365}
346366
@@ -356,6 +376,8 @@ export function configurePublishCommand(program: Command): void {
356376 . option ( "-v, --verbose" , "Show detailed output" )
357377 . option ( "--skip-auth" , "Skip authentication (for local development)" )
358378 . option ( "--json" , "Output as JSON" )
379+ . option ( "--public" , "Publish as public (searchable by everyone)" )
380+ . option ( "--unlisted" , "Publish as unlisted (accessible via direct link, not searchable)" )
359381 . action ( async ( pathArg : string | undefined , options : PublishOptions ) => {
360382 const resolvedPath = pathArg ?? "." ;
361383 const ctx : CommandContext = {
0 commit comments