@@ -131,6 +131,21 @@ export class Instances extends APIResource {
131131 return this . _client . post ( path `/instances/${ id } /start` , options ) ;
132132 }
133133
134+ /**
135+ * Returns information about a path in the guest filesystem. Useful for checking if
136+ * a path exists, its type, and permissions before performing file operations.
137+ *
138+ * @example
139+ * ```ts
140+ * const pathInfo = await client.instances.stat('id', {
141+ * path: 'path',
142+ * });
143+ * ```
144+ */
145+ stat ( id : string , query : InstanceStatParams , options ?: RequestOptions ) : APIPromise < PathInfo > {
146+ return this . _client . get ( path `/instances/${ id } /stat` , { query, ...options } ) ;
147+ }
148+
134149 /**
135150 * Stop instance (graceful shutdown)
136151 *
@@ -261,6 +276,43 @@ export namespace Instance {
261276 }
262277}
263278
279+ export interface PathInfo {
280+ /**
281+ * Whether the path exists
282+ */
283+ exists : boolean ;
284+
285+ /**
286+ * True if this is a directory
287+ */
288+ is_dir ?: boolean ;
289+
290+ /**
291+ * True if this is a regular file
292+ */
293+ is_file ?: boolean ;
294+
295+ /**
296+ * True if this is a symbolic link (only set when follow_links=false)
297+ */
298+ is_symlink ?: boolean ;
299+
300+ /**
301+ * Symlink target path (only set when is_symlink=true)
302+ */
303+ link_target ?: string | null ;
304+
305+ /**
306+ * File mode (Unix permissions)
307+ */
308+ mode ?: number ;
309+
310+ /**
311+ * File size in bytes
312+ */
313+ size ?: number ;
314+ }
315+
264316export interface PortMapping {
265317 /**
266318 * Port in the guest VM
@@ -393,17 +445,31 @@ export interface InstanceLogsParams {
393445 tail ?: number ;
394446}
395447
448+ export interface InstanceStatParams {
449+ /**
450+ * Path to stat in the guest filesystem
451+ */
452+ path : string ;
453+
454+ /**
455+ * Follow symbolic links (like stat vs lstat)
456+ */
457+ follow_links ?: boolean ;
458+ }
459+
396460Instances . Volumes = Volumes ;
397461
398462export declare namespace Instances {
399463 export {
400464 type Instance as Instance ,
465+ type PathInfo as PathInfo ,
401466 type PortMapping as PortMapping ,
402467 type VolumeMount as VolumeMount ,
403468 type InstanceListResponse as InstanceListResponse ,
404469 type InstanceLogsResponse as InstanceLogsResponse ,
405470 type InstanceCreateParams as InstanceCreateParams ,
406471 type InstanceLogsParams as InstanceLogsParams ,
472+ type InstanceStatParams as InstanceStatParams ,
407473 } ;
408474
409475 export {
0 commit comments